Skip to content

Commit

Permalink
HOSTEDCP-1000: Add image to management cluster capabilities
Browse files Browse the repository at this point in the history
https://issues.redhat.com/browse/HOSTEDCP-1000
image.config.openshift.io will need to be checked for
the CAs for the image registries a user specifies.
  • Loading branch information
CrystalChun committed Jul 13, 2023
1 parent e109bfe commit 34029b7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions support/capabilities/management_cluster_capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ const (
// supports security context constraints
CapabilitySecurityContextConstraint

// CapabilityImage indicates if the cluster supports the
// image.config.openshift.io api
CapabilityImage

// CapabilityInfrastructure indicates if the cluster supports the
// infrastructures.config.openshift.io api
CapabilityInfrastructure
Expand Down Expand Up @@ -115,6 +119,15 @@ func DetectManagementClusterCapabilities(client discovery.ServerResourcesInterfa
discoveredCapabilities[CapabilitySecurityContextConstraint] = struct{}{}
}

// check for image capability
hasImageCap, err := isAPIResourceRegistered(client, configv1.GroupVersion, "image")
if err != nil {
return nil, err
}
if hasImageCap {
discoveredCapabilities[CapabilityImage] = struct{}{}
}

// check for infrastructure capability
hasInfraCap, err := isAPIResourceRegistered(client, configv1.GroupVersion, "infrastructures")
if err != nil {
Expand Down

0 comments on commit 34029b7

Please sign in to comment.