diff --git a/Makefile b/Makefile
index 16471461f..5999aad47 100644
--- a/Makefile
+++ b/Makefile
@@ -118,14 +118,20 @@ KUSTOMIZE_CATD_RBAC_DIR := config/base/catalogd/rbac
KUSTOMIZE_CATD_WEBHOOKS_DIR := config/base/catalogd/manager/webhook
KUSTOMIZE_OPCON_CRDS_DIR := config/base/operator-controller/crd/bases
KUSTOMIZE_OPCON_RBAC_DIR := config/base/operator-controller/rbac
+CRD_WORKING_DIR := crd_work_dir
+# Due to https://github.com/kubernetes-sigs/controller-tools/issues/837 we can't specify individual files
+# So we have to generate them together and then move them into place
manifests: $(CONTROLLER_GEN) #EXHELP Generate WebhookConfiguration, ClusterRole, and CustomResourceDefinition objects.
- # Generate the operator-controller manifests
- rm -rf $(KUSTOMIZE_OPCON_CRDS_DIR) && $(CONTROLLER_GEN) crd paths=./api/operator-controller/... output:crd:artifacts:config=$(KUSTOMIZE_OPCON_CRDS_DIR)
- rm -f $(KUSTOMIZE_OPCON_RBAC_DIR)/role.yaml && $(CONTROLLER_GEN) rbac:roleName=manager-role paths=./internal/operator-controller/... output:rbac:artifacts:config=$(KUSTOMIZE_OPCON_RBAC_DIR)
- # Generate the catalogd manifests
- rm -rf $(KUSTOMIZE_CATD_CRDS_DIR) && $(CONTROLLER_GEN) crd paths=./api/catalogd/... output:crd:artifacts:config=$(KUSTOMIZE_CATD_CRDS_DIR)
- rm -f $(KUSTOMIZE_CATD_RBAC_DIR)/role.yaml && $(CONTROLLER_GEN) rbac:roleName=manager-role paths="./internal/catalogd/..." output:rbac:artifacts:config=$(KUSTOMIZE_CATD_RBAC_DIR)
- rm -f $(KUSTOMIZE_CATD_WEBHOOKS_DIR)/manifests.yaml && $(CONTROLLER_GEN) webhook paths="./internal/catalogd/..." output:webhook:artifacts:config=$(KUSTOMIZE_CATD_WEBHOOKS_DIR)
+ mkdir $(CRD_WORKING_DIR)
+ $(CONTROLLER_GEN) crd paths="./api/v1/..." output:crd:artifacts:config=$(CRD_WORKING_DIR)
+ mv $(CRD_WORKING_DIR)/olm.operatorframework.io_clusterextensions.yaml $(KUSTOMIZE_OPCON_CRDS_DIR)
+ mv $(CRD_WORKING_DIR)/olm.operatorframework.io_clustercatalogs.yaml $(KUSTOMIZE_CATD_CRDS_DIR)
+ rmdir $(CRD_WORKING_DIR)
+ # Generate the remaining operator-controller manifests
+ $(CONTROLLER_GEN) rbac:roleName=manager-role paths="./internal/operator-controller/..." output:rbac:artifacts:config=$(KUSTOMIZE_OPCON_RBAC_DIR)
+ # Generate the remaining catalogd manifests
+ $(CONTROLLER_GEN) rbac:roleName=manager-role paths="./internal/catalogd/..." output:rbac:artifacts:config=$(KUSTOMIZE_CATD_RBAC_DIR)
+ $(CONTROLLER_GEN) webhook paths="./internal/catalogd/..." output:webhook:artifacts:config=$(KUSTOMIZE_CATD_WEBHOOKS_DIR)
.PHONY: generate
generate: $(CONTROLLER_GEN) #EXHELP Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
@@ -353,20 +359,13 @@ quickstart: $(KUSTOMIZE) manifests #EXHELP Generate the unified installation rel
.PHONY: crd-ref-docs
OPERATOR_CONTROLLER_API_REFERENCE_FILENAME := operator-controller-api-reference.md
-CATALOGD_API_REFERENCE_FILENAME := catalogd-api-reference.md
API_REFERENCE_DIR := $(ROOT_DIR)/docs/api-reference
-
crd-ref-docs: $(CRD_REF_DOCS) #EXHELP Generate the API Reference Documents.
rm -f $(API_REFERENCE_DIR)/$(OPERATOR_CONTROLLER_API_REFERENCE_FILENAME)
- $(CRD_REF_DOCS) --source-path=$(ROOT_DIR)/api/operator-controller \
+ $(CRD_REF_DOCS) --source-path=$(ROOT_DIR)/api/ \
--config=$(API_REFERENCE_DIR)/crd-ref-docs-gen-config.yaml \
--renderer=markdown --output-path=$(API_REFERENCE_DIR)/$(OPERATOR_CONTROLLER_API_REFERENCE_FILENAME);
- rm -f $(API_REFERENCE_DIR)/$(CATALOGD_API_REFERENCE_FILENAME)
- $(CRD_REF_DOCS) --source-path=$(ROOT_DIR)/api/catalogd \
- --config=$(API_REFERENCE_DIR)/crd-ref-docs-gen-config.yaml \
- --renderer=markdown --output-path=$(API_REFERENCE_DIR)/$(CATALOGD_API_REFERENCE_FILENAME);
-
VENVDIR := $(abspath docs/.venv)
.PHONY: build-docs
diff --git a/Tiltfile b/Tiltfile
index b455deec6..6a77c9cf9 100644
--- a/Tiltfile
+++ b/Tiltfile
@@ -6,7 +6,7 @@ operator_controller = {
'binaries': {
'./cmd/operator-controller': 'operator-controller-controller-manager',
},
- 'deps': ['api/operator-controller', 'cmd/operator-controller', 'internal/operator-controller', 'internal/shared', 'go.mod', 'go.sum'],
+ 'deps': ['api', 'cmd/operator-controller', 'internal/operator-controller', 'internal/shared', 'go.mod', 'go.sum'],
'starting_debug_port': 30000,
}
deploy_repo('operator-controller', operator_controller, '-tags containers_image_openpgp')
@@ -17,7 +17,7 @@ catalogd = {
'binaries': {
'./catalogd/cmd/catalogd': 'catalogd-controller-manager',
},
- 'deps': ['api/catalogd', 'catalogd/cmd/catalogd', 'internal/catalogd', 'internal/shared', 'go.mod', 'go.sum'],
+ 'deps': ['api', 'catalogd/cmd/catalogd', 'internal/catalogd', 'internal/shared', 'go.mod', 'go.sum'],
'starting_debug_port': 20000,
}
diff --git a/api/catalogd/v1/groupversion_info.go b/api/catalogd/v1/groupversion_info.go
deleted file mode 100644
index adb650eb2..000000000
--- a/api/catalogd/v1/groupversion_info.go
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-Copyright 2022.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Package v1 contains API Schema definitions for the core v1 API group
-// +kubebuilder:object:generate=true
-// +groupName=olm.operatorframework.io
-package v1
-
-import (
- "k8s.io/apimachinery/pkg/runtime/schema"
- "sigs.k8s.io/controller-runtime/pkg/scheme"
-)
-
-var (
- // GroupVersion is group version used to register these objects
- GroupVersion = schema.GroupVersion{Group: "olm.operatorframework.io", Version: "v1"}
-
- // SchemeBuilder is used to add go types to the GroupVersionKind scheme
- SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
-
- // AddToScheme adds the types in this group-version to the given scheme.
- AddToScheme = SchemeBuilder.AddToScheme
-)
diff --git a/api/catalogd/v1/zz_generated.deepcopy.go b/api/catalogd/v1/zz_generated.deepcopy.go
deleted file mode 100644
index ce4237514..000000000
--- a/api/catalogd/v1/zz_generated.deepcopy.go
+++ /dev/null
@@ -1,227 +0,0 @@
-//go:build !ignore_autogenerated
-
-/*
-Copyright 2022.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Code generated by controller-gen. DO NOT EDIT.
-
-package v1
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- runtime "k8s.io/apimachinery/pkg/runtime"
-)
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *CatalogSource) DeepCopyInto(out *CatalogSource) {
- *out = *in
- if in.Image != nil {
- in, out := &in.Image, &out.Image
- *out = new(ImageSource)
- (*in).DeepCopyInto(*out)
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogSource.
-func (in *CatalogSource) DeepCopy() *CatalogSource {
- if in == nil {
- return nil
- }
- out := new(CatalogSource)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ClusterCatalog) DeepCopyInto(out *ClusterCatalog) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
- in.Spec.DeepCopyInto(&out.Spec)
- in.Status.DeepCopyInto(&out.Status)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCatalog.
-func (in *ClusterCatalog) DeepCopy() *ClusterCatalog {
- if in == nil {
- return nil
- }
- out := new(ClusterCatalog)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *ClusterCatalog) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ClusterCatalogList) DeepCopyInto(out *ClusterCatalogList) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- in.ListMeta.DeepCopyInto(&out.ListMeta)
- if in.Items != nil {
- in, out := &in.Items, &out.Items
- *out = make([]ClusterCatalog, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCatalogList.
-func (in *ClusterCatalogList) DeepCopy() *ClusterCatalogList {
- if in == nil {
- return nil
- }
- out := new(ClusterCatalogList)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *ClusterCatalogList) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ClusterCatalogSpec) DeepCopyInto(out *ClusterCatalogSpec) {
- *out = *in
- in.Source.DeepCopyInto(&out.Source)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCatalogSpec.
-func (in *ClusterCatalogSpec) DeepCopy() *ClusterCatalogSpec {
- if in == nil {
- return nil
- }
- out := new(ClusterCatalogSpec)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ClusterCatalogStatus) DeepCopyInto(out *ClusterCatalogStatus) {
- *out = *in
- if in.Conditions != nil {
- in, out := &in.Conditions, &out.Conditions
- *out = make([]metav1.Condition, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
- if in.ResolvedSource != nil {
- in, out := &in.ResolvedSource, &out.ResolvedSource
- *out = new(ResolvedCatalogSource)
- (*in).DeepCopyInto(*out)
- }
- if in.URLs != nil {
- in, out := &in.URLs, &out.URLs
- *out = new(ClusterCatalogURLs)
- **out = **in
- }
- if in.LastUnpacked != nil {
- in, out := &in.LastUnpacked, &out.LastUnpacked
- *out = (*in).DeepCopy()
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCatalogStatus.
-func (in *ClusterCatalogStatus) DeepCopy() *ClusterCatalogStatus {
- if in == nil {
- return nil
- }
- out := new(ClusterCatalogStatus)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ClusterCatalogURLs) DeepCopyInto(out *ClusterCatalogURLs) {
- *out = *in
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCatalogURLs.
-func (in *ClusterCatalogURLs) DeepCopy() *ClusterCatalogURLs {
- if in == nil {
- return nil
- }
- out := new(ClusterCatalogURLs)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ImageSource) DeepCopyInto(out *ImageSource) {
- *out = *in
- if in.PollIntervalMinutes != nil {
- in, out := &in.PollIntervalMinutes, &out.PollIntervalMinutes
- *out = new(int)
- **out = **in
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageSource.
-func (in *ImageSource) DeepCopy() *ImageSource {
- if in == nil {
- return nil
- }
- out := new(ImageSource)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ResolvedCatalogSource) DeepCopyInto(out *ResolvedCatalogSource) {
- *out = *in
- if in.Image != nil {
- in, out := &in.Image, &out.Image
- *out = new(ResolvedImageSource)
- **out = **in
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResolvedCatalogSource.
-func (in *ResolvedCatalogSource) DeepCopy() *ResolvedCatalogSource {
- if in == nil {
- return nil
- }
- out := new(ResolvedCatalogSource)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ResolvedImageSource) DeepCopyInto(out *ResolvedImageSource) {
- *out = *in
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResolvedImageSource.
-func (in *ResolvedImageSource) DeepCopy() *ResolvedImageSource {
- if in == nil {
- return nil
- }
- out := new(ResolvedImageSource)
- in.DeepCopyInto(out)
- return out
-}
diff --git a/api/catalogd/v1/clustercatalog_types.go b/api/v1/clustercatalog_types.go
similarity index 98%
rename from api/catalogd/v1/clustercatalog_types.go
rename to api/v1/clustercatalog_types.go
index 102c389cb..f083c1128 100644
--- a/api/catalogd/v1/clustercatalog_types.go
+++ b/api/v1/clustercatalog_types.go
@@ -30,19 +30,6 @@ type AvailabilityMode string
const (
SourceTypeImage SourceType = "Image"
- TypeProgressing = "Progressing"
- TypeServing = "Serving"
-
- // Serving reasons
- ReasonAvailable = "Available"
- ReasonUnavailable = "Unavailable"
- ReasonUserSpecifiedUnavailable = "UserSpecifiedUnavailable"
-
- // Progressing reasons
- ReasonSucceeded = "Succeeded"
- ReasonRetrying = "Retrying"
- ReasonBlocked = "Blocked"
-
MetadataNameLabel = "olm.operatorframework.io/metadata.name"
AvailabilityModeAvailable AvailabilityMode = "Available"
diff --git a/api/catalogd/v1/clustercatalog_types_test.go b/api/v1/clustercatalog_types_test.go
similarity index 99%
rename from api/catalogd/v1/clustercatalog_types_test.go
rename to api/v1/clustercatalog_types_test.go
index 0ddd2f5e3..4f86fd0fe 100644
--- a/api/catalogd/v1/clustercatalog_types_test.go
+++ b/api/v1/clustercatalog_types_test.go
@@ -20,7 +20,7 @@ import (
"sigs.k8s.io/yaml"
)
-const crdFilePath = "../../../config/base/catalogd/crd/bases/olm.operatorframework.io_clustercatalogs.yaml"
+const crdFilePath = "../../config/base/catalogd/crd/bases/olm.operatorframework.io_clustercatalogs.yaml"
func TestImageSourceCELValidationRules(t *testing.T) {
validators := fieldValidatorsFromFile(t, crdFilePath)
diff --git a/api/operator-controller/v1/clusterextension_types.go b/api/v1/clusterextension_types.go
similarity index 98%
rename from api/operator-controller/v1/clusterextension_types.go
rename to api/v1/clusterextension_types.go
index 696966c5a..0141f1a7a 100644
--- a/api/operator-controller/v1/clusterextension_types.go
+++ b/api/v1/clusterextension_types.go
@@ -119,7 +119,7 @@ type SourceConfig struct {
// This field is required when sourceType is "Catalog", and forbidden otherwise.
//
// +optional
- Catalog *CatalogSource `json:"catalog,omitempty"`
+ Catalog *CatalogFilter `json:"catalog,omitempty"`
}
// ClusterExtensionInstallConfig is a union which selects the clusterExtension installation config.
@@ -138,8 +138,8 @@ type ClusterExtensionInstallConfig struct {
Preflight *PreflightConfig `json:"preflight,omitempty"`
}
-// CatalogSource defines the attributes used to identify and filter content from a catalog.
-type CatalogSource struct {
+// CatalogFilter defines the attributes used to identify and filter content from a catalog.
+type CatalogFilter struct {
// packageName is a reference to the name of the package to be installed
// and is used to filter the content from catalogs.
//
@@ -391,9 +391,6 @@ type CRDUpgradeSafetyPreflightConfig struct {
}
const (
- TypeInstalled = "Installed"
- TypeProgressing = "Progressing"
-
// TypeDeprecated is a rollup condition that is present when
// any of the deprecated conditions are present.
TypeDeprecated = "Deprecated"
@@ -401,12 +398,6 @@ const (
TypeChannelDeprecated = "ChannelDeprecated"
TypeBundleDeprecated = "BundleDeprecated"
- ReasonSucceeded = "Succeeded"
- ReasonDeprecated = "Deprecated"
- ReasonFailed = "Failed"
- ReasonBlocked = "Blocked"
- ReasonRetrying = "Retrying"
-
// None will not perform CRD upgrade safety checks.
CRDUpgradeSafetyEnforcementNone CRDUpgradeSafetyEnforcement = "None"
// Strict will enforce the CRD upgrade safety check and block the upgrade if the CRD would not pass the check.
diff --git a/api/operator-controller/v1/clusterextension_types_test.go b/api/v1/clusterextension_types_test.go
similarity index 100%
rename from api/operator-controller/v1/clusterextension_types_test.go
rename to api/v1/clusterextension_types_test.go
diff --git a/api/catalogd/doc.go b/api/v1/common_types.go
similarity index 51%
rename from api/catalogd/doc.go
rename to api/v1/common_types.go
index d437f7b7e..6008d7557 100644
--- a/api/catalogd/doc.go
+++ b/api/v1/common_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022.
+Copyright 2024.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,9 +14,24 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-//go:generate apiregister-gen --input-dirs ./... -h ../../hack/boilerplate.go.txt
+package v1
-//
-// +domain=operatorframework.io
+const (
+ TypeInstalled = "Installed"
+ TypeProgressing = "Progressing"
+ TypeServing = "Serving"
-package api
+ // Progressing reasons
+ ReasonSucceeded = "Succeeded"
+ ReasonRetrying = "Retrying"
+ ReasonBlocked = "Blocked"
+
+ // Terminal reasons
+ ReasonDeprecated = "Deprecated"
+ ReasonFailed = "Failed"
+
+ // Serving reasons
+ ReasonAvailable = "Available"
+ ReasonUnavailable = "Unavailable"
+ ReasonUserSpecifiedUnavailable = "UserSpecifiedUnavailable"
+)
diff --git a/api/operator-controller/v1/groupversion_info.go b/api/v1/groupversion_info.go
similarity index 100%
rename from api/operator-controller/v1/groupversion_info.go
rename to api/v1/groupversion_info.go
diff --git a/api/operator-controller/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go
similarity index 58%
rename from api/operator-controller/v1/zz_generated.deepcopy.go
rename to api/v1/zz_generated.deepcopy.go
index 622bd2b83..37694f61f 100644
--- a/api/operator-controller/v1/zz_generated.deepcopy.go
+++ b/api/v1/zz_generated.deepcopy.go
@@ -56,7 +56,7 @@ func (in *CRDUpgradeSafetyPreflightConfig) DeepCopy() *CRDUpgradeSafetyPreflight
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *CatalogSource) DeepCopyInto(out *CatalogSource) {
+func (in *CatalogFilter) DeepCopyInto(out *CatalogFilter) {
*out = *in
if in.Channels != nil {
in, out := &in.Channels, &out.Channels
@@ -70,6 +70,26 @@ func (in *CatalogSource) DeepCopyInto(out *CatalogSource) {
}
}
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogFilter.
+func (in *CatalogFilter) DeepCopy() *CatalogFilter {
+ if in == nil {
+ return nil
+ }
+ out := new(CatalogFilter)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *CatalogSource) DeepCopyInto(out *CatalogSource) {
+ *out = *in
+ if in.Image != nil {
+ in, out := &in.Image, &out.Image
+ *out = new(ImageSource)
+ (*in).DeepCopyInto(*out)
+ }
+}
+
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogSource.
func (in *CatalogSource) DeepCopy() *CatalogSource {
if in == nil {
@@ -80,6 +100,132 @@ func (in *CatalogSource) DeepCopy() *CatalogSource {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ClusterCatalog) DeepCopyInto(out *ClusterCatalog) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ in.Spec.DeepCopyInto(&out.Spec)
+ in.Status.DeepCopyInto(&out.Status)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCatalog.
+func (in *ClusterCatalog) DeepCopy() *ClusterCatalog {
+ if in == nil {
+ return nil
+ }
+ out := new(ClusterCatalog)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *ClusterCatalog) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ClusterCatalogList) DeepCopyInto(out *ClusterCatalogList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]ClusterCatalog, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCatalogList.
+func (in *ClusterCatalogList) DeepCopy() *ClusterCatalogList {
+ if in == nil {
+ return nil
+ }
+ out := new(ClusterCatalogList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *ClusterCatalogList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ClusterCatalogSpec) DeepCopyInto(out *ClusterCatalogSpec) {
+ *out = *in
+ in.Source.DeepCopyInto(&out.Source)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCatalogSpec.
+func (in *ClusterCatalogSpec) DeepCopy() *ClusterCatalogSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(ClusterCatalogSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ClusterCatalogStatus) DeepCopyInto(out *ClusterCatalogStatus) {
+ *out = *in
+ if in.Conditions != nil {
+ in, out := &in.Conditions, &out.Conditions
+ *out = make([]metav1.Condition, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ if in.ResolvedSource != nil {
+ in, out := &in.ResolvedSource, &out.ResolvedSource
+ *out = new(ResolvedCatalogSource)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.URLs != nil {
+ in, out := &in.URLs, &out.URLs
+ *out = new(ClusterCatalogURLs)
+ **out = **in
+ }
+ if in.LastUnpacked != nil {
+ in, out := &in.LastUnpacked, &out.LastUnpacked
+ *out = (*in).DeepCopy()
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCatalogStatus.
+func (in *ClusterCatalogStatus) DeepCopy() *ClusterCatalogStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(ClusterCatalogStatus)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ClusterCatalogURLs) DeepCopyInto(out *ClusterCatalogURLs) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCatalogURLs.
+func (in *ClusterCatalogURLs) DeepCopy() *ClusterCatalogURLs {
+ if in == nil {
+ return nil
+ }
+ out := new(ClusterCatalogURLs)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterExtension) DeepCopyInto(out *ClusterExtension) {
*out = *in
@@ -224,6 +370,26 @@ func (in *ClusterExtensionStatus) DeepCopy() *ClusterExtensionStatus {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ImageSource) DeepCopyInto(out *ImageSource) {
+ *out = *in
+ if in.PollIntervalMinutes != nil {
+ in, out := &in.PollIntervalMinutes, &out.PollIntervalMinutes
+ *out = new(int)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageSource.
+func (in *ImageSource) DeepCopy() *ImageSource {
+ if in == nil {
+ return nil
+ }
+ out := new(ImageSource)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PreflightConfig) DeepCopyInto(out *PreflightConfig) {
*out = *in
@@ -244,6 +410,41 @@ func (in *PreflightConfig) DeepCopy() *PreflightConfig {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ResolvedCatalogSource) DeepCopyInto(out *ResolvedCatalogSource) {
+ *out = *in
+ if in.Image != nil {
+ in, out := &in.Image, &out.Image
+ *out = new(ResolvedImageSource)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResolvedCatalogSource.
+func (in *ResolvedCatalogSource) DeepCopy() *ResolvedCatalogSource {
+ if in == nil {
+ return nil
+ }
+ out := new(ResolvedCatalogSource)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ResolvedImageSource) DeepCopyInto(out *ResolvedImageSource) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResolvedImageSource.
+func (in *ResolvedImageSource) DeepCopy() *ResolvedImageSource {
+ if in == nil {
+ return nil
+ }
+ out := new(ResolvedImageSource)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ServiceAccountReference) DeepCopyInto(out *ServiceAccountReference) {
*out = *in
@@ -264,7 +465,7 @@ func (in *SourceConfig) DeepCopyInto(out *SourceConfig) {
*out = *in
if in.Catalog != nil {
in, out := &in.Catalog, &out.Catalog
- *out = new(CatalogSource)
+ *out = new(CatalogFilter)
(*in).DeepCopyInto(*out)
}
}
diff --git a/catalogd/cmd/catalogd/main.go b/catalogd/cmd/catalogd/main.go
index 60b9b21a5..aff3efeb3 100644
--- a/catalogd/cmd/catalogd/main.go
+++ b/catalogd/cmd/catalogd/main.go
@@ -55,7 +55,7 @@ import (
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
crwebhook "sigs.k8s.io/controller-runtime/pkg/webhook"
- catalogdv1 "github.com/operator-framework/operator-controller/api/catalogd/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
corecontrollers "github.com/operator-framework/operator-controller/internal/catalogd/controllers/core"
"github.com/operator-framework/operator-controller/internal/catalogd/features"
"github.com/operator-framework/operator-controller/internal/catalogd/garbagecollection"
@@ -145,7 +145,7 @@ func init() {
features.CatalogdFeatureGate.AddFlag(flags)
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
- utilruntime.Must(catalogdv1.AddToScheme(scheme))
+ utilruntime.Must(ocv1.AddToScheme(scheme))
ctrl.SetLogger(textlogger.NewLogger(textlogger.NewConfig()))
}
diff --git a/cmd/operator-controller/main.go b/cmd/operator-controller/main.go
index 38cd375c1..ee6450a05 100644
--- a/cmd/operator-controller/main.go
+++ b/cmd/operator-controller/main.go
@@ -54,8 +54,7 @@ import (
helmclient "github.com/operator-framework/helm-operator-plugins/pkg/client"
- catalogd "github.com/operator-framework/operator-controller/api/catalogd/v1"
- ocv1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/operator-controller/action"
"github.com/operator-framework/operator-controller/internal/operator-controller/applier"
"github.com/operator-framework/operator-controller/internal/operator-controller/authentication"
@@ -202,8 +201,8 @@ func run() error {
setupLog.Info("set up manager")
cacheOptions := crcache.Options{
ByObject: map[client.Object]crcache.ByObject{
- &ocv1.ClusterExtension{}: {Label: k8slabels.Everything()},
- &catalogd.ClusterCatalog{}: {Label: k8slabels.Everything()},
+ &ocv1.ClusterExtension{}: {Label: k8slabels.Everything()},
+ &ocv1.ClusterCatalog{}: {Label: k8slabels.Everything()},
},
DefaultNamespaces: map[string]crcache.Config{
cfg.systemNamespace: {LabelSelector: k8slabels.Everything()},
@@ -383,8 +382,8 @@ func run() error {
resolver := &resolve.CatalogResolver{
WalkCatalogsFunc: resolve.CatalogWalker(
- func(ctx context.Context, option ...client.ListOption) ([]catalogd.ClusterCatalog, error) {
- var catalogs catalogd.ClusterCatalogList
+ func(ctx context.Context, option ...client.ListOption) ([]ocv1.ClusterCatalog, error) {
+ var catalogs ocv1.ClusterCatalogList
if err := cl.List(ctx, &catalogs, option...); err != nil {
return nil, err
}
diff --git a/docs/api-reference/catalogd-api-reference.md b/docs/api-reference/catalogd-api-reference.md
deleted file mode 100644
index b313d2646..000000000
--- a/docs/api-reference/catalogd-api-reference.md
+++ /dev/null
@@ -1,219 +0,0 @@
-# API Reference
-
-## Packages
-- [olm.operatorframework.io/v1](#olmoperatorframeworkiov1)
-
-
-## olm.operatorframework.io/v1
-
-Package v1 contains API Schema definitions for the core v1 API group
-
-### Resource Types
-- [ClusterCatalog](#clustercatalog)
-- [ClusterCatalogList](#clustercataloglist)
-
-
-
-#### AvailabilityMode
-
-_Underlying type:_ _string_
-
-AvailabilityMode defines the availability of the catalog
-
-
-
-_Appears in:_
-- [ClusterCatalogSpec](#clustercatalogspec)
-
-| Field | Description |
-| --- | --- |
-| `Available` | |
-| `Unavailable` | |
-
-
-#### CatalogSource
-
-
-
-CatalogSource is a discriminated union of possible sources for a Catalog.
-CatalogSource contains the sourcing information for a Catalog
-
-
-
-_Appears in:_
-- [ClusterCatalogSpec](#clustercatalogspec)
-
-| Field | Description | Default | Validation |
-| --- | --- | --- | --- |
-| `type` _[SourceType](#sourcetype)_ | type is a reference to the type of source the catalog is sourced from.
type is required.
The only allowed value is "Image".
When set to "Image", the ClusterCatalog content will be sourced from an OCI image.
When using an image source, the image field must be set and must be the only field defined for this type. | | Enum: [Image]
Required: \{\}
|
-| `image` _[ImageSource](#imagesource)_ | image is used to configure how catalog contents are sourced from an OCI image.
This field is required when type is Image, and forbidden otherwise. | | |
-
-
-#### ClusterCatalog
-
-
-
-ClusterCatalog enables users to make File-Based Catalog (FBC) catalog data available to the cluster.
-For more information on FBC, see https://olm.operatorframework.io/docs/reference/file-based-catalogs/#docs
-
-
-
-_Appears in:_
-- [ClusterCatalogList](#clustercataloglist)
-
-| Field | Description | Default | Validation |
-| --- | --- | --- | --- |
-| `apiVersion` _string_ | `olm.operatorframework.io/v1` | | |
-| `kind` _string_ | `ClusterCatalog` | | |
-| `kind` _string_ | Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | | |
-| `apiVersion` _string_ | APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | | |
-| `metadata` _[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#objectmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | |
-| `spec` _[ClusterCatalogSpec](#clustercatalogspec)_ | spec is the desired state of the ClusterCatalog.
spec is required.
The controller will work to ensure that the desired
catalog is unpacked and served over the catalog content HTTP server. | | Required: \{\}
|
-| `status` _[ClusterCatalogStatus](#clustercatalogstatus)_ | status contains information about the state of the ClusterCatalog such as:
- Whether or not the catalog contents are being served via the catalog content HTTP server
- Whether or not the ClusterCatalog is progressing to a new state
- A reference to the source from which the catalog contents were retrieved | | |
-
-
-#### ClusterCatalogList
-
-
-
-ClusterCatalogList contains a list of ClusterCatalog
-
-
-
-
-
-| Field | Description | Default | Validation |
-| --- | --- | --- | --- |
-| `apiVersion` _string_ | `olm.operatorframework.io/v1` | | |
-| `kind` _string_ | `ClusterCatalogList` | | |
-| `kind` _string_ | Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | | |
-| `apiVersion` _string_ | APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | | |
-| `metadata` _[ListMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#listmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | |
-| `items` _[ClusterCatalog](#clustercatalog) array_ | items is a list of ClusterCatalogs.
items is required. | | Required: \{\}
|
-
-
-#### ClusterCatalogSpec
-
-
-
-ClusterCatalogSpec defines the desired state of ClusterCatalog
-
-
-
-_Appears in:_
-- [ClusterCatalog](#clustercatalog)
-
-| Field | Description | Default | Validation |
-| --- | --- | --- | --- |
-| `source` _[CatalogSource](#catalogsource)_ | source allows a user to define the source of a catalog.
A "catalog" contains information on content that can be installed on a cluster.
Providing a catalog source makes the contents of the catalog discoverable and usable by
other on-cluster components.
These on-cluster components may do a variety of things with this information, such as
presenting the content in a GUI dashboard or installing content from the catalog on the cluster.
The catalog source must contain catalog metadata in the File-Based Catalog (FBC) format.
For more information on FBC, see https://olm.operatorframework.io/docs/reference/file-based-catalogs/#docs.
source is a required field.
Below is a minimal example of a ClusterCatalogSpec that sources a catalog from an image:
source:
type: Image
image:
ref: quay.io/operatorhubio/catalog:latest | | Required: \{\}
|
-| `priority` _integer_ | priority allows the user to define a priority for a ClusterCatalog.
priority is optional.
A ClusterCatalog's priority is used by clients as a tie-breaker between ClusterCatalogs that meet the client's requirements.
A higher number means higher priority.
It is up to clients to decide how to handle scenarios where multiple ClusterCatalogs with the same priority meet their requirements.
When deciding how to break the tie in this scenario, it is recommended that clients prompt their users for additional input.
When omitted, the default priority is 0 because that is the zero value of integers.
Negative numbers can be used to specify a priority lower than the default.
Positive numbers can be used to specify a priority higher than the default.
The lowest possible value is -2147483648.
The highest possible value is 2147483647. | 0 | |
-| `availabilityMode` _[AvailabilityMode](#availabilitymode)_ | availabilityMode allows users to define how the ClusterCatalog is made available to clients on the cluster.
availabilityMode is optional.
Allowed values are "Available" and "Unavailable" and omitted.
When omitted, the default value is "Available".
When set to "Available", the catalog contents will be unpacked and served over the catalog content HTTP server.
Setting the availabilityMode to "Available" tells clients that they should consider this ClusterCatalog
and its contents as usable.
When set to "Unavailable", the catalog contents will no longer be served over the catalog content HTTP server.
When set to this availabilityMode it should be interpreted the same as the ClusterCatalog not existing.
Setting the availabilityMode to "Unavailable" can be useful in scenarios where a user may not want
to delete the ClusterCatalog all together, but would still like it to be treated as if it doesn't exist. | Available | Enum: [Unavailable Available]
|
-
-
-#### ClusterCatalogStatus
-
-
-
-ClusterCatalogStatus defines the observed state of ClusterCatalog
-
-
-
-_Appears in:_
-- [ClusterCatalog](#clustercatalog)
-
-| Field | Description | Default | Validation |
-| --- | --- | --- | --- |
-| `conditions` _[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#condition-v1-meta) array_ | conditions is a representation of the current state for this ClusterCatalog.
The current condition types are Serving and Progressing.
The Serving condition is used to represent whether or not the contents of the catalog is being served via the HTTP(S) web server.
When it has a status of True and a reason of Available, the contents of the catalog are being served.
When it has a status of False and a reason of Unavailable, the contents of the catalog are not being served because the contents are not yet available.
When it has a status of False and a reason of UserSpecifiedUnavailable, the contents of the catalog are not being served because the catalog has been intentionally marked as unavailable.
The Progressing condition is used to represent whether or not the ClusterCatalog is progressing or is ready to progress towards a new state.
When it has a status of True and a reason of Retrying, there was an error in the progression of the ClusterCatalog that may be resolved on subsequent reconciliation attempts.
When it has a status of True and a reason of Succeeded, the ClusterCatalog has successfully progressed to a new state and is ready to continue progressing.
When it has a status of False and a reason of Blocked, there was an error in the progression of the ClusterCatalog that requires manual intervention for recovery.
In the case that the Serving condition is True with reason Available and Progressing is True with reason Retrying, the previously fetched
catalog contents are still being served via the HTTP(S) web server while we are progressing towards serving a new version of the catalog
contents. This could occur when we've initially fetched the latest contents from the source for this catalog and when polling for changes
to the contents we identify that there are updates to the contents. | | |
-| `resolvedSource` _[ResolvedCatalogSource](#resolvedcatalogsource)_ | resolvedSource contains information about the resolved source based on the source type. | | |
-| `urls` _[ClusterCatalogURLs](#clustercatalogurls)_ | urls contains the URLs that can be used to access the catalog. | | |
-| `lastUnpacked` _[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#time-v1-meta)_ | lastUnpacked represents the last time the contents of the
catalog were extracted from their source format. As an example,
when using an Image source, the OCI image will be pulled and the
image layers written to a file-system backed cache. We refer to the
act of this extraction from the source format as "unpacking". | | |
-
-
-#### ClusterCatalogURLs
-
-
-
-ClusterCatalogURLs contains the URLs that can be used to access the catalog.
-
-
-
-_Appears in:_
-- [ClusterCatalogStatus](#clustercatalogstatus)
-
-| Field | Description | Default | Validation |
-| --- | --- | --- | --- |
-| `base` _string_ | base is a cluster-internal URL that provides endpoints for
accessing the content of the catalog.
It is expected that clients append the path for the endpoint they wish
to access.
Currently, only a single endpoint is served and is accessible at the path
/api/v1.
The endpoints served for the v1 API are:
- /all - this endpoint returns the entirety of the catalog contents in the FBC format
As the needs of users and clients of the evolve, new endpoints may be added. | | MaxLength: 525
Required: \{\}
|
-
-
-#### ImageSource
-
-
-
-ImageSource enables users to define the information required for sourcing a Catalog from an OCI image
-
-
-If we see that there is a possibly valid digest-based image reference AND pollIntervalMinutes is specified,
-reject the resource since there is no use in polling a digest-based image reference.
-
-
-
-_Appears in:_
-- [CatalogSource](#catalogsource)
-
-| Field | Description | Default | Validation |
-| --- | --- | --- | --- |
-| `ref` _string_ | ref allows users to define the reference to a container image containing Catalog contents.
ref is required.
ref can not be more than 1000 characters.
A reference can be broken down into 3 parts - the domain, name, and identifier.
The domain is typically the registry where an image is located.
It must be alphanumeric characters (lowercase and uppercase) separated by the "." character.
Hyphenation is allowed, but the domain must start and end with alphanumeric characters.
Specifying a port to use is also allowed by adding the ":" character followed by numeric values.
The port must be the last value in the domain.
Some examples of valid domain values are "registry.mydomain.io", "quay.io", "my-registry.io:8080".
The name is typically the repository in the registry where an image is located.
It must contain lowercase alphanumeric characters separated only by the ".", "_", "__", "-" characters.
Multiple names can be concatenated with the "/" character.
The domain and name are combined using the "/" character.
Some examples of valid name values are "operatorhubio/catalog", "catalog", "my-catalog.prod".
An example of the domain and name parts of a reference being combined is "quay.io/operatorhubio/catalog".
The identifier is typically the tag or digest for an image reference and is present at the end of the reference.
It starts with a separator character used to distinguish the end of the name and beginning of the identifier.
For a digest-based reference, the "@" character is the separator.
For a tag-based reference, the ":" character is the separator.
An identifier is required in the reference.
Digest-based references must contain an algorithm reference immediately after the "@" separator.
The algorithm reference must be followed by the ":" character and an encoded string.
The algorithm must start with an uppercase or lowercase alpha character followed by alphanumeric characters and may contain the "-", "_", "+", and "." characters.
Some examples of valid algorithm values are "sha256", "sha256+b64u", "multihash+base58".
The encoded string following the algorithm must be hex digits (a-f, A-F, 0-9) and must be a minimum of 32 characters.
Tag-based references must begin with a word character (alphanumeric + "_") followed by word characters or ".", and "-" characters.
The tag must not be longer than 127 characters.
An example of a valid digest-based image reference is "quay.io/operatorhubio/catalog@sha256:200d4ddb2a73594b91358fe6397424e975205bfbe44614f5846033cad64b3f05"
An example of a valid tag-based image reference is "quay.io/operatorhubio/catalog:latest" | | MaxLength: 1000
Required: \{\}
|
-| `pollIntervalMinutes` _integer_ | pollIntervalMinutes allows the user to set the interval, in minutes, at which the image source should be polled for new content.
pollIntervalMinutes is optional.
pollIntervalMinutes can not be specified when ref is a digest-based reference.
When omitted, the image will not be polled for new content. | | Minimum: 1
|
-
-
-#### ResolvedCatalogSource
-
-
-
-ResolvedCatalogSource is a discriminated union of resolution information for a Catalog.
-ResolvedCatalogSource contains the information about a sourced Catalog
-
-
-
-_Appears in:_
-- [ClusterCatalogStatus](#clustercatalogstatus)
-
-| Field | Description | Default | Validation |
-| --- | --- | --- | --- |
-| `type` _[SourceType](#sourcetype)_ | type is a reference to the type of source the catalog is sourced from.
type is required.
The only allowed value is "Image".
When set to "Image", information about the resolved image source will be set in the 'image' field. | | Enum: [Image]
Required: \{\}
|
-| `image` _[ResolvedImageSource](#resolvedimagesource)_ | image is a field containing resolution information for a catalog sourced from an image.
This field must be set when type is Image, and forbidden otherwise. | | |
-
-
-#### ResolvedImageSource
-
-
-
-ResolvedImageSource provides information about the resolved source of a Catalog sourced from an image.
-
-
-
-_Appears in:_
-- [ResolvedCatalogSource](#resolvedcatalogsource)
-
-| Field | Description | Default | Validation |
-| --- | --- | --- | --- |
-| `ref` _string_ | ref contains the resolved image digest-based reference.
The digest format is used so users can use other tooling to fetch the exact
OCI manifests that were used to extract the catalog contents. | | MaxLength: 1000
Required: \{\}
|
-
-
-#### SourceType
-
-_Underlying type:_ _string_
-
-SourceType defines the type of source used for catalogs.
-
-
-
-_Appears in:_
-- [CatalogSource](#catalogsource)
-- [ResolvedCatalogSource](#resolvedcatalogsource)
-
-| Field | Description |
-| --- | --- |
-| `Image` | |
-
-
diff --git a/docs/api-reference/operator-controller-api-reference.md b/docs/api-reference/operator-controller-api-reference.md
index c3a3862b1..84fdbfa64 100644
--- a/docs/api-reference/operator-controller-api-reference.md
+++ b/docs/api-reference/operator-controller-api-reference.md
@@ -9,11 +9,30 @@
Package v1 contains API Schema definitions for the olm v1 API group
### Resource Types
+- [ClusterCatalog](#clustercatalog)
+- [ClusterCatalogList](#clustercataloglist)
- [ClusterExtension](#clusterextension)
- [ClusterExtensionList](#clusterextensionlist)
+#### AvailabilityMode
+
+_Underlying type:_ _string_
+
+AvailabilityMode defines the availability of the catalog
+
+
+
+_Appears in:_
+- [ClusterCatalogSpec](#clustercatalogspec)
+
+| Field | Description |
+| --- | --- |
+| `Available` | |
+| `Unavailable` | |
+
+
#### BundleMetadata
@@ -64,11 +83,11 @@ _Appears in:_
| `enforcement` _[CRDUpgradeSafetyEnforcement](#crdupgradesafetyenforcement)_ | enforcement is a required field, used to configure the state of the CRD Upgrade Safety pre-flight check.
Allowed values are "None" or "Strict". The default value is "Strict".
When set to "None", the CRD Upgrade Safety pre-flight check will be skipped
when performing an upgrade operation. This should be used with caution as
unintended consequences such as data loss can occur.
When set to "Strict", the CRD Upgrade Safety pre-flight check will be run when
performing an upgrade operation. | | Enum: [None Strict]
Required: \{\}
|
-#### CatalogSource
+#### CatalogFilter
-CatalogSource defines the attributes used to identify and filter content from a catalog.
+CatalogFilter defines the attributes used to identify and filter content from a catalog.
@@ -84,6 +103,120 @@ _Appears in:_
| `upgradeConstraintPolicy` _[UpgradeConstraintPolicy](#upgradeconstraintpolicy)_ | upgradeConstraintPolicy is an optional field that controls whether
the upgrade path(s) defined in the catalog are enforced for the package
referenced in the packageName field.
Allowed values are: "CatalogProvided" or "SelfCertified", or omitted.
When this field is set to "CatalogProvided", automatic upgrades will only occur
when upgrade constraints specified by the package author are met.
When this field is set to "SelfCertified", the upgrade constraints specified by
the package author are ignored. This allows for upgrades and downgrades to
any version of the package. This is considered a dangerous operation as it
can lead to unknown and potentially disastrous outcomes, such as data
loss. It is assumed that users have independently verified changes when
using this option.
When this field is omitted, the default value is "CatalogProvided". | CatalogProvided | Enum: [CatalogProvided SelfCertified]
|
+#### CatalogSource
+
+
+
+CatalogSource is a discriminated union of possible sources for a Catalog.
+CatalogSource contains the sourcing information for a Catalog
+
+
+
+_Appears in:_
+- [ClusterCatalogSpec](#clustercatalogspec)
+
+| Field | Description | Default | Validation |
+| --- | --- | --- | --- |
+| `type` _[SourceType](#sourcetype)_ | type is a reference to the type of source the catalog is sourced from.
type is required.
The only allowed value is "Image".
When set to "Image", the ClusterCatalog content will be sourced from an OCI image.
When using an image source, the image field must be set and must be the only field defined for this type. | | Enum: [Image]
Required: \{\}
|
+| `image` _[ImageSource](#imagesource)_ | image is used to configure how catalog contents are sourced from an OCI image.
This field is required when type is Image, and forbidden otherwise. | | |
+
+
+#### ClusterCatalog
+
+
+
+ClusterCatalog enables users to make File-Based Catalog (FBC) catalog data available to the cluster.
+For more information on FBC, see https://olm.operatorframework.io/docs/reference/file-based-catalogs/#docs
+
+
+
+_Appears in:_
+- [ClusterCatalogList](#clustercataloglist)
+
+| Field | Description | Default | Validation |
+| --- | --- | --- | --- |
+| `apiVersion` _string_ | `olm.operatorframework.io/v1` | | |
+| `kind` _string_ | `ClusterCatalog` | | |
+| `kind` _string_ | Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | | |
+| `apiVersion` _string_ | APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | | |
+| `metadata` _[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#objectmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | |
+| `spec` _[ClusterCatalogSpec](#clustercatalogspec)_ | spec is the desired state of the ClusterCatalog.
spec is required.
The controller will work to ensure that the desired
catalog is unpacked and served over the catalog content HTTP server. | | Required: \{\}
|
+| `status` _[ClusterCatalogStatus](#clustercatalogstatus)_ | status contains information about the state of the ClusterCatalog such as:
- Whether or not the catalog contents are being served via the catalog content HTTP server
- Whether or not the ClusterCatalog is progressing to a new state
- A reference to the source from which the catalog contents were retrieved | | |
+
+
+#### ClusterCatalogList
+
+
+
+ClusterCatalogList contains a list of ClusterCatalog
+
+
+
+
+
+| Field | Description | Default | Validation |
+| --- | --- | --- | --- |
+| `apiVersion` _string_ | `olm.operatorframework.io/v1` | | |
+| `kind` _string_ | `ClusterCatalogList` | | |
+| `kind` _string_ | Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | | |
+| `apiVersion` _string_ | APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | | |
+| `metadata` _[ListMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#listmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | |
+| `items` _[ClusterCatalog](#clustercatalog) array_ | items is a list of ClusterCatalogs.
items is required. | | Required: \{\}
|
+
+
+#### ClusterCatalogSpec
+
+
+
+ClusterCatalogSpec defines the desired state of ClusterCatalog
+
+
+
+_Appears in:_
+- [ClusterCatalog](#clustercatalog)
+
+| Field | Description | Default | Validation |
+| --- | --- | --- | --- |
+| `source` _[CatalogSource](#catalogsource)_ | source allows a user to define the source of a catalog.
A "catalog" contains information on content that can be installed on a cluster.
Providing a catalog source makes the contents of the catalog discoverable and usable by
other on-cluster components.
These on-cluster components may do a variety of things with this information, such as
presenting the content in a GUI dashboard or installing content from the catalog on the cluster.
The catalog source must contain catalog metadata in the File-Based Catalog (FBC) format.
For more information on FBC, see https://olm.operatorframework.io/docs/reference/file-based-catalogs/#docs.
source is a required field.
Below is a minimal example of a ClusterCatalogSpec that sources a catalog from an image:
source:
type: Image
image:
ref: quay.io/operatorhubio/catalog:latest | | Required: \{\}
|
+| `priority` _integer_ | priority allows the user to define a priority for a ClusterCatalog.
priority is optional.
A ClusterCatalog's priority is used by clients as a tie-breaker between ClusterCatalogs that meet the client's requirements.
A higher number means higher priority.
It is up to clients to decide how to handle scenarios where multiple ClusterCatalogs with the same priority meet their requirements.
When deciding how to break the tie in this scenario, it is recommended that clients prompt their users for additional input.
When omitted, the default priority is 0 because that is the zero value of integers.
Negative numbers can be used to specify a priority lower than the default.
Positive numbers can be used to specify a priority higher than the default.
The lowest possible value is -2147483648.
The highest possible value is 2147483647. | 0 | |
+| `availabilityMode` _[AvailabilityMode](#availabilitymode)_ | availabilityMode allows users to define how the ClusterCatalog is made available to clients on the cluster.
availabilityMode is optional.
Allowed values are "Available" and "Unavailable" and omitted.
When omitted, the default value is "Available".
When set to "Available", the catalog contents will be unpacked and served over the catalog content HTTP server.
Setting the availabilityMode to "Available" tells clients that they should consider this ClusterCatalog
and its contents as usable.
When set to "Unavailable", the catalog contents will no longer be served over the catalog content HTTP server.
When set to this availabilityMode it should be interpreted the same as the ClusterCatalog not existing.
Setting the availabilityMode to "Unavailable" can be useful in scenarios where a user may not want
to delete the ClusterCatalog all together, but would still like it to be treated as if it doesn't exist. | Available | Enum: [Unavailable Available]
|
+
+
+#### ClusterCatalogStatus
+
+
+
+ClusterCatalogStatus defines the observed state of ClusterCatalog
+
+
+
+_Appears in:_
+- [ClusterCatalog](#clustercatalog)
+
+| Field | Description | Default | Validation |
+| --- | --- | --- | --- |
+| `conditions` _[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#condition-v1-meta) array_ | conditions is a representation of the current state for this ClusterCatalog.
The current condition types are Serving and Progressing.
The Serving condition is used to represent whether or not the contents of the catalog is being served via the HTTP(S) web server.
When it has a status of True and a reason of Available, the contents of the catalog are being served.
When it has a status of False and a reason of Unavailable, the contents of the catalog are not being served because the contents are not yet available.
When it has a status of False and a reason of UserSpecifiedUnavailable, the contents of the catalog are not being served because the catalog has been intentionally marked as unavailable.
The Progressing condition is used to represent whether or not the ClusterCatalog is progressing or is ready to progress towards a new state.
When it has a status of True and a reason of Retrying, there was an error in the progression of the ClusterCatalog that may be resolved on subsequent reconciliation attempts.
When it has a status of True and a reason of Succeeded, the ClusterCatalog has successfully progressed to a new state and is ready to continue progressing.
When it has a status of False and a reason of Blocked, there was an error in the progression of the ClusterCatalog that requires manual intervention for recovery.
In the case that the Serving condition is True with reason Available and Progressing is True with reason Retrying, the previously fetched
catalog contents are still being served via the HTTP(S) web server while we are progressing towards serving a new version of the catalog
contents. This could occur when we've initially fetched the latest contents from the source for this catalog and when polling for changes
to the contents we identify that there are updates to the contents. | | |
+| `resolvedSource` _[ResolvedCatalogSource](#resolvedcatalogsource)_ | resolvedSource contains information about the resolved source based on the source type. | | |
+| `urls` _[ClusterCatalogURLs](#clustercatalogurls)_ | urls contains the URLs that can be used to access the catalog. | | |
+| `lastUnpacked` _[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#time-v1-meta)_ | lastUnpacked represents the last time the contents of the
catalog were extracted from their source format. As an example,
when using an Image source, the OCI image will be pulled and the
image layers written to a file-system backed cache. We refer to the
act of this extraction from the source format as "unpacking". | | |
+
+
+#### ClusterCatalogURLs
+
+
+
+ClusterCatalogURLs contains the URLs that can be used to access the catalog.
+
+
+
+_Appears in:_
+- [ClusterCatalogStatus](#clustercatalogstatus)
+
+| Field | Description | Default | Validation |
+| --- | --- | --- | --- |
+| `base` _string_ | base is a cluster-internal URL that provides endpoints for
accessing the content of the catalog.
It is expected that clients append the path for the endpoint they wish
to access.
Currently, only a single endpoint is served and is accessible at the path
/api/v1.
The endpoints served for the v1 API are:
- /all - this endpoint returns the entirety of the catalog contents in the FBC format
As the needs of users and clients of the evolve, new endpoints may be added. | | MaxLength: 525
Required: \{\}
|
+
+
#### ClusterExtension
@@ -195,6 +328,27 @@ _Appears in:_
| `install` _[ClusterExtensionInstallStatus](#clusterextensioninstallstatus)_ | install is a representation of the current installation status for this ClusterExtension. | | |
+#### ImageSource
+
+
+
+ImageSource enables users to define the information required for sourcing a Catalog from an OCI image
+
+
+If we see that there is a possibly valid digest-based image reference AND pollIntervalMinutes is specified,
+reject the resource since there is no use in polling a digest-based image reference.
+
+
+
+_Appears in:_
+- [CatalogSource](#catalogsource)
+
+| Field | Description | Default | Validation |
+| --- | --- | --- | --- |
+| `ref` _string_ | ref allows users to define the reference to a container image containing Catalog contents.
ref is required.
ref can not be more than 1000 characters.
A reference can be broken down into 3 parts - the domain, name, and identifier.
The domain is typically the registry where an image is located.
It must be alphanumeric characters (lowercase and uppercase) separated by the "." character.
Hyphenation is allowed, but the domain must start and end with alphanumeric characters.
Specifying a port to use is also allowed by adding the ":" character followed by numeric values.
The port must be the last value in the domain.
Some examples of valid domain values are "registry.mydomain.io", "quay.io", "my-registry.io:8080".
The name is typically the repository in the registry where an image is located.
It must contain lowercase alphanumeric characters separated only by the ".", "_", "__", "-" characters.
Multiple names can be concatenated with the "/" character.
The domain and name are combined using the "/" character.
Some examples of valid name values are "operatorhubio/catalog", "catalog", "my-catalog.prod".
An example of the domain and name parts of a reference being combined is "quay.io/operatorhubio/catalog".
The identifier is typically the tag or digest for an image reference and is present at the end of the reference.
It starts with a separator character used to distinguish the end of the name and beginning of the identifier.
For a digest-based reference, the "@" character is the separator.
For a tag-based reference, the ":" character is the separator.
An identifier is required in the reference.
Digest-based references must contain an algorithm reference immediately after the "@" separator.
The algorithm reference must be followed by the ":" character and an encoded string.
The algorithm must start with an uppercase or lowercase alpha character followed by alphanumeric characters and may contain the "-", "_", "+", and "." characters.
Some examples of valid algorithm values are "sha256", "sha256+b64u", "multihash+base58".
The encoded string following the algorithm must be hex digits (a-f, A-F, 0-9) and must be a minimum of 32 characters.
Tag-based references must begin with a word character (alphanumeric + "_") followed by word characters or ".", and "-" characters.
The tag must not be longer than 127 characters.
An example of a valid digest-based image reference is "quay.io/operatorhubio/catalog@sha256:200d4ddb2a73594b91358fe6397424e975205bfbe44614f5846033cad64b3f05"
An example of a valid tag-based image reference is "quay.io/operatorhubio/catalog:latest" | | MaxLength: 1000
Required: \{\}
|
+| `pollIntervalMinutes` _integer_ | pollIntervalMinutes allows the user to set the interval, in minutes, at which the image source should be polled for new content.
pollIntervalMinutes is optional.
pollIntervalMinutes can not be specified when ref is a digest-based reference.
When omitted, the image will not be polled for new content. | | Minimum: 1
|
+
+
#### PreflightConfig
@@ -211,6 +365,40 @@ _Appears in:_
| `crdUpgradeSafety` _[CRDUpgradeSafetyPreflightConfig](#crdupgradesafetypreflightconfig)_ | crdUpgradeSafety is used to configure the CRD Upgrade Safety pre-flight
checks that run prior to upgrades of installed content.
The CRD Upgrade Safety pre-flight check safeguards from unintended
consequences of upgrading a CRD, such as data loss. | | |
+#### ResolvedCatalogSource
+
+
+
+ResolvedCatalogSource is a discriminated union of resolution information for a Catalog.
+ResolvedCatalogSource contains the information about a sourced Catalog
+
+
+
+_Appears in:_
+- [ClusterCatalogStatus](#clustercatalogstatus)
+
+| Field | Description | Default | Validation |
+| --- | --- | --- | --- |
+| `type` _[SourceType](#sourcetype)_ | type is a reference to the type of source the catalog is sourced from.
type is required.
The only allowed value is "Image".
When set to "Image", information about the resolved image source will be set in the 'image' field. | | Enum: [Image]
Required: \{\}
|
+| `image` _[ResolvedImageSource](#resolvedimagesource)_ | image is a field containing resolution information for a catalog sourced from an image.
This field must be set when type is Image, and forbidden otherwise. | | |
+
+
+#### ResolvedImageSource
+
+
+
+ResolvedImageSource provides information about the resolved source of a Catalog sourced from an image.
+
+
+
+_Appears in:_
+- [ResolvedCatalogSource](#resolvedcatalogsource)
+
+| Field | Description | Default | Validation |
+| --- | --- | --- | --- |
+| `ref` _string_ | ref contains the resolved image digest-based reference.
The digest format is used so users can use other tooling to fetch the exact
OCI manifests that were used to extract the catalog contents. | | MaxLength: 1000
Required: \{\}
|
+
+
#### ServiceAccountReference
@@ -241,7 +429,24 @@ _Appears in:_
| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `sourceType` _string_ | sourceType is a required reference to the type of install source.
Allowed values are "Catalog"
When this field is set to "Catalog", information for determining the
appropriate bundle of content to install will be fetched from
ClusterCatalog resources existing on the cluster.
When using the Catalog sourceType, the catalog field must also be set. | | Enum: [Catalog]
Required: \{\}
|
-| `catalog` _[CatalogSource](#catalogsource)_ | catalog is used to configure how information is sourced from a catalog.
This field is required when sourceType is "Catalog", and forbidden otherwise. | | |
+| `catalog` _[CatalogFilter](#catalogfilter)_ | catalog is used to configure how information is sourced from a catalog.
This field is required when sourceType is "Catalog", and forbidden otherwise. | | |
+
+
+#### SourceType
+
+_Underlying type:_ _string_
+
+SourceType defines the type of source used for catalogs.
+
+
+
+_Appears in:_
+- [CatalogSource](#catalogsource)
+- [ResolvedCatalogSource](#resolvedcatalogsource)
+
+| Field | Description |
+| --- | --- |
+| `Image` | |
#### UpgradeConstraintPolicy
@@ -253,7 +458,7 @@ _Underlying type:_ _string_
_Appears in:_
-- [CatalogSource](#catalogsource)
+- [CatalogFilter](#catalogfilter)
| Field | Description |
| --- | --- |
diff --git a/internal/catalogd/controllers/core/clustercatalog_controller.go b/internal/catalogd/controllers/core/clustercatalog_controller.go
index d52dd43a3..be9d816fd 100644
--- a/internal/catalogd/controllers/core/clustercatalog_controller.go
+++ b/internal/catalogd/controllers/core/clustercatalog_controller.go
@@ -38,7 +38,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
- catalogdv1 "github.com/operator-framework/operator-controller/api/catalogd/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/catalogd/storage"
imageutil "github.com/operator-framework/operator-controller/internal/shared/util/image"
)
@@ -92,7 +92,7 @@ func (r *ClusterCatalogReconciler) Reconcile(ctx context.Context, req ctrl.Reque
l.Info("reconcile starting")
defer l.Info("reconcile ending")
- existingCatsrc := catalogdv1.ClusterCatalog{}
+ existingCatsrc := ocv1.ClusterCatalog{}
if err := r.Client.Get(ctx, req.NamespacedName, &existingCatsrc); err != nil {
return ctrl.Result{}, client.IgnoreNotFound(err)
}
@@ -151,7 +151,7 @@ func (r *ClusterCatalogReconciler) SetupWithManager(mgr ctrl.Manager) error {
}
return ctrl.NewControllerManagedBy(mgr).
- For(&catalogdv1.ClusterCatalog{}).
+ For(&ocv1.ClusterCatalog{}).
Complete(r)
}
@@ -163,11 +163,11 @@ func (r *ClusterCatalogReconciler) SetupWithManager(mgr ctrl.Manager) error {
// to add the ctrl.Result type back as a return value. Adding a comment to ignore
// linting from the linter that was fussing about this.
// nolint:unparam
-func (r *ClusterCatalogReconciler) reconcile(ctx context.Context, catalog *catalogdv1.ClusterCatalog) (ctrl.Result, error) {
+func (r *ClusterCatalogReconciler) reconcile(ctx context.Context, catalog *ocv1.ClusterCatalog) (ctrl.Result, error) {
l := log.FromContext(ctx)
// Check if the catalog availability is set to disabled, if true then
// unset base URL, delete it from the cache and set appropriate status
- if catalog.Spec.AvailabilityMode == catalogdv1.AvailabilityModeUnavailable {
+ if catalog.Spec.AvailabilityMode == ocv1.AvailabilityModeUnavailable {
// Delete the catalog from local cache
err := r.deleteCatalogCache(ctx, catalog)
if err != nil {
@@ -233,7 +233,7 @@ func (r *ClusterCatalogReconciler) reconcile(ctx context.Context, catalog *catal
return nextPollResult(storedCatalog.lastSuccessfulPoll, catalog), nil
}
- if catalog.Spec.Source.Type != catalogdv1.SourceTypeImage {
+ if catalog.Spec.Source.Type != ocv1.SourceTypeImage {
err := reconcile.TerminalError(fmt.Errorf("unknown source type %q", catalog.Spec.Source.Type))
updateStatusProgressing(&catalog.Status, catalog.GetGeneration(), err)
return ctrl.Result{}, err
@@ -276,7 +276,7 @@ func (r *ClusterCatalogReconciler) reconcile(ctx context.Context, catalog *catal
return nextPollResult(lastSuccessfulPoll, catalog), nil
}
-func (r *ClusterCatalogReconciler) getCurrentState(catalog *catalogdv1.ClusterCatalog) (*catalogdv1.ClusterCatalogStatus, storedCatalogData, bool) {
+func (r *ClusterCatalogReconciler) getCurrentState(catalog *ocv1.ClusterCatalog) (*ocv1.ClusterCatalogStatus, storedCatalogData, bool) {
r.storedCatalogsMu.RLock()
storedCatalog, hasStoredCatalog := r.storedCatalogs[catalog.Name]
r.storedCatalogsMu.RUnlock()
@@ -293,10 +293,10 @@ func (r *ClusterCatalogReconciler) getCurrentState(catalog *catalogdv1.ClusterCa
return expectedStatus, storedCatalog, hasStoredCatalog
}
-func nextPollResult(lastSuccessfulPoll time.Time, catalog *catalogdv1.ClusterCatalog) ctrl.Result {
+func nextPollResult(lastSuccessfulPoll time.Time, catalog *ocv1.ClusterCatalog) ctrl.Result {
var requeueAfter time.Duration
switch catalog.Spec.Source.Type {
- case catalogdv1.SourceTypeImage:
+ case ocv1.SourceTypeImage:
if catalog.Spec.Source.Image != nil && catalog.Spec.Source.Image.PollIntervalMinutes != nil {
pollDuration := time.Duration(*catalog.Spec.Source.Image.PollIntervalMinutes) * time.Minute
jitteredDuration := wait.Jitter(pollDuration, requeueJitterMaxFactor)
@@ -306,68 +306,68 @@ func nextPollResult(lastSuccessfulPoll time.Time, catalog *catalogdv1.ClusterCat
return ctrl.Result{RequeueAfter: requeueAfter}
}
-func clearUnknownConditions(status *catalogdv1.ClusterCatalogStatus) {
+func clearUnknownConditions(status *ocv1.ClusterCatalogStatus) {
knownTypes := sets.New[string](
- catalogdv1.TypeServing,
- catalogdv1.TypeProgressing,
+ ocv1.TypeServing,
+ ocv1.TypeProgressing,
)
status.Conditions = slices.DeleteFunc(status.Conditions, func(cond metav1.Condition) bool {
return !knownTypes.Has(cond.Type)
})
}
-func updateStatusProgressing(status *catalogdv1.ClusterCatalogStatus, generation int64, err error) {
+func updateStatusProgressing(status *ocv1.ClusterCatalogStatus, generation int64, err error) {
progressingCond := metav1.Condition{
- Type: catalogdv1.TypeProgressing,
+ Type: ocv1.TypeProgressing,
Status: metav1.ConditionTrue,
- Reason: catalogdv1.ReasonSucceeded,
+ Reason: ocv1.ReasonSucceeded,
Message: "Successfully unpacked and stored content from resolved source",
ObservedGeneration: generation,
}
if err != nil {
progressingCond.Status = metav1.ConditionTrue
- progressingCond.Reason = catalogdv1.ReasonRetrying
+ progressingCond.Reason = ocv1.ReasonRetrying
progressingCond.Message = err.Error()
}
if errors.Is(err, reconcile.TerminalError(nil)) {
progressingCond.Status = metav1.ConditionFalse
- progressingCond.Reason = catalogdv1.ReasonBlocked
+ progressingCond.Reason = ocv1.ReasonBlocked
}
meta.SetStatusCondition(&status.Conditions, progressingCond)
}
-func updateStatusServing(status *catalogdv1.ClusterCatalogStatus, ref reference.Canonical, modTime time.Time, baseURL string, generation int64) {
- status.ResolvedSource = &catalogdv1.ResolvedCatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ResolvedImageSource{
+func updateStatusServing(status *ocv1.ClusterCatalogStatus, ref reference.Canonical, modTime time.Time, baseURL string, generation int64) {
+ status.ResolvedSource = &ocv1.ResolvedCatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ResolvedImageSource{
Ref: ref.String(),
},
}
- status.URLs = &catalogdv1.ClusterCatalogURLs{
+ status.URLs = &ocv1.ClusterCatalogURLs{
Base: baseURL,
}
status.LastUnpacked = ptr.To(metav1.NewTime(modTime.Truncate(time.Second)))
meta.SetStatusCondition(&status.Conditions, metav1.Condition{
- Type: catalogdv1.TypeServing,
+ Type: ocv1.TypeServing,
Status: metav1.ConditionTrue,
- Reason: catalogdv1.ReasonAvailable,
+ Reason: ocv1.ReasonAvailable,
Message: "Serving desired content from resolved source",
ObservedGeneration: generation,
})
}
-func updateStatusProgressingUserSpecifiedUnavailable(status *catalogdv1.ClusterCatalogStatus, generation int64) {
+func updateStatusProgressingUserSpecifiedUnavailable(status *ocv1.ClusterCatalogStatus, generation int64) {
// Set Progressing condition to True with reason Succeeded
// since we have successfully progressed to the unavailable
// availability mode and are ready to progress to any future
// desired state.
progressingCond := metav1.Condition{
- Type: catalogdv1.TypeProgressing,
+ Type: ocv1.TypeProgressing,
Status: metav1.ConditionTrue,
- Reason: catalogdv1.ReasonSucceeded,
+ Reason: ocv1.ReasonSucceeded,
Message: "Catalog availability mode is set to Unavailable",
ObservedGeneration: generation,
}
@@ -376,9 +376,9 @@ func updateStatusProgressingUserSpecifiedUnavailable(status *catalogdv1.ClusterC
// so that users of this condition are aware that this catalog is
// intentionally not being served
servingCond := metav1.Condition{
- Type: catalogdv1.TypeServing,
+ Type: ocv1.TypeServing,
Status: metav1.ConditionFalse,
- Reason: catalogdv1.ReasonUserSpecifiedUnavailable,
+ Reason: ocv1.ReasonUserSpecifiedUnavailable,
Message: "Catalog availability mode is set to Unavailable",
ObservedGeneration: generation,
}
@@ -387,19 +387,19 @@ func updateStatusProgressingUserSpecifiedUnavailable(status *catalogdv1.ClusterC
meta.SetStatusCondition(&status.Conditions, servingCond)
}
-func updateStatusNotServing(status *catalogdv1.ClusterCatalogStatus, generation int64) {
+func updateStatusNotServing(status *ocv1.ClusterCatalogStatus, generation int64) {
status.ResolvedSource = nil
status.URLs = nil
status.LastUnpacked = nil
meta.SetStatusCondition(&status.Conditions, metav1.Condition{
- Type: catalogdv1.TypeServing,
+ Type: ocv1.TypeServing,
Status: metav1.ConditionFalse,
- Reason: catalogdv1.ReasonUnavailable,
+ Reason: ocv1.ReasonUnavailable,
ObservedGeneration: generation,
})
}
-func (r *ClusterCatalogReconciler) needsPoll(lastSuccessfulPoll time.Time, catalog *catalogdv1.ClusterCatalog) bool {
+func (r *ClusterCatalogReconciler) needsPoll(lastSuccessfulPoll time.Time, catalog *ocv1.ClusterCatalog) bool {
// If polling is disabled, we don't need to poll.
if catalog.Spec.Source.Image.PollIntervalMinutes == nil {
return false
@@ -411,8 +411,8 @@ func (r *ClusterCatalogReconciler) needsPoll(lastSuccessfulPoll time.Time, catal
}
// Compare resources - ignoring status & metadata.finalizers
-func checkForUnexpectedFieldChange(a, b catalogdv1.ClusterCatalog) bool {
- a.Status, b.Status = catalogdv1.ClusterCatalogStatus{}, catalogdv1.ClusterCatalogStatus{}
+func checkForUnexpectedFieldChange(a, b ocv1.ClusterCatalog) bool {
+ a.Status, b.Status = ocv1.ClusterCatalogStatus{}, ocv1.ClusterCatalogStatus{}
a.Finalizers, b.Finalizers = []string{}, []string{}
return !equality.Semantic.DeepEqual(a, b)
}
@@ -426,7 +426,7 @@ func (f finalizerFunc) Finalize(ctx context.Context, obj client.Object) (crfinal
func (r *ClusterCatalogReconciler) setupFinalizers() error {
f := crfinalizer.NewFinalizers()
err := f.Register(fbcDeletionFinalizer, finalizerFunc(func(ctx context.Context, obj client.Object) (crfinalizer.Result, error) {
- catalog, ok := obj.(*catalogdv1.ClusterCatalog)
+ catalog, ok := obj.(*ocv1.ClusterCatalog)
if !ok {
panic("could not convert object to clusterCatalog")
}
@@ -446,7 +446,7 @@ func (r *ClusterCatalogReconciler) deleteStoredCatalog(catalogName string) {
delete(r.storedCatalogs, catalogName)
}
-func (r *ClusterCatalogReconciler) deleteCatalogCache(ctx context.Context, catalog *catalogdv1.ClusterCatalog) error {
+func (r *ClusterCatalogReconciler) deleteCatalogCache(ctx context.Context, catalog *ocv1.ClusterCatalog) error {
if err := r.Storage.Delete(catalog.Name); err != nil {
updateStatusProgressing(&catalog.Status, catalog.GetGeneration(), err)
return err
diff --git a/internal/catalogd/controllers/core/clustercatalog_controller_test.go b/internal/catalogd/controllers/core/clustercatalog_controller_test.go
index e81a0cf87..7150fcbaa 100644
--- a/internal/catalogd/controllers/core/clustercatalog_controller_test.go
+++ b/internal/catalogd/controllers/core/clustercatalog_controller_test.go
@@ -21,7 +21,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
- catalogdv1 "github.com/operator-framework/operator-controller/api/catalogd/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/catalogd/storage"
imageutil "github.com/operator-framework/operator-controller/internal/shared/util/image"
)
@@ -61,9 +61,9 @@ func (m MockStore) ContentExists(_ string) bool {
func TestCatalogdControllerReconcile(t *testing.T) {
for _, tt := range []struct {
name string
- catalog *catalogdv1.ClusterCatalog
+ catalog *ocv1.ClusterCatalog
expectedError error
- expectedCatalog *catalogdv1.ClusterCatalog
+ expectedCatalog *ocv1.ClusterCatalog
puller imageutil.Puller
cache imageutil.Cache
store storage.Instance
@@ -72,34 +72,34 @@ func TestCatalogdControllerReconcile(t *testing.T) {
name: "invalid source type, returns error",
puller: &imageutil.MockPuller{},
store: &MockStore{},
- catalog: &catalogdv1.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog",
Finalizers: []string{fbcDeletionFinalizer},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
Type: "invalid",
},
},
},
expectedError: reconcile.TerminalError(errors.New(`unknown source type "invalid"`)),
- expectedCatalog: &catalogdv1.ClusterCatalog{
+ expectedCatalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog",
Finalizers: []string{fbcDeletionFinalizer},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
Type: "invalid",
},
},
- Status: catalogdv1.ClusterCatalogStatus{
+ Status: ocv1.ClusterCatalogStatus{
Conditions: []metav1.Condition{
{
- Type: catalogdv1.TypeProgressing,
+ Type: ocv1.TypeProgressing,
Status: metav1.ConditionFalse,
- Reason: catalogdv1.ReasonBlocked,
+ Reason: ocv1.ReasonBlocked,
},
},
},
@@ -112,39 +112,39 @@ func TestCatalogdControllerReconcile(t *testing.T) {
Error: errors.New("mockpuller error"),
},
store: &MockStore{},
- catalog: &catalogdv1.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog",
Finalizers: []string{fbcDeletionFinalizer},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
},
},
},
},
- expectedCatalog: &catalogdv1.ClusterCatalog{
+ expectedCatalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog",
Finalizers: []string{fbcDeletionFinalizer},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
},
},
},
- Status: catalogdv1.ClusterCatalogStatus{
+ Status: ocv1.ClusterCatalogStatus{
Conditions: []metav1.Condition{
{
- Type: catalogdv1.TypeProgressing,
+ Type: ocv1.TypeProgressing,
Status: metav1.ConditionTrue,
- Reason: catalogdv1.ReasonRetrying,
+ Reason: ocv1.ReasonRetrying,
},
},
},
@@ -157,39 +157,39 @@ func TestCatalogdControllerReconcile(t *testing.T) {
Error: reconcile.TerminalError(errors.New("mockpuller terminal error")),
},
store: &MockStore{},
- catalog: &catalogdv1.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog",
Finalizers: []string{fbcDeletionFinalizer},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
},
},
},
},
- expectedCatalog: &catalogdv1.ClusterCatalog{
+ expectedCatalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog",
Finalizers: []string{fbcDeletionFinalizer},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
},
},
},
- Status: catalogdv1.ClusterCatalogStatus{
+ Status: ocv1.ClusterCatalogStatus{
Conditions: []metav1.Condition{
{
- Type: catalogdv1.TypeProgressing,
+ Type: ocv1.TypeProgressing,
Status: metav1.ConditionFalse,
- Reason: catalogdv1.ReasonBlocked,
+ Reason: ocv1.ReasonBlocked,
},
},
},
@@ -202,50 +202,50 @@ func TestCatalogdControllerReconcile(t *testing.T) {
Ref: mustRef(t, "my.org/someimage@sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"),
},
store: &MockStore{},
- catalog: &catalogdv1.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog",
Finalizers: []string{fbcDeletionFinalizer},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
},
},
},
},
- expectedCatalog: &catalogdv1.ClusterCatalog{
+ expectedCatalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog",
Finalizers: []string{fbcDeletionFinalizer},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
},
},
},
- Status: catalogdv1.ClusterCatalogStatus{
- URLs: &catalogdv1.ClusterCatalogURLs{Base: "URL"},
+ Status: ocv1.ClusterCatalogStatus{
+ URLs: &ocv1.ClusterCatalogURLs{Base: "URL"},
Conditions: []metav1.Condition{
{
- Type: catalogdv1.TypeServing,
+ Type: ocv1.TypeServing,
Status: metav1.ConditionTrue,
- Reason: catalogdv1.ReasonAvailable,
+ Reason: ocv1.ReasonAvailable,
},
{
- Type: catalogdv1.TypeProgressing,
+ Type: ocv1.TypeProgressing,
Status: metav1.ConditionTrue,
- Reason: catalogdv1.ReasonSucceeded,
+ Reason: ocv1.ReasonSucceeded,
},
},
- ResolvedSource: &catalogdv1.ResolvedCatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ResolvedImageSource{
+ ResolvedSource: &ocv1.ResolvedCatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ResolvedImageSource{
Ref: "my.org/someimage@sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
},
},
@@ -262,39 +262,39 @@ func TestCatalogdControllerReconcile(t *testing.T) {
store: &MockStore{
shouldError: true,
},
- catalog: &catalogdv1.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog",
Finalizers: []string{fbcDeletionFinalizer},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
},
},
},
},
- expectedCatalog: &catalogdv1.ClusterCatalog{
+ expectedCatalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog",
Finalizers: []string{fbcDeletionFinalizer},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
},
},
},
- Status: catalogdv1.ClusterCatalogStatus{
+ Status: ocv1.ClusterCatalogStatus{
Conditions: []metav1.Condition{
{
- Type: catalogdv1.TypeProgressing,
+ Type: ocv1.TypeProgressing,
Status: metav1.ConditionTrue,
- Reason: catalogdv1.ReasonRetrying,
+ Reason: ocv1.ReasonRetrying,
},
},
},
@@ -306,28 +306,28 @@ func TestCatalogdControllerReconcile(t *testing.T) {
ImageFS: &fstest.MapFS{},
},
store: &MockStore{},
- catalog: &catalogdv1.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog",
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
},
},
},
},
- expectedCatalog: &catalogdv1.ClusterCatalog{
+ expectedCatalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog",
Finalizers: []string{fbcDeletionFinalizer},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
},
},
@@ -340,67 +340,67 @@ func TestCatalogdControllerReconcile(t *testing.T) {
ImageFS: &fstest.MapFS{},
},
store: &MockStore{},
- catalog: &catalogdv1.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog",
Finalizers: []string{fbcDeletionFinalizer},
DeletionTimestamp: &metav1.Time{Time: time.Date(2023, time.October, 10, 4, 19, 0, 0, time.UTC)},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
},
},
},
- Status: catalogdv1.ClusterCatalogStatus{
+ Status: ocv1.ClusterCatalogStatus{
LastUnpacked: &metav1.Time{},
- ResolvedSource: &catalogdv1.ResolvedCatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ResolvedImageSource{
+ ResolvedSource: &ocv1.ResolvedCatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ResolvedImageSource{
Ref: "",
},
},
Conditions: []metav1.Condition{
{
- Type: catalogdv1.TypeServing,
+ Type: ocv1.TypeServing,
Status: metav1.ConditionTrue,
- Reason: catalogdv1.ReasonAvailable,
+ Reason: ocv1.ReasonAvailable,
},
{
- Type: catalogdv1.TypeProgressing,
+ Type: ocv1.TypeProgressing,
Status: metav1.ConditionFalse,
- Reason: catalogdv1.ReasonSucceeded,
+ Reason: ocv1.ReasonSucceeded,
},
},
},
},
- expectedCatalog: &catalogdv1.ClusterCatalog{
+ expectedCatalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog",
Finalizers: []string{},
DeletionTimestamp: &metav1.Time{Time: time.Date(2023, time.October, 10, 4, 19, 0, 0, time.UTC)},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
},
},
},
- Status: catalogdv1.ClusterCatalogStatus{
+ Status: ocv1.ClusterCatalogStatus{
Conditions: []metav1.Condition{
{
- Type: catalogdv1.TypeServing,
+ Type: ocv1.TypeServing,
Status: metav1.ConditionFalse,
- Reason: catalogdv1.ReasonUnavailable,
+ Reason: ocv1.ReasonUnavailable,
},
{
- Type: catalogdv1.TypeProgressing,
+ Type: ocv1.TypeProgressing,
Status: metav1.ConditionFalse,
- Reason: catalogdv1.ReasonSucceeded,
+ Reason: ocv1.ReasonSucceeded,
},
},
},
@@ -415,62 +415,62 @@ func TestCatalogdControllerReconcile(t *testing.T) {
store: &MockStore{
shouldError: true,
},
- catalog: &catalogdv1.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog",
Finalizers: []string{fbcDeletionFinalizer},
DeletionTimestamp: &metav1.Time{Time: time.Date(2023, time.October, 10, 4, 19, 0, 0, time.UTC)},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
},
},
},
- Status: catalogdv1.ClusterCatalogStatus{
- URLs: &catalogdv1.ClusterCatalogURLs{Base: "URL"},
+ Status: ocv1.ClusterCatalogStatus{
+ URLs: &ocv1.ClusterCatalogURLs{Base: "URL"},
Conditions: []metav1.Condition{
{
- Type: catalogdv1.TypeProgressing,
+ Type: ocv1.TypeProgressing,
Status: metav1.ConditionFalse,
- Reason: catalogdv1.ReasonSucceeded,
+ Reason: ocv1.ReasonSucceeded,
},
{
- Type: catalogdv1.TypeServing,
+ Type: ocv1.TypeServing,
Status: metav1.ConditionTrue,
- Reason: catalogdv1.ReasonAvailable,
+ Reason: ocv1.ReasonAvailable,
},
},
},
},
- expectedCatalog: &catalogdv1.ClusterCatalog{
+ expectedCatalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog",
Finalizers: []string{fbcDeletionFinalizer},
DeletionTimestamp: &metav1.Time{Time: time.Date(2023, time.October, 10, 4, 19, 0, 0, time.UTC)},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
},
},
},
- Status: catalogdv1.ClusterCatalogStatus{
- URLs: &catalogdv1.ClusterCatalogURLs{Base: "URL"},
+ Status: ocv1.ClusterCatalogStatus{
+ URLs: &ocv1.ClusterCatalogURLs{Base: "URL"},
Conditions: []metav1.Condition{
{
- Type: catalogdv1.TypeProgressing,
+ Type: ocv1.TypeProgressing,
Status: metav1.ConditionTrue,
- Reason: catalogdv1.ReasonRetrying,
+ Reason: ocv1.ReasonRetrying,
},
{
- Type: catalogdv1.TypeServing,
+ Type: ocv1.TypeServing,
Status: metav1.ConditionTrue,
- Reason: catalogdv1.ReasonAvailable,
+ Reason: ocv1.ReasonAvailable,
},
},
},
@@ -484,60 +484,60 @@ func TestCatalogdControllerReconcile(t *testing.T) {
store: &MockStore{
shouldError: false,
},
- catalog: &catalogdv1.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog",
Finalizers: []string{fbcDeletionFinalizer},
DeletionTimestamp: &metav1.Time{Time: time.Date(2023, time.October, 10, 4, 19, 0, 0, time.UTC)},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
},
},
},
- Status: catalogdv1.ClusterCatalogStatus{
+ Status: ocv1.ClusterCatalogStatus{
Conditions: []metav1.Condition{
{
- Type: catalogdv1.TypeProgressing,
+ Type: ocv1.TypeProgressing,
Status: metav1.ConditionFalse,
- Reason: catalogdv1.ReasonSucceeded,
+ Reason: ocv1.ReasonSucceeded,
},
{
- Type: catalogdv1.TypeServing,
+ Type: ocv1.TypeServing,
Status: metav1.ConditionTrue,
- Reason: catalogdv1.ReasonAvailable,
+ Reason: ocv1.ReasonAvailable,
},
},
},
},
- expectedCatalog: &catalogdv1.ClusterCatalog{
+ expectedCatalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog",
Finalizers: []string{fbcDeletionFinalizer},
DeletionTimestamp: &metav1.Time{Time: time.Date(2023, time.October, 10, 4, 19, 0, 0, time.UTC)},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
},
},
},
- Status: catalogdv1.ClusterCatalogStatus{
+ Status: ocv1.ClusterCatalogStatus{
Conditions: []metav1.Condition{
{
- Type: catalogdv1.TypeProgressing,
+ Type: ocv1.TypeProgressing,
Status: metav1.ConditionTrue,
- Reason: catalogdv1.ReasonRetrying,
+ Reason: ocv1.ReasonRetrying,
},
{
- Type: catalogdv1.TypeServing,
+ Type: ocv1.TypeServing,
Status: metav1.ConditionFalse,
- Reason: catalogdv1.ReasonUnavailable,
+ Reason: ocv1.ReasonUnavailable,
},
},
},
@@ -549,66 +549,66 @@ func TestCatalogdControllerReconcile(t *testing.T) {
ImageFS: &fstest.MapFS{},
},
store: &MockStore{},
- catalog: &catalogdv1.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog",
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
},
},
- AvailabilityMode: catalogdv1.AvailabilityModeUnavailable,
+ AvailabilityMode: ocv1.AvailabilityModeUnavailable,
},
- Status: catalogdv1.ClusterCatalogStatus{
- URLs: &catalogdv1.ClusterCatalogURLs{Base: "URL"},
+ Status: ocv1.ClusterCatalogStatus{
+ URLs: &ocv1.ClusterCatalogURLs{Base: "URL"},
LastUnpacked: &metav1.Time{},
- ResolvedSource: &catalogdv1.ResolvedCatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ResolvedImageSource{
+ ResolvedSource: &ocv1.ResolvedCatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ResolvedImageSource{
Ref: "",
},
},
Conditions: []metav1.Condition{
{
- Type: catalogdv1.TypeServing,
+ Type: ocv1.TypeServing,
Status: metav1.ConditionTrue,
- Reason: catalogdv1.ReasonAvailable,
+ Reason: ocv1.ReasonAvailable,
},
{
- Type: catalogdv1.TypeProgressing,
+ Type: ocv1.TypeProgressing,
Status: metav1.ConditionFalse,
- Reason: catalogdv1.ReasonSucceeded,
+ Reason: ocv1.ReasonSucceeded,
},
},
},
},
- expectedCatalog: &catalogdv1.ClusterCatalog{
+ expectedCatalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog",
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
},
},
- AvailabilityMode: catalogdv1.AvailabilityModeUnavailable,
+ AvailabilityMode: ocv1.AvailabilityModeUnavailable,
},
- Status: catalogdv1.ClusterCatalogStatus{
+ Status: ocv1.ClusterCatalogStatus{
Conditions: []metav1.Condition{
{
- Type: catalogdv1.TypeServing,
+ Type: ocv1.TypeServing,
Status: metav1.ConditionFalse,
- Reason: catalogdv1.ReasonUserSpecifiedUnavailable,
+ Reason: ocv1.ReasonUserSpecifiedUnavailable,
},
{
- Type: catalogdv1.TypeProgressing,
+ Type: ocv1.TypeProgressing,
Status: metav1.ConditionTrue,
- Reason: catalogdv1.ReasonSucceeded,
+ Reason: ocv1.ReasonSucceeded,
},
},
},
@@ -620,68 +620,68 @@ func TestCatalogdControllerReconcile(t *testing.T) {
ImageFS: &fstest.MapFS{},
},
store: &MockStore{},
- catalog: &catalogdv1.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog",
Finalizers: []string{fbcDeletionFinalizer},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
},
},
- AvailabilityMode: catalogdv1.AvailabilityModeUnavailable,
+ AvailabilityMode: ocv1.AvailabilityModeUnavailable,
},
- Status: catalogdv1.ClusterCatalogStatus{
- URLs: &catalogdv1.ClusterCatalogURLs{Base: "URL"},
+ Status: ocv1.ClusterCatalogStatus{
+ URLs: &ocv1.ClusterCatalogURLs{Base: "URL"},
LastUnpacked: &metav1.Time{},
- ResolvedSource: &catalogdv1.ResolvedCatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ResolvedImageSource{
+ ResolvedSource: &ocv1.ResolvedCatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ResolvedImageSource{
Ref: "",
},
},
Conditions: []metav1.Condition{
{
- Type: catalogdv1.TypeServing,
+ Type: ocv1.TypeServing,
Status: metav1.ConditionTrue,
- Reason: catalogdv1.ReasonAvailable,
+ Reason: ocv1.ReasonAvailable,
},
{
- Type: catalogdv1.TypeProgressing,
+ Type: ocv1.TypeProgressing,
Status: metav1.ConditionTrue,
- Reason: catalogdv1.ReasonSucceeded,
+ Reason: ocv1.ReasonSucceeded,
},
},
},
},
- expectedCatalog: &catalogdv1.ClusterCatalog{
+ expectedCatalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "catalog",
Finalizers: []string{},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
},
},
- AvailabilityMode: catalogdv1.AvailabilityModeUnavailable,
+ AvailabilityMode: ocv1.AvailabilityModeUnavailable,
},
- Status: catalogdv1.ClusterCatalogStatus{
+ Status: ocv1.ClusterCatalogStatus{
Conditions: []metav1.Condition{
{
- Type: catalogdv1.TypeServing,
+ Type: ocv1.TypeServing,
Status: metav1.ConditionFalse,
- Reason: catalogdv1.ReasonUserSpecifiedUnavailable,
+ Reason: ocv1.ReasonUserSpecifiedUnavailable,
},
{
- Type: catalogdv1.TypeProgressing,
+ Type: ocv1.TypeProgressing,
Status: metav1.ConditionTrue,
- Reason: catalogdv1.ReasonSucceeded,
+ Reason: ocv1.ReasonSucceeded,
},
},
},
@@ -721,20 +721,20 @@ func TestCatalogdControllerReconcile(t *testing.T) {
func TestPollingRequeue(t *testing.T) {
for name, tc := range map[string]struct {
- catalog *catalogdv1.ClusterCatalog
+ catalog *ocv1.ClusterCatalog
expectedRequeueAfter time.Duration
lastPollTime time.Time
}{
"ClusterCatalog with tag based image ref without any poll interval specified, requeueAfter set to 0, ie polling disabled": {
- catalog: &catalogdv1.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "test-catalog",
Finalizers: []string{fbcDeletionFinalizer},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
},
},
@@ -744,15 +744,15 @@ func TestPollingRequeue(t *testing.T) {
lastPollTime: time.Now(),
},
"ClusterCatalog with tag based image ref with poll interval specified, just polled, requeueAfter set to wait.jitter(pollInterval)": {
- catalog: &catalogdv1.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "test-catalog",
Finalizers: []string{fbcDeletionFinalizer},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
PollIntervalMinutes: ptr.To(5),
},
@@ -763,15 +763,15 @@ func TestPollingRequeue(t *testing.T) {
lastPollTime: time.Now(),
},
"ClusterCatalog with tag based image ref with poll interval specified, last polled 2m ago, requeueAfter set to wait.jitter(pollInterval-2)": {
- catalog: &catalogdv1.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "test-catalog",
Finalizers: []string{fbcDeletionFinalizer},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
PollIntervalMinutes: ptr.To(5),
},
@@ -784,16 +784,16 @@ func TestPollingRequeue(t *testing.T) {
} {
t.Run(name, func(t *testing.T) {
ref := mustRef(t, "my.org/someimage@sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")
- tc.catalog.Status = catalogdv1.ClusterCatalogStatus{
+ tc.catalog.Status = ocv1.ClusterCatalogStatus{
Conditions: []metav1.Condition{
- {Type: catalogdv1.TypeServing, Status: metav1.ConditionTrue, Reason: catalogdv1.ReasonAvailable, Message: "Serving desired content from resolved source", LastTransitionTime: metav1.Now()},
- {Type: catalogdv1.TypeProgressing, Status: metav1.ConditionTrue, Reason: catalogdv1.ReasonSucceeded, Message: "Successfully unpacked and stored content from resolved source", LastTransitionTime: metav1.Now()},
+ {Type: ocv1.TypeServing, Status: metav1.ConditionTrue, Reason: ocv1.ReasonAvailable, Message: "Serving desired content from resolved source", LastTransitionTime: metav1.Now()},
+ {Type: ocv1.TypeProgressing, Status: metav1.ConditionTrue, Reason: ocv1.ReasonSucceeded, Message: "Successfully unpacked and stored content from resolved source", LastTransitionTime: metav1.Now()},
},
- ResolvedSource: &catalogdv1.ResolvedCatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ResolvedImageSource{Ref: ref.String()},
+ ResolvedSource: &ocv1.ResolvedCatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ResolvedImageSource{Ref: ref.String()},
},
- URLs: &catalogdv1.ClusterCatalogURLs{Base: "URL"},
+ URLs: &ocv1.ClusterCatalogURLs{Base: "URL"},
LastUnpacked: ptr.To(metav1.NewTime(time.Now().Truncate(time.Second))),
}
reconciler := &ClusterCatalogReconciler{
@@ -825,28 +825,28 @@ func TestPollingReconcilerUnpack(t *testing.T) {
successfulObservedGeneration := int64(2)
successfulRef := mustRef(t, "my.org/someimage@sha256:"+oldDigest)
successfulUnpackTime := time.Time{}
- successfulUnpackStatus := func(mods ...func(status *catalogdv1.ClusterCatalogStatus)) catalogdv1.ClusterCatalogStatus {
- s := catalogdv1.ClusterCatalogStatus{
- URLs: &catalogdv1.ClusterCatalogURLs{Base: "URL"},
+ successfulUnpackStatus := func(mods ...func(status *ocv1.ClusterCatalogStatus)) ocv1.ClusterCatalogStatus {
+ s := ocv1.ClusterCatalogStatus{
+ URLs: &ocv1.ClusterCatalogURLs{Base: "URL"},
Conditions: []metav1.Condition{
{
- Type: catalogdv1.TypeProgressing,
+ Type: ocv1.TypeProgressing,
Status: metav1.ConditionTrue,
- Reason: catalogdv1.ReasonSucceeded,
+ Reason: ocv1.ReasonSucceeded,
Message: "Successfully unpacked and stored content from resolved source",
ObservedGeneration: successfulObservedGeneration,
},
{
- Type: catalogdv1.TypeServing,
+ Type: ocv1.TypeServing,
Status: metav1.ConditionTrue,
- Reason: catalogdv1.ReasonAvailable,
+ Reason: ocv1.ReasonAvailable,
Message: "Serving desired content from resolved source",
ObservedGeneration: successfulObservedGeneration,
},
},
- ResolvedSource: &catalogdv1.ResolvedCatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ResolvedImageSource{
+ ResolvedSource: &ocv1.ResolvedCatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ResolvedImageSource{
Ref: successfulRef.String(),
},
},
@@ -869,20 +869,20 @@ func TestPollingReconcilerUnpack(t *testing.T) {
}
for name, tc := range map[string]struct {
- catalog *catalogdv1.ClusterCatalog
+ catalog *ocv1.ClusterCatalog
storedCatalogData map[string]storedCatalogData
expectedUnpackRun bool
}{
"ClusterCatalog being resolved the first time, unpack should run": {
- catalog: &catalogdv1.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "test-catalog",
Finalizers: []string{fbcDeletionFinalizer},
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
PollIntervalMinutes: ptr.To(5),
},
@@ -892,16 +892,16 @@ func TestPollingReconcilerUnpack(t *testing.T) {
expectedUnpackRun: true,
},
"ClusterCatalog not being resolved the first time, no pollInterval mentioned, unpack should not run": {
- catalog: &catalogdv1.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "test-catalog",
Finalizers: []string{fbcDeletionFinalizer},
Generation: 2,
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
},
},
@@ -912,16 +912,16 @@ func TestPollingReconcilerUnpack(t *testing.T) {
expectedUnpackRun: false,
},
"ClusterCatalog not being resolved the first time, pollInterval mentioned, \"now\" is before next expected poll time, unpack should not run": {
- catalog: &catalogdv1.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "test-catalog",
Finalizers: []string{fbcDeletionFinalizer},
Generation: 2,
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
PollIntervalMinutes: ptr.To(7),
},
@@ -933,16 +933,16 @@ func TestPollingReconcilerUnpack(t *testing.T) {
expectedUnpackRun: false,
},
"ClusterCatalog not being resolved the first time, pollInterval mentioned, \"now\" is after next expected poll time, unpack should run": {
- catalog: &catalogdv1.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "test-catalog",
Finalizers: []string{fbcDeletionFinalizer},
Generation: 2,
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someimage:latest",
PollIntervalMinutes: ptr.To(3),
},
@@ -954,16 +954,16 @@ func TestPollingReconcilerUnpack(t *testing.T) {
expectedUnpackRun: true,
},
"ClusterCatalog not being resolved the first time, pollInterval mentioned, \"now\" is before next expected poll time, generation changed, unpack should run": {
- catalog: &catalogdv1.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "test-catalog",
Finalizers: []string{fbcDeletionFinalizer},
Generation: 3,
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someotherimage@sha256:" + newDigest,
PollIntervalMinutes: ptr.To(7),
},
@@ -975,16 +975,16 @@ func TestPollingReconcilerUnpack(t *testing.T) {
expectedUnpackRun: true,
},
"ClusterCatalog not being resolved the first time, no stored catalog in cache, unpack should run": {
- catalog: &catalogdv1.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "test-catalog",
Finalizers: []string{fbcDeletionFinalizer},
Generation: 3,
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someotherimage@sha256:" + newDigest,
PollIntervalMinutes: ptr.To(7),
},
@@ -995,23 +995,23 @@ func TestPollingReconcilerUnpack(t *testing.T) {
expectedUnpackRun: true,
},
"ClusterCatalog not being resolved the first time, unexpected status, unpack should run": {
- catalog: &catalogdv1.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "test-catalog",
Finalizers: []string{fbcDeletionFinalizer},
Generation: 3,
},
- Spec: catalogdv1.ClusterCatalogSpec{
- Source: catalogdv1.CatalogSource{
- Type: catalogdv1.SourceTypeImage,
- Image: &catalogdv1.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: "my.org/someotherimage@sha256:" + newDigest,
PollIntervalMinutes: ptr.To(7),
},
},
},
- Status: successfulUnpackStatus(func(status *catalogdv1.ClusterCatalogStatus) {
- meta.FindStatusCondition(status.Conditions, catalogdv1.TypeProgressing).Status = metav1.ConditionTrue
+ Status: successfulUnpackStatus(func(status *ocv1.ClusterCatalogStatus) {
+ meta.FindStatusCondition(status.Conditions, ocv1.TypeProgressing).Status = metav1.ConditionTrue
}),
},
storedCatalogData: successfulStoredCatalogData(time.Now()),
diff --git a/internal/catalogd/garbagecollection/garbage_collector.go b/internal/catalogd/garbagecollection/garbage_collector.go
index 2047b30c3..070d1ab1c 100644
--- a/internal/catalogd/garbagecollection/garbage_collector.go
+++ b/internal/catalogd/garbagecollection/garbage_collector.go
@@ -13,7 +13,7 @@ import (
"k8s.io/client-go/metadata"
"sigs.k8s.io/controller-runtime/pkg/manager"
- catalogdv1 "github.com/operator-framework/operator-controller/api/catalogd/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
var _ manager.Runnable = (*GarbageCollector)(nil)
@@ -64,7 +64,7 @@ func (gc *GarbageCollector) Start(ctx context.Context) error {
}
func runGarbageCollection(ctx context.Context, cachePath string, metaClient metadata.Interface) ([]string, error) {
- getter := metaClient.Resource(catalogdv1.GroupVersion.WithResource("clustercatalogs"))
+ getter := metaClient.Resource(ocv1.GroupVersion.WithResource("clustercatalogs"))
metaList, err := getter.List(ctx, metav1.ListOptions{})
if err != nil {
return nil, fmt.Errorf("error listing clustercatalogs: %w", err)
diff --git a/internal/catalogd/garbagecollection/garbage_collector_test.go b/internal/catalogd/garbagecollection/garbage_collector_test.go
index d3bc39889..dae428f6e 100644
--- a/internal/catalogd/garbagecollection/garbage_collector_test.go
+++ b/internal/catalogd/garbagecollection/garbage_collector_test.go
@@ -12,7 +12,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/metadata/fake"
- catalogdv1 "github.com/operator-framework/operator-controller/api/catalogd/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
func TestRunGarbageCollection(t *testing.T) {
@@ -28,7 +28,7 @@ func TestRunGarbageCollection(t *testing.T) {
{
TypeMeta: metav1.TypeMeta{
Kind: "ClusterCatalog",
- APIVersion: catalogdv1.GroupVersion.String(),
+ APIVersion: ocv1.GroupVersion.String(),
},
ObjectMeta: metav1.ObjectMeta{
Name: "one",
@@ -37,7 +37,7 @@ func TestRunGarbageCollection(t *testing.T) {
{
TypeMeta: metav1.TypeMeta{
Kind: "ClusterCatalog",
- APIVersion: catalogdv1.GroupVersion.String(),
+ APIVersion: ocv1.GroupVersion.String(),
},
ObjectMeta: metav1.ObjectMeta{
Name: "two",
@@ -48,7 +48,7 @@ func TestRunGarbageCollection(t *testing.T) {
{
TypeMeta: metav1.TypeMeta{
Kind: "ClusterCatalog",
- APIVersion: catalogdv1.GroupVersion.String(),
+ APIVersion: ocv1.GroupVersion.String(),
},
ObjectMeta: metav1.ObjectMeta{
Name: "three",
diff --git a/internal/catalogd/webhook/cluster_catalog_webhook.go b/internal/catalogd/webhook/cluster_catalog_webhook.go
index 6b75934e7..a19a62e73 100644
--- a/internal/catalogd/webhook/cluster_catalog_webhook.go
+++ b/internal/catalogd/webhook/cluster_catalog_webhook.go
@@ -8,7 +8,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/log"
- catalogdv1 "github.com/operator-framework/operator-controller/api/catalogd/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
// +kubebuilder:webhook:admissionReviewVersions={v1},failurePolicy=Fail,groups=olm.operatorframework.io,mutating=true,name=inject-metadata-name.olm.operatorframework.io,path=/mutate-olm-operatorframework-io-v1-clustercatalog,resources=clustercatalogs,verbs=create;update,versions=v1,sideEffects=None,timeoutSeconds=10
@@ -22,7 +22,7 @@ type ClusterCatalog struct{}
func (r *ClusterCatalog) Default(ctx context.Context, obj runtime.Object) error {
log := log.FromContext(ctx)
log.Info("Invoking Default method for ClusterCatalog", "object", obj)
- catalog, ok := obj.(*catalogdv1.ClusterCatalog)
+ catalog, ok := obj.(*ocv1.ClusterCatalog)
if !ok {
return fmt.Errorf("expected a ClusterCatalog but got a %T", obj)
}
@@ -31,8 +31,8 @@ func (r *ClusterCatalog) Default(ctx context.Context, obj runtime.Object) error
if catalog.Labels == nil {
catalog.Labels = map[string]string{}
}
- catalog.Labels[catalogdv1.MetadataNameLabel] = catalog.GetName()
- log.Info("default", catalogdv1.MetadataNameLabel, catalog.Name, "labels", catalog.Labels)
+ catalog.Labels[ocv1.MetadataNameLabel] = catalog.GetName()
+ log.Info("default", ocv1.MetadataNameLabel, catalog.Name, "labels", catalog.Labels)
return nil
}
@@ -40,7 +40,7 @@ func (r *ClusterCatalog) Default(ctx context.Context, obj runtime.Object) error
// SetupWebhookWithManager sets up the webhook with the manager
func (r *ClusterCatalog) SetupWebhookWithManager(mgr ctrl.Manager) error {
return ctrl.NewWebhookManagedBy(mgr).
- For(&catalogdv1.ClusterCatalog{}).
+ For(&ocv1.ClusterCatalog{}).
WithDefaulter(r).
Complete()
}
diff --git a/internal/catalogd/webhook/cluster_catalog_webhook_test.go b/internal/catalogd/webhook/cluster_catalog_webhook_test.go
index f322bc324..9d029fd82 100644
--- a/internal/catalogd/webhook/cluster_catalog_webhook_test.go
+++ b/internal/catalogd/webhook/cluster_catalog_webhook_test.go
@@ -9,7 +9,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
- catalogdv1 "github.com/operator-framework/operator-controller/api/catalogd/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
// Define a dummy struct that implements runtime.Object but isn't a ClusterCatalog
@@ -30,7 +30,7 @@ func TestClusterCatalogDefaulting(t *testing.T) {
errorMessage string
}{
"no labels provided, name label added": {
- clusterCatalog: &catalogdv1.ClusterCatalog{
+ clusterCatalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "test-catalog",
},
@@ -41,7 +41,7 @@ func TestClusterCatalogDefaulting(t *testing.T) {
expectError: false,
},
"labels already present, name label added": {
- clusterCatalog: &catalogdv1.ClusterCatalog{
+ clusterCatalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "test-catalog",
Labels: map[string]string{
@@ -56,7 +56,7 @@ func TestClusterCatalogDefaulting(t *testing.T) {
expectError: false,
},
"name label already present, no changes": {
- clusterCatalog: &catalogdv1.ClusterCatalog{
+ clusterCatalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: "test-catalog",
Labels: map[string]string{
@@ -97,7 +97,7 @@ func TestClusterCatalogDefaulting(t *testing.T) {
} else {
assert.NoError(t, err)
if tc.expectedLabels != nil {
- labels := tc.clusterCatalog.(*catalogdv1.ClusterCatalog).Labels
+ labels := tc.clusterCatalog.(*ocv1.ClusterCatalog).Labels
assert.Equal(t, tc.expectedLabels, labels)
}
}
diff --git a/internal/operator-controller/action/restconfig.go b/internal/operator-controller/action/restconfig.go
index 9bcc4d55e..6e0121281 100644
--- a/internal/operator-controller/action/restconfig.go
+++ b/internal/operator-controller/action/restconfig.go
@@ -8,7 +8,7 @@ import (
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/client"
- ocv1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/operator-controller/authentication"
)
diff --git a/internal/operator-controller/applier/helm.go b/internal/operator-controller/applier/helm.go
index af6c9258c..76df085cb 100644
--- a/internal/operator-controller/applier/helm.go
+++ b/internal/operator-controller/applier/helm.go
@@ -23,7 +23,7 @@ import (
helmclient "github.com/operator-framework/helm-operator-plugins/pkg/client"
- ocv1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/operator-controller/features"
"github.com/operator-framework/operator-controller/internal/operator-controller/rukpak/convert"
"github.com/operator-framework/operator-controller/internal/operator-controller/rukpak/preflights/crdupgradesafety"
diff --git a/internal/operator-controller/applier/helm_test.go b/internal/operator-controller/applier/helm_test.go
index 6334dc357..b170d8a98 100644
--- a/internal/operator-controller/applier/helm_test.go
+++ b/internal/operator-controller/applier/helm_test.go
@@ -18,7 +18,7 @@ import (
helmclient "github.com/operator-framework/helm-operator-plugins/pkg/client"
- v1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/operator-controller/applier"
"github.com/operator-framework/operator-controller/internal/operator-controller/features"
)
@@ -127,7 +127,7 @@ metadata:
spec:
clusterIP: 0.0.0.0`
- testCE = &v1.ClusterExtension{}
+ testCE = &ocv1.ClusterExtension{}
testObjectLabels = map[string]string{"object": "label"}
testStorageLabels = map[string]string{"storage": "label"}
)
diff --git a/internal/operator-controller/bundleutil/bundle.go b/internal/operator-controller/bundleutil/bundle.go
index f1aebb216..e12368068 100644
--- a/internal/operator-controller/bundleutil/bundle.go
+++ b/internal/operator-controller/bundleutil/bundle.go
@@ -9,7 +9,7 @@ import (
"github.com/operator-framework/operator-registry/alpha/declcfg"
"github.com/operator-framework/operator-registry/alpha/property"
- ocv1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
func GetVersion(b declcfg.Bundle) (*bsemver.Version, error) {
diff --git a/internal/operator-controller/catalogmetadata/client/client.go b/internal/operator-controller/catalogmetadata/client/client.go
index 13a4799f6..0d08c40ef 100644
--- a/internal/operator-controller/catalogmetadata/client/client.go
+++ b/internal/operator-controller/catalogmetadata/client/client.go
@@ -15,7 +15,7 @@ import (
"github.com/operator-framework/operator-registry/alpha/declcfg"
- catalogd "github.com/operator-framework/operator-controller/api/catalogd/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
httputil "github.com/operator-framework/operator-controller/internal/shared/util/http"
)
@@ -61,7 +61,7 @@ type Client struct {
httpClient func() (*http.Client, error)
}
-func (c *Client) GetPackage(ctx context.Context, catalog *catalogd.ClusterCatalog, pkgName string) (*declcfg.DeclarativeConfig, error) {
+func (c *Client) GetPackage(ctx context.Context, catalog *ocv1.ClusterCatalog, pkgName string) (*declcfg.DeclarativeConfig, error) {
if err := validateCatalog(catalog); err != nil {
return nil, err
}
@@ -92,7 +92,7 @@ func (c *Client) GetPackage(ctx context.Context, catalog *catalogd.ClusterCatalo
return pkgFBC, nil
}
-func (c *Client) PopulateCache(ctx context.Context, catalog *catalogd.ClusterCatalog) (fs.FS, error) {
+func (c *Client) PopulateCache(ctx context.Context, catalog *ocv1.ClusterCatalog) (fs.FS, error) {
if err := validateCatalog(catalog); err != nil {
return nil, err
}
@@ -113,7 +113,7 @@ func (c *Client) PopulateCache(ctx context.Context, catalog *catalogd.ClusterCat
return c.cache.Put(catalog.Name, catalog.Status.ResolvedSource.Image.Ref, resp.Body, nil)
}
-func (c *Client) doRequest(ctx context.Context, catalog *catalogd.ClusterCatalog) (*http.Response, error) {
+func (c *Client) doRequest(ctx context.Context, catalog *ocv1.ClusterCatalog) (*http.Response, error) {
if catalog.Status.URLs == nil {
return nil, fmt.Errorf("error: catalog %q has a nil status.urls value", catalog.Name)
}
@@ -142,14 +142,14 @@ func (c *Client) doRequest(ctx context.Context, catalog *catalogd.ClusterCatalog
return resp, nil
}
-func validateCatalog(catalog *catalogd.ClusterCatalog) error {
+func validateCatalog(catalog *ocv1.ClusterCatalog) error {
if catalog == nil {
return fmt.Errorf("error: provided catalog must be non-nil")
}
// if the catalog is not being served, report an error. This ensures that our
// reconciles are deterministic and wait for all desired catalogs to be ready.
- if !meta.IsStatusConditionPresentAndEqual(catalog.Status.Conditions, catalogd.TypeServing, metav1.ConditionTrue) {
+ if !meta.IsStatusConditionPresentAndEqual(catalog.Status.Conditions, ocv1.TypeServing, metav1.ConditionTrue) {
return fmt.Errorf("catalog %q is not being served", catalog.Name)
}
diff --git a/internal/operator-controller/catalogmetadata/client/client_test.go b/internal/operator-controller/catalogmetadata/client/client_test.go
index 085ddc23d..00a226873 100644
--- a/internal/operator-controller/catalogmetadata/client/client_test.go
+++ b/internal/operator-controller/catalogmetadata/client/client_test.go
@@ -16,19 +16,19 @@ import (
"github.com/operator-framework/operator-registry/alpha/declcfg"
- catalogd "github.com/operator-framework/operator-controller/api/catalogd/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
catalogClient "github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/client"
)
-func defaultCatalog() *catalogd.ClusterCatalog {
- return &catalogd.ClusterCatalog{
+func defaultCatalog() *ocv1.ClusterCatalog {
+ return &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{Name: "catalog-1"},
- Status: catalogd.ClusterCatalogStatus{
- Conditions: []metav1.Condition{{Type: catalogd.TypeServing, Status: metav1.ConditionTrue}},
- ResolvedSource: &catalogd.ResolvedCatalogSource{Image: &catalogd.ResolvedImageSource{
+ Status: ocv1.ClusterCatalogStatus{
+ Conditions: []metav1.Condition{{Type: ocv1.TypeServing, Status: metav1.ConditionTrue}},
+ ResolvedSource: &ocv1.ResolvedCatalogSource{Image: &ocv1.ResolvedImageSource{
Ref: "fake/catalog@sha256:fakesha",
}},
- URLs: &catalogd.ClusterCatalogURLs{
+ URLs: &ocv1.ClusterCatalogURLs{
Base: "https://fake-url.svc.local/catalogs/catalog-1",
},
},
@@ -42,7 +42,7 @@ func TestClientGetPackage(t *testing.T) {
type testCase struct {
name string
- catalog func() *catalogd.ClusterCatalog
+ catalog func() *ocv1.ClusterCatalog
pkgName string
cache catalogClient.Cache
assert func(*testing.T, *declcfg.DeclarativeConfig, error)
@@ -50,8 +50,8 @@ func TestClientGetPackage(t *testing.T) {
for _, tc := range []testCase{
{
name: "not served",
- catalog: func() *catalogd.ClusterCatalog {
- return &catalogd.ClusterCatalog{ObjectMeta: metav1.ObjectMeta{Name: "catalog-1"}}
+ catalog: func() *ocv1.ClusterCatalog {
+ return &ocv1.ClusterCatalog{ObjectMeta: metav1.ObjectMeta{Name: "catalog-1"}}
},
assert: func(t *testing.T, dc *declcfg.DeclarativeConfig, err error) {
assert.ErrorContains(t, err, `catalog "catalog-1" is not being served`)
@@ -143,7 +143,7 @@ func TestClientPopulateCache(t *testing.T) {
type testCase struct {
name string
- catalog func() *catalogd.ClusterCatalog
+ catalog func() *ocv1.ClusterCatalog
httpClient func() (*http.Client, error)
putFuncConstructor func(t *testing.T) func(source string, errToCache error) (fs.FS, error)
assert func(t *testing.T, fs fs.FS, err error)
@@ -175,8 +175,8 @@ func TestClientPopulateCache(t *testing.T) {
},
{
name: "not served",
- catalog: func() *catalogd.ClusterCatalog {
- return &catalogd.ClusterCatalog{ObjectMeta: metav1.ObjectMeta{Name: "catalog-1"}}
+ catalog: func() *ocv1.ClusterCatalog {
+ return &ocv1.ClusterCatalog{ObjectMeta: metav1.ObjectMeta{Name: "catalog-1"}}
},
assert: func(t *testing.T, fs fs.FS, err error) {
assert.Nil(t, fs)
diff --git a/internal/operator-controller/catalogmetadata/filter/successors.go b/internal/operator-controller/catalogmetadata/filter/successors.go
index 6cbaead7a..c4abb3258 100644
--- a/internal/operator-controller/catalogmetadata/filter/successors.go
+++ b/internal/operator-controller/catalogmetadata/filter/successors.go
@@ -8,7 +8,7 @@ import (
"github.com/operator-framework/operator-registry/alpha/declcfg"
- ocv1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/shared/util/filter"
)
diff --git a/internal/operator-controller/catalogmetadata/filter/successors_test.go b/internal/operator-controller/catalogmetadata/filter/successors_test.go
index 97f699a27..0d3fb45d2 100644
--- a/internal/operator-controller/catalogmetadata/filter/successors_test.go
+++ b/internal/operator-controller/catalogmetadata/filter/successors_test.go
@@ -13,7 +13,7 @@ import (
"github.com/operator-framework/operator-registry/alpha/declcfg"
"github.com/operator-framework/operator-registry/alpha/property"
- ocv1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/operator-controller/bundleutil"
"github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/compare"
"github.com/operator-framework/operator-controller/internal/shared/util/filter"
diff --git a/internal/operator-controller/conditionsets/conditionsets.go b/internal/operator-controller/conditionsets/conditionsets.go
index 5cd2c0ffc..1b57a0cd8 100644
--- a/internal/operator-controller/conditionsets/conditionsets.go
+++ b/internal/operator-controller/conditionsets/conditionsets.go
@@ -17,7 +17,7 @@ limitations under the License.
package conditionsets
import (
- ocv1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
// ConditionTypes is the full set of ClusterExtension condition Types.
@@ -31,6 +31,7 @@ var ConditionTypes = []string{
ocv1.TypeChannelDeprecated,
ocv1.TypeBundleDeprecated,
ocv1.TypeProgressing,
+ ocv1.TypeServing,
}
var ConditionReasons = []string{
@@ -39,4 +40,7 @@ var ConditionReasons = []string{
ocv1.ReasonFailed,
ocv1.ReasonBlocked,
ocv1.ReasonRetrying,
+ ocv1.ReasonAvailable,
+ ocv1.ReasonUnavailable,
+ ocv1.ReasonUserSpecifiedUnavailable,
}
diff --git a/internal/operator-controller/contentmanager/cache/cache_test.go b/internal/operator-controller/contentmanager/cache/cache_test.go
index d07b1e2f4..da4455168 100644
--- a/internal/operator-controller/contentmanager/cache/cache_test.go
+++ b/internal/operator-controller/contentmanager/cache/cache_test.go
@@ -14,7 +14,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"sigs.k8s.io/controller-runtime/pkg/source"
- ocv1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
type mockWatcher struct {
diff --git a/internal/operator-controller/contentmanager/contentmanager.go b/internal/operator-controller/contentmanager/contentmanager.go
index 070f0ce86..d488bdb53 100644
--- a/internal/operator-controller/contentmanager/contentmanager.go
+++ b/internal/operator-controller/contentmanager/contentmanager.go
@@ -14,7 +14,7 @@ import (
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/client"
- v1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
cmcache "github.com/operator-framework/operator-controller/internal/operator-controller/contentmanager/cache"
oclabels "github.com/operator-framework/operator-controller/internal/operator-controller/labels"
)
@@ -25,10 +25,10 @@ type Manager interface {
// Get returns a managed content cache for the provided
// ClusterExtension if one exists. If one does not exist,
// a new Cache is created and returned
- Get(context.Context, *v1.ClusterExtension) (cmcache.Cache, error)
+ Get(context.Context, *ocv1.ClusterExtension) (cmcache.Cache, error)
// Delete will stop and remove a managed content cache
// for the provided ClusterExtension if one exists.
- Delete(*v1.ClusterExtension) error
+ Delete(*ocv1.ClusterExtension) error
}
type RestConfigMapper func(context.Context, client.Object, *rest.Config) (*rest.Config, error)
@@ -84,7 +84,7 @@ func NewManager(rcm RestConfigMapper, cfg *rest.Config, mapper meta.RESTMapper,
// Get returns a Cache for the provided ClusterExtension.
// If a cache does not already exist, a new one will be created.
// If a nil ClusterExtension is provided this function will panic.
-func (i *managerImpl) Get(ctx context.Context, ce *v1.ClusterExtension) (cmcache.Cache, error) {
+func (i *managerImpl) Get(ctx context.Context, ce *ocv1.ClusterExtension) (cmcache.Cache, error) {
if ce == nil {
panic("nil ClusterExtension provided")
}
@@ -107,7 +107,7 @@ func (i *managerImpl) Get(ctx context.Context, ce *v1.ClusterExtension) (cmcache
}
tgtLabels := labels.Set{
- oclabels.OwnerKindKey: v1.ClusterExtensionKind,
+ oclabels.OwnerKindKey: ocv1.ClusterExtensionKind,
oclabels.OwnerNameKey: ce.GetName(),
}
@@ -129,7 +129,7 @@ func (i *managerImpl) Get(ctx context.Context, ce *v1.ClusterExtension) (cmcache
}
// Delete stops and removes the Cache for the provided ClusterExtension
-func (i *managerImpl) Delete(ce *v1.ClusterExtension) error {
+func (i *managerImpl) Delete(ce *ocv1.ClusterExtension) error {
if ce == nil {
panic("nil ClusterExtension provided")
}
diff --git a/internal/operator-controller/contentmanager/source/dynamicsource_test.go b/internal/operator-controller/contentmanager/source/dynamicsource_test.go
index 9e7ca96a1..3a89a639e 100644
--- a/internal/operator-controller/contentmanager/source/dynamicsource_test.go
+++ b/internal/operator-controller/contentmanager/source/dynamicsource_test.go
@@ -14,7 +14,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/handler"
"sigs.k8s.io/controller-runtime/pkg/predicate"
- "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
func TestDynamicInformerSourceCloseBeforeStartErrors(t *testing.T) {
@@ -101,7 +101,7 @@ func TestDynamicInformerSourceStart(t *testing.T) {
Version: "v1",
Resource: "pods",
},
- Owner: &v1.ClusterExtension{},
+ Owner: &ocv1.ClusterExtension{},
Handler: handler.Funcs{},
Predicates: []predicate.Predicate{},
OnPostSyncError: func(ctx context.Context) {},
diff --git a/internal/operator-controller/contentmanager/sourcerer.go b/internal/operator-controller/contentmanager/sourcerer.go
index eab717819..050de8785 100644
--- a/internal/operator-controller/contentmanager/sourcerer.go
+++ b/internal/operator-controller/contentmanager/sourcerer.go
@@ -15,7 +15,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/handler"
"sigs.k8s.io/controller-runtime/pkg/predicate"
- v1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/operator-controller/contentmanager/cache"
"github.com/operator-framework/operator-controller/internal/operator-controller/contentmanager/source"
)
@@ -68,7 +68,7 @@ func buildScheme(gvks ...schema.GroupVersionKind) (*runtime.Scheme, error) {
// The ClusterExtension types must be added to the scheme since its
// going to be used to establish watches that trigger reconciliation
// of the owning ClusterExtension
- if err := v1.AddToScheme(scheme); err != nil {
+ if err := ocv1.AddToScheme(scheme); err != nil {
return nil, fmt.Errorf("adding operator controller APIs to scheme: %w", err)
}
diff --git a/internal/operator-controller/controllers/clustercatalog_controller.go b/internal/operator-controller/controllers/clustercatalog_controller.go
index 87af43068..c7e7edb03 100644
--- a/internal/operator-controller/controllers/clustercatalog_controller.go
+++ b/internal/operator-controller/controllers/clustercatalog_controller.go
@@ -26,7 +26,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log"
- catalogd "github.com/operator-framework/operator-controller/api/catalogd/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
type CatalogCache interface {
@@ -35,7 +35,7 @@ type CatalogCache interface {
}
type CatalogCachePopulator interface {
- PopulateCache(ctx context.Context, catalog *catalogd.ClusterCatalog) (fs.FS, error)
+ PopulateCache(ctx context.Context, catalog *ocv1.ClusterCatalog) (fs.FS, error)
}
// ClusterCatalogReconciler reconciles a ClusterCatalog object
@@ -54,7 +54,7 @@ func (r *ClusterCatalogReconciler) Reconcile(ctx context.Context, req ctrl.Reque
l.Info("reconcile starting")
defer l.Info("reconcile ending")
- existingCatalog := &catalogd.ClusterCatalog{}
+ existingCatalog := &ocv1.ClusterCatalog{}
err := r.Client.Get(ctx, req.NamespacedName, existingCatalog)
if apierrors.IsNotFound(err) {
if err := r.CatalogCache.Remove(req.Name); err != nil {
@@ -93,7 +93,7 @@ func (r *ClusterCatalogReconciler) Reconcile(ctx context.Context, req ctrl.Reque
// SetupWithManager sets up the controller with the Manager.
func (r *ClusterCatalogReconciler) SetupWithManager(mgr ctrl.Manager) error {
_, err := ctrl.NewControllerManagedBy(mgr).
- For(&catalogd.ClusterCatalog{}).
+ For(&ocv1.ClusterCatalog{}).
Build(r)
return err
diff --git a/internal/operator-controller/controllers/clustercatalog_controller_test.go b/internal/operator-controller/controllers/clustercatalog_controller_test.go
index a2362df48..aad0bb006 100644
--- a/internal/operator-controller/controllers/clustercatalog_controller_test.go
+++ b/internal/operator-controller/controllers/clustercatalog_controller_test.go
@@ -14,7 +14,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client/fake"
- catalogd "github.com/operator-framework/operator-controller/api/catalogd/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/operator-controller/controllers"
"github.com/operator-framework/operator-controller/internal/operator-controller/scheme"
)
@@ -25,7 +25,7 @@ func TestClusterCatalogReconcilerFinalizers(t *testing.T) {
for _, tt := range []struct {
name string
- catalog *catalogd.ClusterCatalog
+ catalog *ocv1.ClusterCatalog
catalogCache mockCatalogCache
catalogCachePopulator mockCatalogCachePopulator
wantGetCacheCalled bool
@@ -35,20 +35,20 @@ func TestClusterCatalogReconcilerFinalizers(t *testing.T) {
}{
{
name: "catalog exists - cache unpopulated",
- catalog: &catalogd.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: catalogKey.Name,
},
- Status: catalogd.ClusterCatalogStatus{
- ResolvedSource: &catalogd.ResolvedCatalogSource{
- Image: &catalogd.ResolvedImageSource{
+ Status: ocv1.ClusterCatalogStatus{
+ ResolvedSource: &ocv1.ResolvedCatalogSource{
+ Image: &ocv1.ResolvedImageSource{
Ref: fakeResolvedRef,
},
},
},
},
catalogCachePopulator: mockCatalogCachePopulator{
- populateCacheFunc: func(ctx context.Context, catalog *catalogd.ClusterCatalog) (fs.FS, error) {
+ populateCacheFunc: func(ctx context.Context, catalog *ocv1.ClusterCatalog) (fs.FS, error) {
assert.Equal(t, catalogKey.Name, catalog.Name)
return nil, nil
},
@@ -58,13 +58,13 @@ func TestClusterCatalogReconcilerFinalizers(t *testing.T) {
},
{
name: "catalog exists - cache already populated",
- catalog: &catalogd.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: catalogKey.Name,
},
- Status: catalogd.ClusterCatalogStatus{
- ResolvedSource: &catalogd.ResolvedCatalogSource{
- Image: &catalogd.ResolvedImageSource{
+ Status: ocv1.ClusterCatalogStatus{
+ ResolvedSource: &ocv1.ResolvedCatalogSource{
+ Image: &ocv1.ResolvedImageSource{
Ref: fakeResolvedRef,
},
},
@@ -82,7 +82,7 @@ func TestClusterCatalogReconcilerFinalizers(t *testing.T) {
},
{
name: "catalog exists - catalog not yet resolved",
- catalog: &catalogd.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: catalogKey.Name,
},
@@ -90,20 +90,20 @@ func TestClusterCatalogReconcilerFinalizers(t *testing.T) {
},
{
name: "catalog exists - error on cache population",
- catalog: &catalogd.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: catalogKey.Name,
},
- Status: catalogd.ClusterCatalogStatus{
- ResolvedSource: &catalogd.ResolvedCatalogSource{
- Image: &catalogd.ResolvedImageSource{
+ Status: ocv1.ClusterCatalogStatus{
+ ResolvedSource: &ocv1.ResolvedCatalogSource{
+ Image: &ocv1.ResolvedImageSource{
Ref: fakeResolvedRef,
},
},
},
},
catalogCachePopulator: mockCatalogCachePopulator{
- populateCacheFunc: func(ctx context.Context, catalog *catalogd.ClusterCatalog) (fs.FS, error) {
+ populateCacheFunc: func(ctx context.Context, catalog *ocv1.ClusterCatalog) (fs.FS, error) {
assert.Equal(t, catalogKey.Name, catalog.Name)
return nil, errors.New("fake error from populate cache function")
},
@@ -114,13 +114,13 @@ func TestClusterCatalogReconcilerFinalizers(t *testing.T) {
},
{
name: "catalog exists - error on cache get",
- catalog: &catalogd.ClusterCatalog{
+ catalog: &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: catalogKey.Name,
},
- Status: catalogd.ClusterCatalogStatus{
- ResolvedSource: &catalogd.ResolvedCatalogSource{
- Image: &catalogd.ResolvedImageSource{
+ Status: ocv1.ClusterCatalogStatus{
+ ResolvedSource: &ocv1.ResolvedCatalogSource{
+ Image: &ocv1.ResolvedImageSource{
Ref: fakeResolvedRef,
},
},
@@ -215,10 +215,10 @@ func (m *mockCatalogCache) Get(catalogName, resolvedRef string) (fs.FS, error) {
type mockCatalogCachePopulator struct {
populateCacheCalled bool
- populateCacheFunc func(ctx context.Context, catalog *catalogd.ClusterCatalog) (fs.FS, error)
+ populateCacheFunc func(ctx context.Context, catalog *ocv1.ClusterCatalog) (fs.FS, error)
}
-func (m *mockCatalogCachePopulator) PopulateCache(ctx context.Context, catalog *catalogd.ClusterCatalog) (fs.FS, error) {
+func (m *mockCatalogCachePopulator) PopulateCache(ctx context.Context, catalog *ocv1.ClusterCatalog) (fs.FS, error) {
m.populateCacheCalled = true
if m.populateCacheFunc != nil {
return m.populateCacheFunc(ctx, catalog)
diff --git a/internal/operator-controller/controllers/clusterextension_admission_test.go b/internal/operator-controller/controllers/clusterextension_admission_test.go
index 2b5816bec..3bf58fd48 100644
--- a/internal/operator-controller/controllers/clusterextension_admission_test.go
+++ b/internal/operator-controller/controllers/clusterextension_admission_test.go
@@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- ocv1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
func TestClusterExtensionSourceConfig(t *testing.T) {
@@ -39,7 +39,7 @@ func TestClusterExtensionSourceConfig(t *testing.T) {
err = cl.Create(context.Background(), buildClusterExtension(ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: tc.sourceType,
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: "test-package",
},
},
@@ -109,7 +109,7 @@ func TestClusterExtensionAdmissionPackageName(t *testing.T) {
err := cl.Create(context.Background(), buildClusterExtension(ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: tc.pkgName,
},
},
@@ -206,7 +206,7 @@ func TestClusterExtensionAdmissionVersion(t *testing.T) {
err := cl.Create(context.Background(), buildClusterExtension(ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: "package",
Version: tc.version,
},
@@ -261,7 +261,7 @@ func TestClusterExtensionAdmissionChannel(t *testing.T) {
err := cl.Create(context.Background(), buildClusterExtension(ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: "package",
Channels: tc.channels,
},
@@ -315,7 +315,7 @@ func TestClusterExtensionAdmissionInstallNamespace(t *testing.T) {
err := cl.Create(context.Background(), buildClusterExtension(ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: "package",
},
},
@@ -369,7 +369,7 @@ func TestClusterExtensionAdmissionServiceAccount(t *testing.T) {
err := cl.Create(context.Background(), buildClusterExtension(ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: "package",
},
},
@@ -428,7 +428,7 @@ func TestClusterExtensionAdmissionInstall(t *testing.T) {
err := cl.Create(context.Background(), buildClusterExtension(ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: "package",
},
},
diff --git a/internal/operator-controller/controllers/clusterextension_controller.go b/internal/operator-controller/controllers/clusterextension_controller.go
index 3f9896358..d914b831b 100644
--- a/internal/operator-controller/controllers/clusterextension_controller.go
+++ b/internal/operator-controller/controllers/clusterextension_controller.go
@@ -48,8 +48,7 @@ import (
helmclient "github.com/operator-framework/helm-operator-plugins/pkg/client"
"github.com/operator-framework/operator-registry/alpha/declcfg"
- catalogd "github.com/operator-framework/operator-controller/api/catalogd/v1"
- ocv1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/operator-controller/authentication"
"github.com/operator-framework/operator-controller/internal/operator-controller/bundleutil"
"github.com/operator-framework/operator-controller/internal/operator-controller/conditionsets"
@@ -408,12 +407,12 @@ func SetDeprecationStatus(ext *ocv1.ClusterExtension, bundleName string, depreca
func (r *ClusterExtensionReconciler) SetupWithManager(mgr ctrl.Manager) error {
controller, err := ctrl.NewControllerManagedBy(mgr).
For(&ocv1.ClusterExtension{}).
- Watches(&catalogd.ClusterCatalog{},
+ Watches(&ocv1.ClusterCatalog{},
crhandler.EnqueueRequestsFromMapFunc(clusterExtensionRequestsForCatalog(mgr.GetClient(), mgr.GetLogger())),
builder.WithPredicates(predicate.Funcs{
UpdateFunc: func(ue event.UpdateEvent) bool {
- oldObject, isOldCatalog := ue.ObjectOld.(*catalogd.ClusterCatalog)
- newObject, isNewCatalog := ue.ObjectNew.(*catalogd.ClusterCatalog)
+ oldObject, isOldCatalog := ue.ObjectOld.(*ocv1.ClusterCatalog)
+ newObject, isNewCatalog := ue.ObjectNew.(*ocv1.ClusterCatalog)
if !isOldCatalog || !isNewCatalog {
return true
diff --git a/internal/operator-controller/controllers/clusterextension_controller_test.go b/internal/operator-controller/controllers/clusterextension_controller_test.go
index 709b61bec..be61891a0 100644
--- a/internal/operator-controller/controllers/clusterextension_controller_test.go
+++ b/internal/operator-controller/controllers/clusterextension_controller_test.go
@@ -27,7 +27,7 @@ import (
helmclient "github.com/operator-framework/helm-operator-plugins/pkg/client"
"github.com/operator-framework/operator-registry/alpha/declcfg"
- ocv1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/operator-controller/authentication"
"github.com/operator-framework/operator-controller/internal/operator-controller/conditionsets"
"github.com/operator-framework/operator-controller/internal/operator-controller/controllers"
@@ -64,7 +64,7 @@ func TestClusterExtensionResolutionFails(t *testing.T) {
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: pkgName,
},
},
@@ -138,7 +138,7 @@ func TestClusterExtensionResolutionSuccessfulUnpackFails(t *testing.T) {
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: pkgName,
Version: pkgVer,
Channels: []string{pkgChan},
@@ -218,7 +218,7 @@ func TestClusterExtensionResolutionAndUnpackSuccessfulApplierFails(t *testing.T)
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: pkgName,
Version: pkgVer,
Channels: []string{pkgChan},
@@ -290,7 +290,7 @@ func TestClusterExtensionServiceAccountNotFound(t *testing.T) {
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: "test-package",
},
},
@@ -349,7 +349,7 @@ func TestClusterExtensionApplierFailsWithBundleInstalled(t *testing.T) {
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: pkgName,
Version: pkgVer,
Channels: []string{pkgChan},
@@ -445,7 +445,7 @@ func TestClusterExtensionManagerFailed(t *testing.T) {
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: pkgName,
Version: pkgVer,
Channels: []string{pkgChan},
@@ -524,7 +524,7 @@ func TestClusterExtensionManagedContentCacheWatchFail(t *testing.T) {
Source: ocv1.SourceConfig{
SourceType: ocv1.SourceTypeCatalog,
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: pkgName,
Version: pkgVer,
Channels: []string{pkgChan},
@@ -604,7 +604,7 @@ func TestClusterExtensionInstallationSucceeds(t *testing.T) {
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: pkgName,
Version: pkgVer,
Channels: []string{pkgChan},
@@ -682,7 +682,7 @@ func TestClusterExtensionDeleteFinalizerFails(t *testing.T) {
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: pkgName,
Version: pkgVer,
Channels: []string{pkgChan},
@@ -844,7 +844,7 @@ func TestSetDeprecationStatus(t *testing.T) {
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{},
+ Catalog: &ocv1.CatalogFilter{},
},
},
Status: ocv1.ClusterExtensionStatus{
@@ -858,7 +858,7 @@ func TestSetDeprecationStatus(t *testing.T) {
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{},
+ Catalog: &ocv1.CatalogFilter{},
},
},
Status: ocv1.ClusterExtensionStatus{
@@ -909,7 +909,7 @@ func TestSetDeprecationStatus(t *testing.T) {
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
Channels: []string{"nondeprecated"},
},
},
@@ -925,7 +925,7 @@ func TestSetDeprecationStatus(t *testing.T) {
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
Channels: []string{"nondeprecated"},
},
},
@@ -980,7 +980,7 @@ func TestSetDeprecationStatus(t *testing.T) {
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
Channels: []string{"badchannel"},
},
},
@@ -996,7 +996,7 @@ func TestSetDeprecationStatus(t *testing.T) {
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
Channels: []string{"badchannel"},
},
},
@@ -1052,7 +1052,7 @@ func TestSetDeprecationStatus(t *testing.T) {
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
Channels: []string{"badchannel"},
},
},
@@ -1068,7 +1068,7 @@ func TestSetDeprecationStatus(t *testing.T) {
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
Channels: []string{"badchannel"},
},
},
@@ -1137,7 +1137,7 @@ func TestSetDeprecationStatus(t *testing.T) {
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
Channels: []string{"badchannel"},
},
},
@@ -1153,7 +1153,7 @@ func TestSetDeprecationStatus(t *testing.T) {
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
Channels: []string{"badchannel"},
},
},
@@ -1216,7 +1216,7 @@ func TestSetDeprecationStatus(t *testing.T) {
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
Channels: []string{"badchannel"},
},
},
@@ -1232,7 +1232,7 @@ func TestSetDeprecationStatus(t *testing.T) {
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
Channels: []string{"badchannel"},
},
},
@@ -1294,7 +1294,7 @@ func TestSetDeprecationStatus(t *testing.T) {
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
Channels: []string{"badchannel", "anotherbadchannel"},
},
},
@@ -1310,7 +1310,7 @@ func TestSetDeprecationStatus(t *testing.T) {
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
Channels: []string{"badchannel", "anotherbadchannel"},
},
},
diff --git a/internal/operator-controller/controllers/common_controller.go b/internal/operator-controller/controllers/common_controller.go
index 6bcb2d17e..7cee10c10 100644
--- a/internal/operator-controller/controllers/common_controller.go
+++ b/internal/operator-controller/controllers/common_controller.go
@@ -24,7 +24,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
- ocv1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
// setInstalledStatusFromBundle sets the installed status based on the given installedBundle.
diff --git a/internal/operator-controller/controllers/common_controller_test.go b/internal/operator-controller/controllers/common_controller_test.go
index a4e56ddd0..7b644172d 100644
--- a/internal/operator-controller/controllers/common_controller_test.go
+++ b/internal/operator-controller/controllers/common_controller_test.go
@@ -11,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
- ocv1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
func TestSetStatusProgressing(t *testing.T) {
diff --git a/internal/operator-controller/controllers/suite_test.go b/internal/operator-controller/controllers/suite_test.go
index ebe09ea60..a83f0439c 100644
--- a/internal/operator-controller/controllers/suite_test.go
+++ b/internal/operator-controller/controllers/suite_test.go
@@ -35,7 +35,7 @@ import (
helmclient "github.com/operator-framework/helm-operator-plugins/pkg/client"
- ocv1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/operator-controller/contentmanager"
cmcache "github.com/operator-framework/operator-controller/internal/operator-controller/contentmanager/cache"
"github.com/operator-framework/operator-controller/internal/operator-controller/controllers"
diff --git a/internal/operator-controller/resolve/catalog.go b/internal/operator-controller/resolve/catalog.go
index f8ea9308c..8cd1ebe81 100644
--- a/internal/operator-controller/resolve/catalog.go
+++ b/internal/operator-controller/resolve/catalog.go
@@ -17,8 +17,7 @@ import (
"github.com/operator-framework/operator-registry/alpha/declcfg"
- catalogd "github.com/operator-framework/operator-controller/api/catalogd/v1"
- ocv1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/operator-controller/bundleutil"
"github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/compare"
"github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/filter"
@@ -82,7 +81,7 @@ func (r *CatalogResolver) Resolve(ctx context.Context, ext *ocv1.ClusterExtensio
listOptions := []client.ListOption{
client.MatchingLabelsSelector{Selector: selector},
}
- if err := r.WalkCatalogsFunc(ctx, packageName, func(ctx context.Context, cat *catalogd.ClusterCatalog, packageFBC *declcfg.DeclarativeConfig, err error) error {
+ if err := r.WalkCatalogsFunc(ctx, packageName, func(ctx context.Context, cat *ocv1.ClusterCatalog, packageFBC *declcfg.DeclarativeConfig, err error) error {
if err != nil {
return fmt.Errorf("error getting package %q from catalog %q: %w", packageName, cat.Name, err)
}
@@ -261,11 +260,11 @@ func isDeprecated(bundle declcfg.Bundle, deprecation *declcfg.Deprecation) bool
return false
}
-type CatalogWalkFunc func(context.Context, *catalogd.ClusterCatalog, *declcfg.DeclarativeConfig, error) error
+type CatalogWalkFunc func(context.Context, *ocv1.ClusterCatalog, *declcfg.DeclarativeConfig, error) error
func CatalogWalker(
- listCatalogs func(context.Context, ...client.ListOption) ([]catalogd.ClusterCatalog, error),
- getPackage func(context.Context, *catalogd.ClusterCatalog, string) (*declcfg.DeclarativeConfig, error),
+ listCatalogs func(context.Context, ...client.ListOption) ([]ocv1.ClusterCatalog, error),
+ getPackage func(context.Context, *ocv1.ClusterCatalog, string) (*declcfg.DeclarativeConfig, error),
) func(ctx context.Context, packageName string, f CatalogWalkFunc, catalogListOpts ...client.ListOption) error {
return func(ctx context.Context, packageName string, f CatalogWalkFunc, catalogListOpts ...client.ListOption) error {
l := log.FromContext(ctx)
@@ -275,15 +274,15 @@ func CatalogWalker(
}
// Remove disabled catalogs from consideration
- catalogs = slices.DeleteFunc(catalogs, func(c catalogd.ClusterCatalog) bool {
- if c.Spec.AvailabilityMode == catalogd.AvailabilityModeUnavailable {
+ catalogs = slices.DeleteFunc(catalogs, func(c ocv1.ClusterCatalog) bool {
+ if c.Spec.AvailabilityMode == ocv1.AvailabilityModeUnavailable {
l.Info("excluding ClusterCatalog from resolution process since it is disabled", "catalog", c.Name)
return true
}
return false
})
- availableCatalogNames := mapSlice(catalogs, func(c catalogd.ClusterCatalog) string { return c.Name })
+ availableCatalogNames := mapSlice(catalogs, func(c ocv1.ClusterCatalog) string { return c.Name })
l.Info("using ClusterCatalogs for resolution", "catalogs", availableCatalogNames)
for i := range catalogs {
diff --git a/internal/operator-controller/resolve/catalog_test.go b/internal/operator-controller/resolve/catalog_test.go
index 70192976a..00467253e 100644
--- a/internal/operator-controller/resolve/catalog_test.go
+++ b/internal/operator-controller/resolve/catalog_test.go
@@ -18,8 +18,7 @@ import (
"github.com/operator-framework/operator-registry/alpha/declcfg"
"github.com/operator-framework/operator-registry/alpha/property"
- catalogd "github.com/operator-framework/operator-controller/api/catalogd/v1"
- ocv1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
func TestInvalidClusterExtensionVersionRange(t *testing.T) {
@@ -42,7 +41,7 @@ func TestErrorWalkingCatalogs(t *testing.T) {
func TestErrorGettingPackage(t *testing.T) {
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return nil, nil, fmt.Errorf("fake error")
},
}
@@ -55,13 +54,13 @@ func TestErrorGettingPackage(t *testing.T) {
func TestPackageDoesNotExist(t *testing.T) {
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "b": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "b": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "c": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "c": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
}
@@ -75,13 +74,13 @@ func TestPackageDoesNotExist(t *testing.T) {
func TestPackageExists(t *testing.T) {
pkgName := randPkg()
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "b": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "b": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "c": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "c": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return genPackage(pkgName), nil, nil
},
}
@@ -97,13 +96,13 @@ func TestPackageExists(t *testing.T) {
func TestValidationFailed(t *testing.T) {
pkgName := randPkg()
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "b": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "b": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "c": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "c": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return genPackage(pkgName), nil, nil
},
}
@@ -123,13 +122,13 @@ func TestValidationFailed(t *testing.T) {
func TestVersionDoesNotExist(t *testing.T) {
pkgName := randPkg()
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "b": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "b": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "c": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "c": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return genPackage(pkgName), nil, nil
},
}
@@ -142,13 +141,13 @@ func TestVersionDoesNotExist(t *testing.T) {
func TestVersionExists(t *testing.T) {
pkgName := randPkg()
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "b": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "b": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "c": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "c": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return genPackage(pkgName), nil, nil
},
}
@@ -164,13 +163,13 @@ func TestVersionExists(t *testing.T) {
func TestChannelDoesNotExist(t *testing.T) {
pkgName := randPkg()
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "b": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "b": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "c": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "c": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return genPackage(pkgName), nil, nil
},
}
@@ -183,13 +182,13 @@ func TestChannelDoesNotExist(t *testing.T) {
func TestChannelExists(t *testing.T) {
pkgName := randPkg()
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "b": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "b": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "c": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "c": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return genPackage(pkgName), nil, nil
},
}
@@ -205,13 +204,13 @@ func TestChannelExists(t *testing.T) {
func TestChannelExistsButNotVersion(t *testing.T) {
pkgName := randPkg()
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "b": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "b": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "c": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "c": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return genPackage(pkgName), nil, nil
},
}
@@ -224,13 +223,13 @@ func TestChannelExistsButNotVersion(t *testing.T) {
func TestVersionExistsButNotChannel(t *testing.T) {
pkgName := randPkg()
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "b": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "b": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "c": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "c": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return genPackage(pkgName), nil, nil
},
}
@@ -243,13 +242,13 @@ func TestVersionExistsButNotChannel(t *testing.T) {
func TestChannelAndVersionExist(t *testing.T) {
pkgName := randPkg()
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "b": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "b": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "c": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "c": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return genPackage(pkgName), nil, nil
},
}
@@ -265,13 +264,13 @@ func TestChannelAndVersionExist(t *testing.T) {
func TestPreferNonDeprecated(t *testing.T) {
pkgName := randPkg()
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "b": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "b": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "c": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "c": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return genPackage(pkgName), nil, nil
},
}
@@ -287,13 +286,13 @@ func TestPreferNonDeprecated(t *testing.T) {
func TestAcceptDeprecated(t *testing.T) {
pkgName := randPkg()
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "b": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "b": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "c": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "c": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return genPackage(pkgName), nil, nil
},
}
@@ -309,10 +308,10 @@ func TestAcceptDeprecated(t *testing.T) {
func TestPackageVariationsBetweenCatalogs(t *testing.T) {
pkgName := randPkg()
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "b": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "b": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
fbc := &declcfg.DeclarativeConfig{
Packages: []declcfg.Package{{Name: pkgName}},
Bundles: []declcfg.Bundle{genBundle(pkgName, "1.0.0")},
@@ -328,7 +327,7 @@ func TestPackageVariationsBetweenCatalogs(t *testing.T) {
}
return fbc, nil, nil
},
- "c": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "c": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
fbc := &declcfg.DeclarativeConfig{
Packages: []declcfg.Package{{Name: pkgName}},
Bundles: []declcfg.Bundle{genBundle(pkgName, "1.0.1")},
@@ -344,14 +343,14 @@ func TestPackageVariationsBetweenCatalogs(t *testing.T) {
}
return fbc, nil, nil
},
- "d": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "d": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
fbc := &declcfg.DeclarativeConfig{
Packages: []declcfg.Package{{Name: pkgName}},
Bundles: []declcfg.Bundle{genBundle(pkgName, "1.0.2")},
}
return fbc, nil, nil
},
- "e": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "e": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
fbc := &declcfg.DeclarativeConfig{
Packages: []declcfg.Package{{Name: pkgName}},
Bundles: []declcfg.Bundle{genBundle(pkgName, "1.0.3")},
@@ -367,7 +366,7 @@ func TestPackageVariationsBetweenCatalogs(t *testing.T) {
}
return fbc, nil, nil
},
- "f": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "f": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
fbc := &declcfg.DeclarativeConfig{
Packages: []declcfg.Package{{Name: pkgName}},
Bundles: []declcfg.Bundle{
@@ -426,13 +425,13 @@ func TestPackageVariationsBetweenCatalogs(t *testing.T) {
func TestUpgradeFoundLegacy(t *testing.T) {
pkgName := randPkg()
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "b": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "b": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "c": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "c": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return genPackage(pkgName), nil, nil
},
}
@@ -453,13 +452,13 @@ func TestUpgradeFoundLegacy(t *testing.T) {
func TestUpgradeNotFoundLegacy(t *testing.T) {
pkgName := randPkg()
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "b": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "b": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "c": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "c": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return genPackage(pkgName), nil, nil
},
}
@@ -477,13 +476,13 @@ func TestUpgradeNotFoundLegacy(t *testing.T) {
func TestDowngradeFound(t *testing.T) {
pkgName := randPkg()
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "b": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "b": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "c": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "c": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return genPackage(pkgName), nil, nil
},
}
@@ -505,13 +504,13 @@ func TestDowngradeFound(t *testing.T) {
func TestDowngradeNotFound(t *testing.T) {
pkgName := randPkg()
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "b": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "b": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "c": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "c": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return genPackage(pkgName), nil, nil
},
}
@@ -529,14 +528,14 @@ func TestDowngradeNotFound(t *testing.T) {
func TestCatalogWalker(t *testing.T) {
t.Run("error listing catalogs", func(t *testing.T) {
w := CatalogWalker(
- func(ctx context.Context, option ...client.ListOption) ([]catalogd.ClusterCatalog, error) {
+ func(ctx context.Context, option ...client.ListOption) ([]ocv1.ClusterCatalog, error) {
return nil, fmt.Errorf("fake error")
},
- func(context.Context, *catalogd.ClusterCatalog, string) (*declcfg.DeclarativeConfig, error) {
+ func(context.Context, *ocv1.ClusterCatalog, string) (*declcfg.DeclarativeConfig, error) {
return nil, nil
},
)
- walkFunc := func(ctx context.Context, cat *catalogd.ClusterCatalog, fbc *declcfg.DeclarativeConfig, err error) error {
+ walkFunc := func(ctx context.Context, cat *ocv1.ClusterCatalog, fbc *declcfg.DeclarativeConfig, err error) error {
return nil
}
assert.EqualError(t, w(context.Background(), "", walkFunc), "error listing catalogs: fake error")
@@ -544,14 +543,14 @@ func TestCatalogWalker(t *testing.T) {
t.Run("error getting package", func(t *testing.T) {
w := CatalogWalker(
- func(ctx context.Context, option ...client.ListOption) ([]catalogd.ClusterCatalog, error) {
- return []catalogd.ClusterCatalog{{ObjectMeta: metav1.ObjectMeta{Name: "a"}}}, nil
+ func(ctx context.Context, option ...client.ListOption) ([]ocv1.ClusterCatalog, error) {
+ return []ocv1.ClusterCatalog{{ObjectMeta: metav1.ObjectMeta{Name: "a"}}}, nil
},
- func(context.Context, *catalogd.ClusterCatalog, string) (*declcfg.DeclarativeConfig, error) {
+ func(context.Context, *ocv1.ClusterCatalog, string) (*declcfg.DeclarativeConfig, error) {
return nil, fmt.Errorf("fake error getting package FBC")
},
)
- walkFunc := func(ctx context.Context, cat *catalogd.ClusterCatalog, fbc *declcfg.DeclarativeConfig, err error) error {
+ walkFunc := func(ctx context.Context, cat *ocv1.ClusterCatalog, fbc *declcfg.DeclarativeConfig, err error) error {
return err
}
assert.EqualError(t, w(context.Background(), "", walkFunc), "fake error getting package FBC")
@@ -559,19 +558,19 @@ func TestCatalogWalker(t *testing.T) {
t.Run("success", func(t *testing.T) {
w := CatalogWalker(
- func(ctx context.Context, option ...client.ListOption) ([]catalogd.ClusterCatalog, error) {
- return []catalogd.ClusterCatalog{
+ func(ctx context.Context, option ...client.ListOption) ([]ocv1.ClusterCatalog, error) {
+ return []ocv1.ClusterCatalog{
{ObjectMeta: metav1.ObjectMeta{Name: "a"}},
{ObjectMeta: metav1.ObjectMeta{Name: "b"}},
}, nil
},
- func(context.Context, *catalogd.ClusterCatalog, string) (*declcfg.DeclarativeConfig, error) {
+ func(context.Context, *ocv1.ClusterCatalog, string) (*declcfg.DeclarativeConfig, error) {
return &declcfg.DeclarativeConfig{}, nil
},
)
seenCatalogs := []string{}
- walkFunc := func(ctx context.Context, cat *catalogd.ClusterCatalog, fbc *declcfg.DeclarativeConfig, err error) error {
+ walkFunc := func(ctx context.Context, cat *ocv1.ClusterCatalog, fbc *declcfg.DeclarativeConfig, err error) error {
seenCatalogs = append(seenCatalogs, cat.Name)
return nil
}
@@ -590,7 +589,7 @@ func buildFooClusterExtension(pkg string, channels []string, version string, upg
ServiceAccount: ocv1.ServiceAccountReference{Name: "default"},
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: pkg,
Version: version,
Channels: channels,
@@ -601,13 +600,13 @@ func buildFooClusterExtension(pkg string, channels []string, version string, upg
}
}
-type getPackageFunc func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error)
+type getPackageFunc func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error)
type staticCatalogWalker map[string]getPackageFunc
func (w staticCatalogWalker) WalkCatalogs(ctx context.Context, _ string, f CatalogWalkFunc, opts ...client.ListOption) error {
for k, v := range w {
- cat := &catalogd.ClusterCatalog{
+ cat := &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: k,
Labels: map[string]string{
@@ -706,7 +705,7 @@ func TestInvalidClusterExtensionCatalogMatchExpressions(t *testing.T) {
},
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: "foo",
Selector: &metav1.LabelSelector{
MatchExpressions: []metav1.LabelSelectorRequirement{
@@ -727,7 +726,7 @@ func TestInvalidClusterExtensionCatalogMatchExpressions(t *testing.T) {
func TestInvalidClusterExtensionCatalogMatchLabelsName(t *testing.T) {
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return genPackage("foo"), nil, nil
},
}
@@ -738,7 +737,7 @@ func TestInvalidClusterExtensionCatalogMatchLabelsName(t *testing.T) {
},
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: "foo",
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"": "value"},
@@ -753,7 +752,7 @@ func TestInvalidClusterExtensionCatalogMatchLabelsName(t *testing.T) {
func TestInvalidClusterExtensionCatalogMatchLabelsValue(t *testing.T) {
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return genPackage("foo"), nil, nil
},
}
@@ -764,7 +763,7 @@ func TestInvalidClusterExtensionCatalogMatchLabelsValue(t *testing.T) {
},
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: "foo",
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"name": "&value"},
@@ -780,10 +779,10 @@ func TestInvalidClusterExtensionCatalogMatchLabelsValue(t *testing.T) {
func TestClusterExtensionMatchLabel(t *testing.T) {
pkgName := randPkg()
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return genPackage(pkgName), nil, nil
},
- "b": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "b": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return genPackage(pkgName), nil, nil
},
}
@@ -800,10 +799,10 @@ func TestClusterExtensionMatchLabel(t *testing.T) {
func TestClusterExtensionNoMatchLabel(t *testing.T) {
pkgName := randPkg()
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "b": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "b": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return genPackage(pkgName), nil, nil
},
}
@@ -821,7 +820,7 @@ func TestClusterExtensionNoMatchLabel(t *testing.T) {
func TestUnequalPriority(t *testing.T) {
pkgName := randPkg()
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{
Packages: []declcfg.Package{{Name: pkgName}},
Channels: []declcfg.Channel{
@@ -833,9 +832,9 @@ func TestUnequalPriority(t *testing.T) {
genBundle(pkgName, "1.0.0"),
},
Deprecations: []declcfg.Deprecation{},
- }, &catalogd.ClusterCatalogSpec{Priority: 1}, nil
+ }, &ocv1.ClusterCatalogSpec{Priority: 1}, nil
},
- "b": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "b": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{
Packages: []declcfg.Package{{Name: pkgName}},
Channels: []declcfg.Channel{
@@ -847,7 +846,7 @@ func TestUnequalPriority(t *testing.T) {
genBundle(pkgName, "1.1.0"),
},
Deprecations: []declcfg.Deprecation{},
- }, &catalogd.ClusterCatalogSpec{Priority: 0}, nil
+ }, &ocv1.ClusterCatalogSpec{Priority: 0}, nil
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
@@ -861,14 +860,14 @@ func TestUnequalPriority(t *testing.T) {
func TestMultiplePriority(t *testing.T) {
pkgName := randPkg()
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
- return genPackage(pkgName), &catalogd.ClusterCatalogSpec{Priority: 1}, nil
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
+ return genPackage(pkgName), &ocv1.ClusterCatalogSpec{Priority: 1}, nil
},
- "b": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
- return genPackage(pkgName), &catalogd.ClusterCatalogSpec{Priority: 0}, nil
+ "b": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
+ return genPackage(pkgName), &ocv1.ClusterCatalogSpec{Priority: 0}, nil
},
- "c": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
- return genPackage(pkgName), &catalogd.ClusterCatalogSpec{Priority: 1}, nil
+ "c": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
+ return genPackage(pkgName), &ocv1.ClusterCatalogSpec{Priority: 1}, nil
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
@@ -885,13 +884,13 @@ func TestMultiplePriority(t *testing.T) {
func TestMultipleChannels(t *testing.T) {
pkgName := randPkg()
w := staticCatalogWalker{
- "a": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "a": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "b": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "b": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return &declcfg.DeclarativeConfig{}, nil, nil
},
- "c": func() (*declcfg.DeclarativeConfig, *catalogd.ClusterCatalogSpec, error) {
+ "c": func() (*declcfg.DeclarativeConfig, *ocv1.ClusterCatalogSpec, error) {
return genPackage(pkgName), nil, nil
},
}
@@ -906,22 +905,22 @@ func TestMultipleChannels(t *testing.T) {
func TestAllCatalogsDisabled(t *testing.T) {
pkgName := randPkg()
- listCatalogs := func(ctx context.Context, options ...client.ListOption) ([]catalogd.ClusterCatalog, error) {
- return []catalogd.ClusterCatalog{
+ listCatalogs := func(ctx context.Context, options ...client.ListOption) ([]ocv1.ClusterCatalog, error) {
+ return []ocv1.ClusterCatalog{
{
- Spec: catalogd.ClusterCatalogSpec{
- AvailabilityMode: catalogd.AvailabilityModeUnavailable,
+ Spec: ocv1.ClusterCatalogSpec{
+ AvailabilityMode: ocv1.AvailabilityModeUnavailable,
},
},
{
- Spec: catalogd.ClusterCatalogSpec{
- AvailabilityMode: catalogd.AvailabilityModeUnavailable,
+ Spec: ocv1.ClusterCatalogSpec{
+ AvailabilityMode: ocv1.AvailabilityModeUnavailable,
},
},
}, nil
}
- getPackage := func(ctx context.Context, cat *catalogd.ClusterCatalog, packageName string) (*declcfg.DeclarativeConfig, error) {
+ getPackage := func(ctx context.Context, cat *ocv1.ClusterCatalog, packageName string) (*declcfg.DeclarativeConfig, error) {
panic("getPackage should never be called when all catalogs are disabled")
}
@@ -937,30 +936,30 @@ func TestAllCatalogsDisabled(t *testing.T) {
func TestSomeCatalogsDisabled(t *testing.T) {
pkgName := randPkg()
- listCatalogs := func(ctx context.Context, options ...client.ListOption) ([]catalogd.ClusterCatalog, error) {
- return []catalogd.ClusterCatalog{
+ listCatalogs := func(ctx context.Context, options ...client.ListOption) ([]ocv1.ClusterCatalog, error) {
+ return []ocv1.ClusterCatalog{
{
ObjectMeta: metav1.ObjectMeta{
Name: "enabledCatalog",
},
- Spec: catalogd.ClusterCatalogSpec{
+ Spec: ocv1.ClusterCatalogSpec{
Priority: 1, // Higher priority
- AvailabilityMode: catalogd.AvailabilityModeAvailable,
+ AvailabilityMode: ocv1.AvailabilityModeAvailable,
},
},
{
ObjectMeta: metav1.ObjectMeta{
Name: "disabledCatalog",
},
- Spec: catalogd.ClusterCatalogSpec{
+ Spec: ocv1.ClusterCatalogSpec{
Priority: 0, // Lower priority (but disabled)
- AvailabilityMode: catalogd.AvailabilityModeUnavailable,
+ AvailabilityMode: ocv1.AvailabilityModeUnavailable,
},
},
}, nil
}
- getPackage := func(ctx context.Context, cat *catalogd.ClusterCatalog, packageName string) (*declcfg.DeclarativeConfig, error) {
+ getPackage := func(ctx context.Context, cat *ocv1.ClusterCatalog, packageName string) (*declcfg.DeclarativeConfig, error) {
// Only enabled catalog should be processed
return genPackage(pkgName), nil
}
diff --git a/internal/operator-controller/resolve/resolver.go b/internal/operator-controller/resolve/resolver.go
index 738333d3d..625111d63 100644
--- a/internal/operator-controller/resolve/resolver.go
+++ b/internal/operator-controller/resolve/resolver.go
@@ -7,7 +7,7 @@ import (
"github.com/operator-framework/operator-registry/alpha/declcfg"
- ocv1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
type Resolver interface {
diff --git a/internal/operator-controller/scheme/scheme.go b/internal/operator-controller/scheme/scheme.go
index b4dd2ceaf..bb8d44ef7 100644
--- a/internal/operator-controller/scheme/scheme.go
+++ b/internal/operator-controller/scheme/scheme.go
@@ -7,8 +7,7 @@ import (
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
- catalogd "github.com/operator-framework/operator-controller/api/catalogd/v1"
- ocv1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
var Scheme = runtime.NewScheme()
@@ -16,7 +15,7 @@ var Scheme = runtime.NewScheme()
func init() {
utilruntime.Must(clientgoscheme.AddToScheme(Scheme))
utilruntime.Must(ocv1.AddToScheme(Scheme))
- utilruntime.Must(catalogd.AddToScheme(Scheme))
+ utilruntime.Must(ocv1.AddToScheme(Scheme))
utilruntime.Must(appsv1.AddToScheme(Scheme))
utilruntime.Must(corev1.AddToScheme(Scheme))
//+kubebuilder:scaffold:scheme
diff --git a/test/e2e/cluster_extension_install_test.go b/test/e2e/cluster_extension_install_test.go
index 03ed1f8fe..a01124bfb 100644
--- a/test/e2e/cluster_extension_install_test.go
+++ b/test/e2e/cluster_extension_install_test.go
@@ -21,8 +21,7 @@ import (
"k8s.io/apimachinery/pkg/util/rand"
"sigs.k8s.io/controller-runtime/pkg/client"
- catalogd "github.com/operator-framework/operator-controller/api/catalogd/v1"
- ocv1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/test/utils"
)
@@ -186,7 +185,7 @@ func createClusterRoleAndBindingForSA(ctx context.Context, name string, sa *core
return nil
}
-func testInit(t *testing.T) (*ocv1.ClusterExtension, *catalogd.ClusterCatalog, *corev1.ServiceAccount, *corev1.Namespace) {
+func testInit(t *testing.T) (*ocv1.ClusterExtension, *ocv1.ClusterCatalog, *corev1.ServiceAccount, *corev1.Namespace) {
var err error
clusterExtensionName := fmt.Sprintf("clusterextension-%s", rand.String(8))
@@ -217,15 +216,15 @@ func testInit(t *testing.T) (*ocv1.ClusterExtension, *catalogd.ClusterCatalog, *
}
func validateCatalogUnpack(t *testing.T) {
- catalog := &catalogd.ClusterCatalog{}
+ catalog := &ocv1.ClusterCatalog{}
t.Log("Ensuring ClusterCatalog has Status.Condition of Progressing with a status == True and reason == Succeeded")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
err := c.Get(context.Background(), types.NamespacedName{Name: testCatalogName}, catalog)
assert.NoError(ct, err)
- cond := apimeta.FindStatusCondition(catalog.Status.Conditions, catalogd.TypeProgressing)
+ cond := apimeta.FindStatusCondition(catalog.Status.Conditions, ocv1.TypeProgressing)
assert.NotNil(ct, cond)
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, catalogd.ReasonSucceeded, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonSucceeded, cond.Reason)
}, pollDuration, pollInterval)
t.Log("Checking that catalog has the expected metadata label")
@@ -237,10 +236,10 @@ func validateCatalogUnpack(t *testing.T) {
require.EventuallyWithT(t, func(ct *assert.CollectT) {
err := c.Get(context.Background(), types.NamespacedName{Name: testCatalogName}, catalog)
assert.NoError(ct, err)
- cond := apimeta.FindStatusCondition(catalog.Status.Conditions, catalogd.TypeServing)
+ cond := apimeta.FindStatusCondition(catalog.Status.Conditions, ocv1.TypeServing)
assert.NotNil(ct, cond)
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, catalogd.ReasonAvailable, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonAvailable, cond.Reason)
}, pollDuration, pollInterval)
}
@@ -274,11 +273,11 @@ func ensureNoExtensionResources(t *testing.T, clusterExtensionName string) {
}, 2*pollDuration, pollInterval)
}
-func testCleanup(t *testing.T, cat *catalogd.ClusterCatalog, clusterExtension *ocv1.ClusterExtension, sa *corev1.ServiceAccount, ns *corev1.Namespace) {
+func testCleanup(t *testing.T, cat *ocv1.ClusterCatalog, clusterExtension *ocv1.ClusterExtension, sa *corev1.ServiceAccount, ns *corev1.Namespace) {
t.Logf("By deleting ClusterCatalog %q", cat.Name)
require.NoError(t, c.Delete(context.Background(), cat))
require.Eventually(t, func() bool {
- err := c.Get(context.Background(), types.NamespacedName{Name: cat.Name}, &catalogd.ClusterCatalog{})
+ err := c.Get(context.Background(), types.NamespacedName{Name: cat.Name}, &ocv1.ClusterCatalog{})
return errors.IsNotFound(err)
}, pollDuration, pollInterval)
@@ -336,7 +335,7 @@ func TestClusterExtensionInstallRegistry(t *testing.T) {
clusterExtension.Spec = ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: tc.packageName,
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"olm.operatorframework.io/metadata.name": extensionCatalog.Name},
@@ -396,7 +395,7 @@ func TestClusterExtensionInstallRegistryDynamic(t *testing.T) {
clusterExtension.Spec = ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: packageName,
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"olm.operatorframework.io/metadata.name": extensionCatalog.Name},
@@ -467,10 +466,10 @@ func TestClusterExtensionInstallRegistryMultipleBundles(t *testing.T) {
defer testCleanup(t, extensionCatalog, clusterExtension, sa, ns)
defer utils.CollectTestArtifacts(t, artifactName, c, cfg)
- defer func(cat *catalogd.ClusterCatalog) {
+ defer func(cat *ocv1.ClusterCatalog) {
require.NoError(t, c.Delete(context.Background(), cat))
require.Eventually(t, func() bool {
- err := c.Get(context.Background(), types.NamespacedName{Name: cat.Name}, &catalogd.ClusterCatalog{})
+ err := c.Get(context.Background(), types.NamespacedName{Name: cat.Name}, &ocv1.ClusterCatalog{})
return errors.IsNotFound(err)
}, pollDuration, pollInterval)
}(extraCatalog)
@@ -478,7 +477,7 @@ func TestClusterExtensionInstallRegistryMultipleBundles(t *testing.T) {
clusterExtension.Spec = ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: "test",
},
},
@@ -520,7 +519,7 @@ func TestClusterExtensionBlockInstallNonSuccessorVersion(t *testing.T) {
clusterExtension.Spec = ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: "test",
Version: "1.0.0",
// No Selector since this is an exact version match
@@ -583,7 +582,7 @@ func TestClusterExtensionForceInstallNonSuccessorVersion(t *testing.T) {
clusterExtension.Spec = ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: "test",
Version: "1.0.0",
},
@@ -632,7 +631,7 @@ func TestClusterExtensionInstallSuccessorVersion(t *testing.T) {
clusterExtension.Spec = ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: "test",
Version: "1.0.0",
},
@@ -679,7 +678,7 @@ func TestClusterExtensionInstallReResolvesWhenCatalogIsPatched(t *testing.T) {
clusterExtension.Spec = ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: "test",
Selector: &metav1.LabelSelector{
MatchExpressions: []metav1.LabelSelectorRequirement{
@@ -718,10 +717,10 @@ func TestClusterExtensionInstallReResolvesWhenCatalogIsPatched(t *testing.T) {
require.NoError(t, err)
require.EventuallyWithT(t, func(ct *assert.CollectT) {
assert.NoError(ct, c.Get(context.Background(), types.NamespacedName{Name: extensionCatalog.Name}, extensionCatalog))
- cond := apimeta.FindStatusCondition(extensionCatalog.Status.Conditions, catalogd.TypeServing)
+ cond := apimeta.FindStatusCondition(extensionCatalog.Status.Conditions, ocv1.TypeServing)
if assert.NotNil(ct, cond) {
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, catalogd.ReasonAvailable, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonAvailable, cond.Reason)
}
}, pollDuration, pollInterval)
@@ -766,7 +765,7 @@ func TestClusterExtensionInstallReResolvesWhenNewCatalog(t *testing.T) {
clusterExtension.Spec = ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: "test",
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"olm.operatorframework.io/metadata.name": extensionCatalog.Name},
@@ -799,10 +798,10 @@ func TestClusterExtensionInstallReResolvesWhenNewCatalog(t *testing.T) {
require.NoError(t, err)
require.EventuallyWithT(t, func(ct *assert.CollectT) {
assert.NoError(ct, c.Get(context.Background(), types.NamespacedName{Name: extensionCatalog.Name}, extensionCatalog))
- cond := apimeta.FindStatusCondition(extensionCatalog.Status.Conditions, catalogd.TypeServing)
+ cond := apimeta.FindStatusCondition(extensionCatalog.Status.Conditions, ocv1.TypeServing)
if assert.NotNil(ct, cond) {
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, catalogd.ReasonAvailable, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonAvailable, cond.Reason)
}
}, pollDuration, pollInterval)
@@ -827,7 +826,7 @@ func TestClusterExtensionInstallReResolvesWhenManagedContentChanged(t *testing.T
clusterExtension.Spec = ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: "test",
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"olm.operatorframework.io/metadata.name": extensionCatalog.Name},
@@ -890,7 +889,7 @@ func TestClusterExtensionRecoversFromInitialInstallFailedWhenFailureFixed(t *tes
clusterExtension.Spec = ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: "test",
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"olm.operatorframework.io/metadata.name": extensionCatalog.Name},
diff --git a/test/e2e/e2e_suite_test.go b/test/e2e/e2e_suite_test.go
index 091df56d7..354ef75f4 100644
--- a/test/e2e/e2e_suite_test.go
+++ b/test/e2e/e2e_suite_test.go
@@ -13,7 +13,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
- catalogd "github.com/operator-framework/operator-controller/api/catalogd/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/operator-controller/scheme"
)
@@ -45,15 +45,15 @@ func TestMain(m *testing.M) {
// Note that catalogd will automatically create the label:
//
// "olm.operatorframework.io/metadata.name": name
-func createTestCatalog(ctx context.Context, name string, imageRef string) (*catalogd.ClusterCatalog, error) {
- catalog := &catalogd.ClusterCatalog{
+func createTestCatalog(ctx context.Context, name string, imageRef string) (*ocv1.ClusterCatalog, error) {
+ catalog := &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
Name: name,
},
- Spec: catalogd.ClusterCatalogSpec{
- Source: catalogd.CatalogSource{
- Type: catalogd.SourceTypeImage,
- Image: &catalogd.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: imageRef,
PollIntervalMinutes: ptr.To(1),
},
@@ -70,7 +70,7 @@ func createTestCatalog(ctx context.Context, name string, imageRef string) (*cata
// if any errors occurred while updating the catalog.
func patchTestCatalog(ctx context.Context, name string, newImageRef string) error {
// Fetch the existing ClusterCatalog
- catalog := &catalogd.ClusterCatalog{}
+ catalog := &ocv1.ClusterCatalog{}
err := c.Get(ctx, client.ObjectKey{Name: name}, catalog)
if err != nil {
return err
diff --git a/test/extension-developer-e2e/extension_developer_test.go b/test/extension-developer-e2e/extension_developer_test.go
index dad4e0d61..c493887b0 100644
--- a/test/extension-developer-e2e/extension_developer_test.go
+++ b/test/extension-developer-e2e/extension_developer_test.go
@@ -18,8 +18,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
- catalogd "github.com/operator-framework/operator-controller/api/catalogd/v1"
- ocv1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
func TestExtensionDeveloper(t *testing.T) {
@@ -28,7 +27,7 @@ func TestExtensionDeveloper(t *testing.T) {
scheme := runtime.NewScheme()
- require.NoError(t, catalogd.AddToScheme(scheme))
+ require.NoError(t, ocv1.AddToScheme(scheme))
require.NoError(t, ocv1.AddToScheme(scheme))
require.NoError(t, corev1.AddToScheme(scheme))
require.NoError(t, rbacv1.AddToScheme(scheme))
@@ -38,14 +37,14 @@ func TestExtensionDeveloper(t *testing.T) {
ctx := context.Background()
- catalog := &catalogd.ClusterCatalog{
+ catalog := &ocv1.ClusterCatalog{
ObjectMeta: metav1.ObjectMeta{
GenerateName: "catalog",
},
- Spec: catalogd.ClusterCatalogSpec{
- Source: catalogd.CatalogSource{
- Type: catalogd.SourceTypeImage,
- Image: &catalogd.ImageSource{
+ Spec: ocv1.ClusterCatalogSpec{
+ Source: ocv1.CatalogSource{
+ Type: ocv1.SourceTypeImage,
+ Image: &ocv1.ImageSource{
Ref: os.Getenv("CATALOG_IMG"),
},
},
@@ -70,7 +69,7 @@ func TestExtensionDeveloper(t *testing.T) {
Spec: ocv1.ClusterExtensionSpec{
Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1.CatalogSource{
+ Catalog: &ocv1.CatalogFilter{
PackageName: os.Getenv("REG_PKG_NAME"),
},
},
diff --git a/test/upgrade-e2e/post_upgrade_test.go b/test/upgrade-e2e/post_upgrade_test.go
index 128f499e3..1d20b4afa 100644
--- a/test/upgrade-e2e/post_upgrade_test.go
+++ b/test/upgrade-e2e/post_upgrade_test.go
@@ -18,8 +18,7 @@ import (
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"
- catalogd "github.com/operator-framework/operator-controller/api/catalogd/v1"
- ocv1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/test/utils"
)
@@ -75,25 +74,25 @@ func TestClusterCatalogUnpacking(t *testing.T) {
require.NoError(t, err)
require.True(t, found)
- catalog := &catalogd.ClusterCatalog{}
+ catalog := &ocv1.ClusterCatalog{}
t.Log("Ensuring ClusterCatalog has Status.Condition of Progressing with a status == True, reason == Succeeded")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
err := c.Get(ctx, types.NamespacedName{Name: testClusterCatalogName}, catalog)
assert.NoError(ct, err)
- cond := apimeta.FindStatusCondition(catalog.Status.Conditions, catalogd.TypeProgressing)
+ cond := apimeta.FindStatusCondition(catalog.Status.Conditions, ocv1.TypeProgressing)
assert.NotNil(ct, cond)
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, catalogd.ReasonSucceeded, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonSucceeded, cond.Reason)
}, time.Minute, time.Second)
t.Log("Ensuring ClusterCatalog has Status.Condition of Serving with a status == True, reason == Available")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
err := c.Get(ctx, types.NamespacedName{Name: testClusterCatalogName}, catalog)
assert.NoError(ct, err)
- cond := apimeta.FindStatusCondition(catalog.Status.Conditions, catalogd.TypeServing)
+ cond := apimeta.FindStatusCondition(catalog.Status.Conditions, ocv1.TypeServing)
assert.NotNil(ct, cond)
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, catalogd.ReasonAvailable, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonAvailable, cond.Reason)
}, time.Minute, time.Second)
}
@@ -135,24 +134,24 @@ func TestClusterExtensionAfterOLMUpgrade(t *testing.T) {
t.Log("Checking that the ClusterCatalog is unpacked")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
- var clusterCatalog catalogd.ClusterCatalog
+ var clusterCatalog ocv1.ClusterCatalog
assert.NoError(ct, c.Get(ctx, types.NamespacedName{Name: testClusterCatalogName}, &clusterCatalog))
// check serving condition
- cond := apimeta.FindStatusCondition(clusterCatalog.Status.Conditions, catalogd.TypeServing)
+ cond := apimeta.FindStatusCondition(clusterCatalog.Status.Conditions, ocv1.TypeServing)
assert.NotNil(ct, cond)
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, catalogd.ReasonAvailable, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonAvailable, cond.Reason)
// mitigation for upgrade-e2e flakiness caused by the following bug
// https://github.com/operator-framework/operator-controller/issues/1626
// wait until the unpack time > than the catalogd controller pod creation time
- cond = apimeta.FindStatusCondition(clusterCatalog.Status.Conditions, catalogd.TypeProgressing)
+ cond = apimeta.FindStatusCondition(clusterCatalog.Status.Conditions, ocv1.TypeProgressing)
if cond == nil {
return
}
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, catalogd.ReasonSucceeded, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonSucceeded, cond.Reason)
assert.True(ct, clusterCatalog.Status.LastUnpacked.After(catalogdManagerPod.CreationTimestamp.Time))
}, time.Minute, time.Second)
diff --git a/test/utils/artifacts.go b/test/utils/artifacts.go
index b29f784d7..acb523ade 100644
--- a/test/utils/artifacts.go
+++ b/test/utils/artifacts.go
@@ -19,8 +19,7 @@ import (
"k8s.io/utils/env"
"sigs.k8s.io/controller-runtime/pkg/client"
- catalogd "github.com/operator-framework/operator-controller/api/catalogd/v1"
- ocv1 "github.com/operator-framework/operator-controller/api/operator-controller/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
// CollectTestArtifacts gets all the artifacts from the test run and saves them to the artifact path.
@@ -71,7 +70,7 @@ func CollectTestArtifacts(t *testing.T, artifactName string, c client.Client, cf
}
// get all catalogsources save them to the artifact path.
- catalogsources := catalogd.ClusterCatalogList{}
+ catalogsources := ocv1.ClusterCatalogList{}
if err := c.List(context.Background(), &catalogsources, client.InNamespace("")); err != nil {
fmt.Printf("Failed to list catalogsources: %v", err)
}
diff --git a/test/utils/utils.go b/test/utils/utils.go
index f02ea0fe0..1acc55fe6 100644
--- a/test/utils/utils.go
+++ b/test/utils/utils.go
@@ -11,7 +11,7 @@ import (
"k8s.io/client-go/kubernetes"
- catalogdv1 "github.com/operator-framework/operator-controller/api/catalogd/v1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
// FindK8sClient returns the first available Kubernetes CLI client from the system,
@@ -31,7 +31,7 @@ func FindK8sClient(t *testing.T) string {
return ""
}
-func ReadTestCatalogServerContents(ctx context.Context, catalog *catalogdv1.ClusterCatalog, kubeClient kubernetes.Interface) ([]byte, error) {
+func ReadTestCatalogServerContents(ctx context.Context, catalog *ocv1.ClusterCatalog, kubeClient kubernetes.Interface) ([]byte, error) {
if catalog == nil {
return nil, fmt.Errorf("cannot read nil catalog")
}