Skip to content

Commit b3fb741

Browse files
committed
pkg/cli/admin/release/extract_tools: Enable ImageRegistry, etc. on 4.13-to-4.14
Catching up with 4.14's [1]. As with MachineAPI, all of the new capabilities were enabled in all 4.13 clusters, and because capabilities cannot be uninstalled [2], that means they'll be enabled, possibly implicitly, after an update to 4.14. Including them here ensures that we extract the ImageRegistry CredentialsRequest in: $ oc adm release extract --included --credentials-requests --to credentials-requests quay.io/openshift-release-dev/ocp-release:4.14.0... when connecting to a currently-4.13 cluster. [3] is tracking a more sustainable long-term approach. [1]: openshift/cluster-version-operator@ba3aeb9#diff-f3e6bd2d0c764f1c28fd5d20520a2224b1f3cb5306500aeefd056a4efc857d34R318-R336 [2]: https://github.com/openshift/enhancements/blob/6cebc13f0672c601ebfae669ea4fc8ca632721b5/enhancements/installer/component-selection.md#capabilities-cannot-be-uninstalled [3]: https://issues.redhat.com/browse/OTA-1010
1 parent 795bf1a commit b3fb741

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pkg/cli/admin/release/extract_tools.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,15 +1026,17 @@ func findClusterIncludeConfig(ctx context.Context, restConfig *rest.Config) (man
10261026
config.Overrides = clusterVersion.Spec.Overrides
10271027
config.Capabilities = &clusterVersion.Status.Capabilities
10281028

1029-
// FIXME: eventually pull in GetImplicitlyEnabledCapabilities from https://github.com/openshift/cluster-version-operator/blob/86e24d66119a73f50282b66a8d6f2e3518aa0e15/pkg/payload/payload.go#L237-L240 for cases where a minor update would implicitly enable some additional capabilities. For now, 4.13 to 4.14 will always enable MachineAPI.
1029+
// FIXME: eventually pull in GetImplicitlyEnabledCapabilities from https://github.com/openshift/cluster-version-operator/blob/86e24d66119a73f50282b66a8d6f2e3518aa0e15/pkg/payload/payload.go#L237-L240 for cases where a minor update would implicitly enable some additional capabilities. For now, 4.13 to 4.14 will always enable MachineAPI, ImageRegistry, etc..
10301030
currentVersion := clusterVersion.Status.Desired.Version
10311031
matches := regexp.MustCompile(`^(\d+[.]\d+)[.].*`).FindStringSubmatch(currentVersion)
10321032
if len(matches) < 2 {
10331033
return config, fmt.Errorf("failed to parse major.minor version from ClusterVersion status.desired.version %q", currentVersion)
10341034
} else if matches[1] == "4.13" {
1035-
machineAPI := configv1.ClusterVersionCapability("MachineAPI")
1036-
config.Capabilities.EnabledCapabilities = append(config.Capabilities.EnabledCapabilities, machineAPI)
1037-
config.Capabilities.KnownCapabilities = append(config.Capabilities.KnownCapabilities, machineAPI)
1035+
build := configv1.ClusterVersionCapability("Build")
1036+
deploymentConfig := configv1.ClusterVersionCapability("DeploymentConfig")
1037+
imageRegistry := configv1.ClusterVersionCapability("ImageRegistry")
1038+
config.Capabilities.EnabledCapabilities = append(config.Capabilities.EnabledCapabilities, configv1.ClusterVersionCapabilityMachineAPI, build, deploymentConfig, imageRegistry)
1039+
config.Capabilities.KnownCapabilities = append(config.Capabilities.KnownCapabilities, configv1.ClusterVersionCapabilityMachineAPI, build, deploymentConfig, imageRegistry)
10381040
}
10391041
}
10401042

0 commit comments

Comments
 (0)