Skip to content

Commit

Permalink
change v1alpha1 to v1 where needed
Browse files Browse the repository at this point in the history
  • Loading branch information
shlomitn committed Sep 1, 2024
1 parent e2083a2 commit 2525983
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions api/v1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
alm-examples: |-
[
{
"apiVersion": "odf.ibm.com/v1alpha1",
"apiVersion": "odf.ibm.com/v1",
"kind": "FlashSystemCluster",
"metadata": {
"name": "flashsystemcluster-sample",
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion bundle/manifests/odf.ibm.com_flashsystemclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/odf.ibm.com_flashsystemclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion config/samples/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: odf.ibm.com/v1alpha1
apiVersion: odf.ibm.com/v1
kind: FlashSystemCluster
metadata:
name: flashsystemcluster-sample
Expand Down
4 changes: 2 additions & 2 deletions controllers/persistentvolume/persistentvolume_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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{},
Expand Down
10 changes: 5 additions & 5 deletions controllers/storageclass/storageclass_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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{},
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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])

Expand Down
8 changes: 4 additions & 4 deletions controllers/util/poolutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit 2525983

Please sign in to comment.