From d8a8db6df1065fc9956438ad1e9e2ca92b28fac7 Mon Sep 17 00:00:00 2001 From: Nick Hale Date: Thu, 24 Mar 2022 12:10:11 -0400 Subject: [PATCH 1/2] config/v1/types_cluster_version: add marketplace capability Add a ClusterVersionCapability representing the Operator Marketplace as a capability named "marketplace". Signed-off-by: Nick Hale --- ...0_cluster-version-operator_01_clusterversion.crd.yaml | 3 +++ config/v1/types_cluster_version.go | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/config/v1/0000_00_cluster-version-operator_01_clusterversion.crd.yaml b/config/v1/0000_00_cluster-version-operator_01_clusterversion.crd.yaml index ceb8b7e6d50..24f379c132c 100644 --- a/config/v1/0000_00_cluster-version-operator_01_clusterversion.crd.yaml +++ b/config/v1/0000_00_cluster-version-operator_01_clusterversion.crd.yaml @@ -65,6 +65,7 @@ spec: enum: - openshift-samples - baremetal + - marketplace x-kubernetes-list-type: atomic baselineCapabilitySet: description: baselineCapabilitySet selects an initial set of optional capabilities to enable, which can be extended via additionalEnabledCapabilities. If unset, the cluster will choose a default, and the default may change over time. The current default is vCurrent. @@ -167,6 +168,7 @@ spec: enum: - openshift-samples - baremetal + - marketplace x-kubernetes-list-type: atomic knownCapabilities: description: knownCapabilities lists all the capabilities known to the current cluster. @@ -177,6 +179,7 @@ spec: enum: - openshift-samples - baremetal + - marketplace x-kubernetes-list-type: atomic conditionalUpdates: description: conditionalUpdates contains the list of updates that may be recommended for this cluster if it meets specific required conditions. Consumers interested in the set of updates that are actually recommended for this cluster should use availableUpdates. This list may be empty if no updates are recommended, if the update service is unavailable, or if an empty or invalid channel has been specified. diff --git a/config/v1/types_cluster_version.go b/config/v1/types_cluster_version.go index cd907699fe4..52248a68ef8 100644 --- a/config/v1/types_cluster_version.go +++ b/config/v1/types_cluster_version.go @@ -225,7 +225,7 @@ type UpdateHistory struct { type ClusterID string // ClusterVersionCapability enumerates optional, core cluster components. -// +kubebuilder:validation:Enum=openshift-samples;baremetal +// +kubebuilder:validation:Enum=openshift-samples;baremetal;marketplace type ClusterVersionCapability string const ( @@ -240,6 +240,11 @@ const ( // baremetal operator which is responsible for running the metal3 // deployment. ClusterVersionCapabilityBaremetal ClusterVersionCapability = "baremetal" + + // ClusterVersionCapabilityMarketplace manages the Marketplace operator which + // supplies Operator Lifecycle Manager (OLM) users with default catalogs of + // "optional" operators. + ClusterVersionCapabilityMarketplace ClusterVersionCapability = "marketplace" ) // ClusterVersionCapabilitySet defines sets of cluster version capabilities. @@ -269,10 +274,12 @@ var ClusterVersionCapabilitySets = map[ClusterVersionCapabilitySet][]ClusterVers ClusterVersionCapabilitySet4_11: { ClusterVersionCapabilityOpenShiftSamples, ClusterVersionCapabilityBaremetal, + ClusterVersionCapabilityMarketplace, }, ClusterVersionCapabilitySetCurrent: { ClusterVersionCapabilityOpenShiftSamples, ClusterVersionCapabilityBaremetal, + ClusterVersionCapabilityMarketplace, }, } From 946f9b49c1776d61acfdeda5dbd292c5df9b732d Mon Sep 17 00:00:00 2001 From: Nick Hale Date: Thu, 24 Mar 2022 12:38:20 -0400 Subject: [PATCH 2/2] config/v1: add marketplace capability annotation to operatorhub crd manifest Signed-off-by: Nick Hale --- config/v1/0000_03_config-operator_01_operatorhub.crd.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/v1/0000_03_config-operator_01_operatorhub.crd.yaml b/config/v1/0000_03_config-operator_01_operatorhub.crd.yaml index 4ba6c01cf4b..e9895002f3e 100644 --- a/config/v1/0000_03_config-operator_01_operatorhub.crd.yaml +++ b/config/v1/0000_03_config-operator_01_operatorhub.crd.yaml @@ -6,6 +6,7 @@ metadata: include.release.openshift.io/ibm-cloud-managed: "true" include.release.openshift.io/self-managed-high-availability: "true" include.release.openshift.io/single-node-developer: "true" + capability.openshift.io/name: "marketplace" name: operatorhubs.config.openshift.io spec: group: config.openshift.io