diff --git a/PROJECT b/PROJECT index 4e56408d..93b5d5c4 100644 --- a/PROJECT +++ b/PROJECT @@ -14,5 +14,5 @@ resources: group: odf kind: FlashSystemCluster path: github.com/IBM/ibm-storage-odf-operator/api/v1 - version: v1alpha1 + version: v1 version: "3" diff --git a/api/v1/groupversion_info.go b/api/v1/groupversion_info.go index 8e453885..5c3fd94f 100644 --- a/api/v1/groupversion_info.go +++ b/api/v1/groupversion_info.go @@ -14,7 +14,7 @@ * limitations under the License. */ -// Package v1alpha1 contains API Schema definitions for the odf v1alpha1 API group +// Package v1 contains API Schema definitions for the odf v1 API group // +kubebuilder:object:generate=true // +groupName=odf.ibm.com package v1 @@ -26,7 +26,7 @@ import ( var ( // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "odf.ibm.com", Version: "v1alpha1"} + GroupVersion = schema.GroupVersion{Group: "odf.ibm.com", Version: "v1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} diff --git a/bundle/manifests/ibm-storage-odf-operator.clusterserviceversion.yaml b/bundle/manifests/ibm-storage-odf-operator.clusterserviceversion.yaml index 2ed7bd2d..013da415 100644 --- a/bundle/manifests/ibm-storage-odf-operator.clusterserviceversion.yaml +++ b/bundle/manifests/ibm-storage-odf-operator.clusterserviceversion.yaml @@ -5,7 +5,7 @@ metadata: alm-examples: |- [ { - "apiVersion": "odf.ibm.com/v1alpha1", + "apiVersion": "odf.ibm.com/v1", "kind": "FlashSystemCluster", "metadata": { "name": "flashsystemcluster-sample", @@ -44,7 +44,7 @@ spec: displayName: Flash System Cluster kind: FlashSystemCluster name: flashsystemclusters.odf.ibm.com - version: v1alpha1 + version: v1 description: IBM Storage ODF operator provides basic storage capabilities and extended management functions through OpenShift data foundation framework for applications. displayName: IBM Storage ODF operator icon: diff --git a/bundle/manifests/odf.ibm.com_flashsystemclusters.yaml b/bundle/manifests/odf.ibm.com_flashsystemclusters.yaml index d647aa46..1a71994f 100644 --- a/bundle/manifests/odf.ibm.com_flashsystemclusters.yaml +++ b/bundle/manifests/odf.ibm.com_flashsystemclusters.yaml @@ -25,7 +25,7 @@ spec: - jsonPath: .metadata.creationTimestamp name: Created At type: string - name: v1alpha1 + name: v1 schema: openAPIV3Schema: description: FlashSystemCluster is the Schema for the FlashSystemClusters diff --git a/config/crd/bases/odf.ibm.com_flashsystemclusters.yaml b/config/crd/bases/odf.ibm.com_flashsystemclusters.yaml index 4aee78f8..5d86d874 100644 --- a/config/crd/bases/odf.ibm.com_flashsystemclusters.yaml +++ b/config/crd/bases/odf.ibm.com_flashsystemclusters.yaml @@ -27,7 +27,7 @@ spec: - jsonPath: .metadata.creationTimestamp name: Created At type: string - name: v1alpha1 + name: v1 schema: openAPIV3Schema: description: FlashSystemCluster is the Schema for the FlashSystemClusters diff --git a/config/manifests/bases/ibm-storage-odf-operator.clusterserviceversion.yaml b/config/manifests/bases/ibm-storage-odf-operator.clusterserviceversion.yaml index 96347d23..29a52153 100644 --- a/config/manifests/bases/ibm-storage-odf-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/ibm-storage-odf-operator.clusterserviceversion.yaml @@ -16,7 +16,7 @@ spec: displayName: Flash System Cluster kind: FlashSystemCluster name: flashsystemclusters.odf.ibm.com - version: v1alpha1 + version: v1 description: IBM Storage ODF operator provides basic storage capabilities and extended management functions through OpenShift data foundation framework for applications. displayName: IBM Storage ODF operator diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml index 1b33331c..57b529e6 100644 --- a/config/samples/kustomization.yaml +++ b/config/samples/kustomization.yaml @@ -1,4 +1,4 @@ ## Append samples you want in your CSV to this file as resources ## resources: -- odf_v1alpha1_flashsystemcluster.yaml +- odf_v1_flashsystemcluster.yaml #+kubebuilder:scaffold:manifestskustomizesamples diff --git a/config/samples/odf_v1alpha1_flashsystemcluster.yaml b/config/samples/odf_v1_flashsystemcluster.yaml similarity index 92% rename from config/samples/odf_v1alpha1_flashsystemcluster.yaml rename to config/samples/odf_v1_flashsystemcluster.yaml index a6ad54dc..f0c2649d 100644 --- a/config/samples/odf_v1alpha1_flashsystemcluster.yaml +++ b/config/samples/odf_v1_flashsystemcluster.yaml @@ -1,4 +1,4 @@ -apiVersion: odf.ibm.com/v1alpha1 +apiVersion: odf.ibm.com/v1 kind: FlashSystemCluster metadata: name: flashsystemcluster-sample diff --git a/controllers/persistentvolume/persistentvolume_controller.go b/controllers/persistentvolume/persistentvolume_controller.go index 559cf8ee..345bc4a9 100644 --- a/controllers/persistentvolume/persistentvolume_controller.go +++ b/controllers/persistentvolume/persistentvolume_controller.go @@ -20,7 +20,7 @@ import ( "context" "encoding/json" "fmt" - "github.com/IBM/ibm-storage-odf-operator/api/v1" + apiv1 "github.com/IBM/ibm-storage-odf-operator/api/v1" "github.com/go-logr/logr" corev1 "k8s.io/api/core/v1" storagev1 "k8s.io/api/storage/v1" @@ -112,7 +112,7 @@ func (r *PersistentVolumeWatcher) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). For(&corev1.PersistentVolume{}, builder.WithPredicates(pvPredicate)). Watches(&source.Kind{ - Type: &v1alpha1.FlashSystemCluster{}, + Type: &apiv1.FlashSystemCluster{}, }, handler.EnqueueRequestsFromMapFunc(pvMapper.pvMap), builder.WithPredicates(util.IgnoreUpdateAndGenericPredicate)). Watches(&source.Kind{ Type: &corev1.Secret{}, diff --git a/controllers/storageclass/storageclass_controller.go b/controllers/storageclass/storageclass_controller.go index 8f272baf..a1202d59 100644 --- a/controllers/storageclass/storageclass_controller.go +++ b/controllers/storageclass/storageclass_controller.go @@ -20,7 +20,7 @@ import ( "bytes" "context" "fmt" - "github.com/IBM/ibm-storage-odf-operator/api/v1" + apiv1 "github.com/IBM/ibm-storage-odf-operator/api/v1" "github.com/IBM/ibm-storage-odf-operator/controllers" "github.com/IBM/ibm-storage-odf-operator/controllers/util" "github.com/go-logr/logr" @@ -178,7 +178,7 @@ func (r *StorageClassWatcher) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). For(&storagev1.StorageClass{}, builder.WithPredicates(scPredicate)). Watches(&source.Kind{ - Type: &v1alpha1.FlashSystemCluster{}, + Type: &apiv1.FlashSystemCluster{}, }, handler.EnqueueRequestsFromMapFunc(scMapper.fscStorageClassMap), builder.WithPredicates(util.IgnoreUpdateAndGenericPredicate)). Watches(&source.Kind{ Type: &corev1.ConfigMap{}, @@ -332,7 +332,7 @@ func (r *StorageClassWatcher) getFscByTopologyStorageClass(sc *storagev1.Storage func (r *StorageClassWatcher) getFscByRegularStorageClass(sc *storagev1.StorageClass, storageClassSecret corev1.Secret) (map[string]string, error) { fscToPoolsMap := make(map[string]string) - clusters := &v1alpha1.FlashSystemClusterList{} + clusters := &apiv1.FlashSystemClusterList{} if err := r.Client.List(context.Background(), clusters); err != nil { r.Log.Error(nil, "failed to list FlashSystemClusterList") return fscToPoolsMap, err @@ -380,8 +380,8 @@ func (r *StorageClassWatcher) extractPoolName(sc storagev1.StorageClass, mgmtDat return poolName, nil } -func (r *StorageClassWatcher) mapClustersByMgmtId(topologySecret *corev1.Secret) (map[string]v1alpha1.FlashSystemCluster, error) { - clustersByMgmtId := make(map[string]v1alpha1.FlashSystemCluster) +func (r *StorageClassWatcher) mapClustersByMgmtId(topologySecret *corev1.Secret) (map[string]apiv1.FlashSystemCluster, error) { + clustersByMgmtId := make(map[string]apiv1.FlashSystemCluster) secretMgmtDataByMgmtId := make(map[string]interface{}) topologySecretData := string(topologySecret.Data[util.TopologySecretDataKey]) diff --git a/controllers/util/poolutil.go b/controllers/util/poolutil.go index bf8de2bf..c2e3c0ef 100644 --- a/controllers/util/poolutil.go +++ b/controllers/util/poolutil.go @@ -20,7 +20,7 @@ import ( "context" "encoding/json" "fmt" - "github.com/IBM/ibm-storage-odf-operator/api/v1" + apiv1 "github.com/IBM/ibm-storage-odf-operator/api/v1" "github.com/go-logr/logr" "io" corev1 "k8s.io/api/core/v1" @@ -268,13 +268,13 @@ func initScPoolConfigMap(ns string) *corev1.ConfigMap { return scPoolConfigMap } -func MapClustersByMgmtAddress(client client.Client, logger logr.Logger) (map[string]v1alpha1.FlashSystemCluster, error) { - clusters := &v1alpha1.FlashSystemClusterList{} +func MapClustersByMgmtAddress(client client.Client, logger logr.Logger) (map[string]apiv1.FlashSystemCluster, error) { + clusters := &apiv1.FlashSystemClusterList{} if err := client.List(context.Background(), clusters); err != nil { logger.Error(nil, "failed to list FlashSystemClusters") return nil, err } - clustersMapByMgmtAddr := make(map[string]v1alpha1.FlashSystemCluster) + clustersMapByMgmtAddr := make(map[string]apiv1.FlashSystemCluster) for _, cluster := range clusters.Items { clusterSecret := &corev1.Secret{} err := client.Get(context.Background(),