diff --git a/internal/sync/configs/ocs-config.yaml b/internal/sync/configs/ocs-config.yaml index 980f1f61d..e7d3560b4 100644 --- a/internal/sync/configs/ocs-config.yaml +++ b/internal/sync/configs/ocs-config.yaml @@ -95,6 +95,9 @@ local_api_directory: schemes/ocs/noobaa excludes: - "*test.go" + # We do not currently use these types so they can safely be removed to + # avoid importing cloudnative-pg. + - cnpg_types.go replace_imports: - old: '"github.com/kube-object-storage/lib-bucket-provisioner/pkg/apis/objectbucket.io/v1alpha1"' new: '"github.com/openshift-kni/eco-goinfra/pkg/schemes/ocs/objectbucket.io/v1alpha1"' diff --git a/pkg/schemes/ocs/noobaa/cnpg_types.go b/pkg/schemes/ocs/noobaa/cnpg_types.go deleted file mode 100644 index 82c903fc5..000000000 --- a/pkg/schemes/ocs/noobaa/cnpg_types.go +++ /dev/null @@ -1,37 +0,0 @@ -package noobaa - -import ( - "os" - - cnpgv1 "github.com/cloudnative-pg/cloudnative-pg/api/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// Register the noobaa variant of cnpg types -func init() { - // skip if USE_CNPG_API_GROUP is true - if os.Getenv("USE_CNPG_API_GROUP") == "true" { - return - } - CNPGSchemeBuilder.Register(&cnpgv1.Cluster{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "postgresql.cnpg.noobaa.io/v1", - Kind: "Cluster", - }, - }, &cnpgv1.ClusterList{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "postgresql.cnpg.noobaa.io/v1", - Kind: "ClusterList", - }, - }, &cnpgv1.ImageCatalog{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "postgresql.cnpg.noobaa.io/v1", - Kind: "ImageCatalog", - }, - }, &cnpgv1.ImageCatalogList{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "postgresql.cnpg.noobaa.io/v1", - Kind: "ImageCatalogList", - }, - }) -} diff --git a/pkg/schemes/ocs/noobaa/noobaa_types.go b/pkg/schemes/ocs/noobaa/noobaa_types.go index dcf64db59..0e35bbd3a 100644 --- a/pkg/schemes/ocs/noobaa/noobaa_types.go +++ b/pkg/schemes/ocs/noobaa/noobaa_types.go @@ -465,13 +465,23 @@ type NooBaaDBStatus struct { type DBClusterStatus string const ( - // DBClusterStatusNone means the DB is not created - DBClusterStatusNone DBClusterStatus = "None" - DBClusterStatusCreating DBClusterStatus = "Creating" - DBClusterStatusUpdating DBClusterStatus = "Updating" + // DBClusterStatusNone means there is no DB cluster configured + DBClusterStatusNone DBClusterStatus = "None" + + // DBClusterStatusCreating means a new DB cluster is being created + DBClusterStatusCreating DBClusterStatus = "Creating" + + // DBClusterStatusUpdating means the DB cluster is being updated + DBClusterStatusUpdating DBClusterStatus = "Updating" + + // DBClusterStatusImporting means a new DB cluster is being created and data is being imported from the previous DB DBClusterStatusImporting DBClusterStatus = "Importing" - DBClusterStatusReady DBClusterStatus = "Ready" - DBClusterStatusFailed DBClusterStatus = "Failed" + + // DBClusterStatusReady means the DB cluster is ready + DBClusterStatusReady DBClusterStatus = "Ready" + + // DBClusterStatusFailed means the DB cluster reconciliation encountered an error + DBClusterStatusFailed DBClusterStatus = "Failed" ) // These are the valid conditions types and statuses: diff --git a/pkg/schemes/ocs/operatorv1/storagecluster_types.go b/pkg/schemes/ocs/operatorv1/storagecluster_types.go index 8671113a6..536936888 100644 --- a/pkg/schemes/ocs/operatorv1/storagecluster_types.go +++ b/pkg/schemes/ocs/operatorv1/storagecluster_types.go @@ -97,7 +97,8 @@ type StorageClusterSpec struct { AllowRemoteStorageConsumers bool `json:"allowRemoteStorageConsumers,omitempty"` // ProviderAPIServerServiceType Indicates the ServiceType for OCS Provider API Server Service. - // The supported values are NodePort or LoadBalancer. The default ServiceType is NodePort if the value is empty. + // The default ServiceType is derived from hostNetwork field. + // +kubebuilder:validation:Enum=ClusterIP;NodePort;LoadBalancer ProviderAPIServerServiceType corev1.ServiceType `json:"providerAPIServerServiceType,omitempty"` // EnableCephTools toggles on whether or not the ceph tools pod