Skip to content

Commit 0be8d41

Browse files
committed
Log the version speculation only once
1 parent 6bb3755 commit 0be8d41

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

pkg/cli/admin/release/extract_tools.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,12 +1301,12 @@ func findClusterIncludeConfigFromInstallConfig(_ context.Context, installConfigP
13011301
} else {
13021302
if data.Capabilities.BaselineCapabilitySet == configv1.ClusterVersionCapabilitySetCurrent {
13031303
klog.Infof("If the eventual cluster will not be the same minor version as this %s 'oc', the actual %s capability set may differ.", reportedVersion, data.Capabilities.BaselineCapabilitySet)
1304+
} else {
1305+
klog.Infof("If the eventual cluster will not be the same minor version as this %s 'oc', the known capability sets may differ.", reportedVersion)
13041306
}
13051307
config.Capabilities.EnabledCapabilities = append(config.Capabilities.EnabledCapabilities, enabled...)
13061308
}
13071309
config.Capabilities.EnabledCapabilities = append(config.Capabilities.EnabledCapabilities, data.Capabilities.AdditionalEnabledCapabilities...)
1308-
1309-
klog.Infof("If the eventual cluster will not be the same minor version as this %s 'oc', the known capability sets may differ.", reportedVersion)
13101310
config.Capabilities.KnownCapabilities = configv1.KnownClusterVersionCapabilities
13111311
}
13121312

@@ -1338,11 +1338,17 @@ func findClusterIncludeConfig(ctx context.Context, restConfig *rest.Config, repo
13381338
capSet = capabilitiesSpec.BaselineCapabilitySet
13391339
}
13401340
deepCopy := clusterVersion.Status.Capabilities.DeepCopy()
1341+
// The logging here is to tell the cluster admin that we are using the oc version as the target version.
1342+
// TODO: We get the target version from the pull spec that we are extracting
1343+
// and use it in the findClusterIncludeConfigFromInstallConfig function as well
1344+
// and then we can remove the "is most accurate" sentence in the command description.
1345+
// https://github.com/openshift/oc/blob/def90a65fcbad5d7e54add49975e9c3daa92a4f9/pkg/cli/admin/release/extract.go#L101-L102
13411346
if capSet == configv1.ClusterVersionCapabilitySetCurrent {
13421347
klog.Infof("If the eventual cluster will not be the same minor version as this %s 'oc', the actual %s capability set may differ.", reportedVersion, capSet)
1348+
} else {
1349+
klog.Infof("If the eventual cluster will not be the same minor version as this %s 'oc', the known capability sets may differ.", reportedVersion)
13431350
}
13441351
deepCopy.EnabledCapabilities = append(deepCopy.EnabledCapabilities, configv1.ClusterVersionCapabilitySets[capSet]...)
1345-
klog.Infof("If the eventual cluster will not be the same minor version as this %s 'oc', the known capability sets may differ.", reportedVersion)
13461352
deepCopy.KnownCapabilities = configv1.KnownClusterVersionCapabilities
13471353
config.Capabilities = deepCopy
13481354
}

0 commit comments

Comments
 (0)