From 9066250148f8bbad84e1699a1e7eb18efbca2c77 Mon Sep 17 00:00:00 2001 From: CrystalChun Date: Fri, 30 Jun 2023 15:19:46 -0700 Subject: [PATCH] HOSTEDCP-1000: Add image to management cluster capabilities 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. --- .../capabilities/management_cluster_capabilities.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/support/capabilities/management_cluster_capabilities.go b/support/capabilities/management_cluster_capabilities.go index d281100e4f4..d4542fba7bb 100644 --- a/support/capabilities/management_cluster_capabilities.go +++ b/support/capabilities/management_cluster_capabilities.go @@ -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 @@ -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 {