From 92c873a8f578c19fcb99de6a6426a02db458fa70 Mon Sep 17 00:00:00 2001 From: Shyam Radhakrishnan Date: Fri, 12 May 2023 20:44:59 +0530 Subject: [PATCH] Fix storage versions for api increment (#266) This fixes the `storage` parameters issue in the CRDs. It should be `true` for the newest version and `false` for all others. --- api/v1beta1/ocicluster_types.go | 2 -- api/v1beta2/doc.go | 17 +++++++++++++++++ api/v1beta2/ocicluster_types.go | 1 + ...astructure.cluster.x-k8s.io_ociclusters.yaml | 4 ++-- ...ucture.cluster.x-k8s.io_ocimachinepools.yaml | 4 ++-- ...ter.x-k8s.io_ocimanagedclustertemplates.yaml | 2 +- ...luster.x-k8s.io_ocimanagedcontrolplanes.yaml | 4 ++-- ...-k8s.io_ocimanagedcontrolplanetemplates.yaml | 2 +- ...x-k8s.io_ocimanagedmachinepooltemplates.yaml | 2 +- config/crd/kustomization.yaml | 3 +++ exp/api/v1beta1/ocimachinepool_types.go | 2 -- .../v1beta1/ocimanagedclustertemplate_types.go | 1 - exp/api/v1beta1/ocimanagedcontrolplane_types.go | 2 -- .../ocimanagedcontrolplanetemplate_types.go | 1 - .../ocimanagedmachinepooltemplate_types.go | 1 - exp/api/v1beta2/doc.go | 17 +++++++++++++++++ exp/api/v1beta2/ocimachinepool_types.go | 1 + exp/api/v1beta2/ocimanagedcluster_types.go | 1 + exp/api/v1beta2/ocimanagedcontrolplane_types.go | 1 + exp/api/v1beta2/ocimanagedmachinepool_types.go | 1 + 20 files changed, 51 insertions(+), 18 deletions(-) create mode 100644 api/v1beta2/doc.go create mode 100644 exp/api/v1beta2/doc.go diff --git a/api/v1beta1/ocicluster_types.go b/api/v1beta1/ocicluster_types.go index 03406f0b..a717a1dd 100644 --- a/api/v1beta1/ocicluster_types.go +++ b/api/v1beta1/ocicluster_types.go @@ -90,7 +90,6 @@ type OCIClusterStatus struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status -// +kubebuilder:storageversion // OCICluster is the Schema for the ociclusters API. type OCICluster struct { @@ -102,7 +101,6 @@ type OCICluster struct { } //+kubebuilder:object:root=true -// +kubebuilder:storageversion // OCIClusterList contains a list of OCICluster. type OCIClusterList struct { diff --git a/api/v1beta2/doc.go b/api/v1beta2/doc.go new file mode 100644 index 00000000..64c10705 --- /dev/null +++ b/api/v1beta2/doc.go @@ -0,0 +1,17 @@ +/* + Copyright (c) 2023 Oracle and/or its affiliates. + + 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 + + https://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 v1beta2 diff --git a/api/v1beta2/ocicluster_types.go b/api/v1beta2/ocicluster_types.go index d6af23b8..d2730552 100644 --- a/api/v1beta2/ocicluster_types.go +++ b/api/v1beta2/ocicluster_types.go @@ -96,6 +96,7 @@ type OCIClusterStatus struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status +// +kubebuilder:storageversion // OCICluster is the Schema for the ociclusters API. type OCICluster struct { diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ociclusters.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ociclusters.yaml index d1fb4b73..52402018 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ociclusters.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ociclusters.yaml @@ -1082,7 +1082,7 @@ spec: type: object type: object served: true - storage: true + storage: false subresources: status: {} - name: v1beta2 @@ -2265,6 +2265,6 @@ spec: type: object type: object served: true - storage: false + storage: true subresources: status: {} diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinepools.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinepools.yaml index 3b54acc0..53e2afaa 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinepools.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinepools.yaml @@ -729,7 +729,7 @@ spec: type: object type: object served: true - storage: true + storage: false subresources: status: {} - name: v1beta2 @@ -1437,6 +1437,6 @@ spec: type: object type: object served: true - storage: false + storage: true subresources: status: {} diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedclustertemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedclustertemplates.yaml index 16623642..5370e733 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedclustertemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedclustertemplates.yaml @@ -1131,7 +1131,7 @@ spec: type: object type: object served: true - storage: true + storage: false - name: v1beta2 schema: openAPIV3Schema: diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedcontrolplanes.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedcontrolplanes.yaml index 0f482df3..5882431b 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedcontrolplanes.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedcontrolplanes.yaml @@ -187,7 +187,7 @@ spec: type: object type: object served: true - storage: true + storage: false subresources: status: {} - name: v1beta2 @@ -362,6 +362,6 @@ spec: type: object type: object served: true - storage: false + storage: true subresources: status: {} diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedcontrolplanetemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedcontrolplanetemplates.yaml index 900f1623..e5cdd6b8 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedcontrolplanetemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedcontrolplanetemplates.yaml @@ -151,7 +151,7 @@ spec: type: object type: object served: true - storage: true + storage: false - name: v1beta2 schema: openAPIV3Schema: diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedmachinepooltemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedmachinepooltemplates.yaml index 54dd1d79..0448e4c1 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedmachinepooltemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedmachinepooltemplates.yaml @@ -234,7 +234,7 @@ spec: type: object type: object served: true - storage: true + storage: false - name: v1beta2 schema: openAPIV3Schema: diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index 0339f72b..b059e1e6 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -12,8 +12,11 @@ resources: - bases/infrastructure.cluster.x-k8s.io_ocimachinetemplates.yaml - bases/infrastructure.cluster.x-k8s.io_ociclustertemplates.yaml - bases/infrastructure.cluster.x-k8s.io_ocimanagedmachinepools.yaml +- bases/infrastructure.cluster.x-k8s.io_ocimanagedmachinepooltemplates.yaml - bases/infrastructure.cluster.x-k8s.io_ocimanagedcontrolplanes.yaml +- bases/infrastructure.cluster.x-k8s.io_ocimanagedcontrolplanetemplates.yaml - bases/infrastructure.cluster.x-k8s.io_ocimanagedclusters.yaml +- bases/infrastructure.cluster.x-k8s.io_ocimanagedclustertemplates.yaml - bases/infrastructure.cluster.x-k8s.io_ociclusteridentities.yaml #+kubebuilder:scaffold:crdkustomizeresource diff --git a/exp/api/v1beta1/ocimachinepool_types.go b/exp/api/v1beta1/ocimachinepool_types.go index 9a3d8326..5a0003fc 100644 --- a/exp/api/v1beta1/ocimachinepool_types.go +++ b/exp/api/v1beta1/ocimachinepool_types.go @@ -211,7 +211,6 @@ type OCIMachinePoolStatus struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status -// +kubebuilder:storageversion type OCIMachinePool struct { metav1.TypeMeta `json:",inline"` @@ -222,7 +221,6 @@ type OCIMachinePool struct { } // +kubebuilder:object:root=true -// +kubebuilder:storageversion // OCIMachinePoolList contains a list of OCIMachinePool. type OCIMachinePoolList struct { diff --git a/exp/api/v1beta1/ocimanagedclustertemplate_types.go b/exp/api/v1beta1/ocimanagedclustertemplate_types.go index bff70855..46696039 100644 --- a/exp/api/v1beta1/ocimanagedclustertemplate_types.go +++ b/exp/api/v1beta1/ocimanagedclustertemplate_types.go @@ -27,7 +27,6 @@ type OCIManagedClusterTemplateSpec struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=ocimanagedclustertemplates,scope=Namespaced,categories=cluster-api -// +kubebuilder:storageversion // OCIManagedClusterTemplate is the Schema for the ocimanagedclustertemplates API. type OCIManagedClusterTemplate struct { diff --git a/exp/api/v1beta1/ocimanagedcontrolplane_types.go b/exp/api/v1beta1/ocimanagedcontrolplane_types.go index 46283a63..aae3ee89 100644 --- a/exp/api/v1beta1/ocimanagedcontrolplane_types.go +++ b/exp/api/v1beta1/ocimanagedcontrolplane_types.go @@ -156,7 +156,6 @@ type OCIManagedControlPlaneStatus struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status -// +kubebuilder:storageversion // OCIManagedControlPlane is the Schema for the ocimanagedcontrolplane API. type OCIManagedControlPlane struct { @@ -168,7 +167,6 @@ type OCIManagedControlPlane struct { } //+kubebuilder:object:root=true -// +kubebuilder:storageversion // OCIManagedControlPlaneList contains a list of OCIManagedControlPlane. type OCIManagedControlPlaneList struct { diff --git a/exp/api/v1beta1/ocimanagedcontrolplanetemplate_types.go b/exp/api/v1beta1/ocimanagedcontrolplanetemplate_types.go index 6f56cd3e..ac2932fb 100644 --- a/exp/api/v1beta1/ocimanagedcontrolplanetemplate_types.go +++ b/exp/api/v1beta1/ocimanagedcontrolplanetemplate_types.go @@ -27,7 +27,6 @@ type OCIManagedControlPlaneTemplateSpec struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=ocimanagedcontrolplanetemplates,scope=Namespaced,categories=cluster-api -// +kubebuilder:storageversion // OCIManagedControlPlaneTemplate is the Schema for the OCIManagedControlPlaneTemplates API. type OCIManagedControlPlaneTemplate struct { diff --git a/exp/api/v1beta1/ocimanagedmachinepooltemplate_types.go b/exp/api/v1beta1/ocimanagedmachinepooltemplate_types.go index 1515fbad..42cd3a57 100644 --- a/exp/api/v1beta1/ocimanagedmachinepooltemplate_types.go +++ b/exp/api/v1beta1/ocimanagedmachinepooltemplate_types.go @@ -27,7 +27,6 @@ type OCIManagedMachinePoolTemplateSpec struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=ocimanagedmachinepooltemplates,scope=Namespaced,categories=cluster-api -// +kubebuilder:storageversion // OCIManagedMachinePoolTemplate is the Schema for the OCIManagedMachinePoolTemplates API. type OCIManagedMachinePoolTemplate struct { diff --git a/exp/api/v1beta2/doc.go b/exp/api/v1beta2/doc.go new file mode 100644 index 00000000..1913f909 --- /dev/null +++ b/exp/api/v1beta2/doc.go @@ -0,0 +1,17 @@ +/* +Copyright (c) 2023 Oracle and/or its affiliates. + +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 v1beta2 diff --git a/exp/api/v1beta2/ocimachinepool_types.go b/exp/api/v1beta2/ocimachinepool_types.go index d9789b96..22b69971 100644 --- a/exp/api/v1beta2/ocimachinepool_types.go +++ b/exp/api/v1beta2/ocimachinepool_types.go @@ -210,6 +210,7 @@ type OCIMachinePoolStatus struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status +// +kubebuilder:storageversion type OCIMachinePool struct { metav1.TypeMeta `json:",inline"` diff --git a/exp/api/v1beta2/ocimanagedcluster_types.go b/exp/api/v1beta2/ocimanagedcluster_types.go index 2a75cc2f..b10f98ba 100644 --- a/exp/api/v1beta2/ocimanagedcluster_types.go +++ b/exp/api/v1beta2/ocimanagedcluster_types.go @@ -105,6 +105,7 @@ type OCIManagedCluster struct { } //+kubebuilder:object:root=true +// +kubebuilder:storageversion // OCIManagedClusterList contains a list of OCIManagedCluster. type OCIManagedClusterList struct { diff --git a/exp/api/v1beta2/ocimanagedcontrolplane_types.go b/exp/api/v1beta2/ocimanagedcontrolplane_types.go index b5a134a7..03cffc9c 100644 --- a/exp/api/v1beta2/ocimanagedcontrolplane_types.go +++ b/exp/api/v1beta2/ocimanagedcontrolplane_types.go @@ -156,6 +156,7 @@ type OCIManagedControlPlaneStatus struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status +// +kubebuilder:storageversion // OCIManagedControlPlane is the Schema for the ocimanagedcontrolplane API. type OCIManagedControlPlane struct { diff --git a/exp/api/v1beta2/ocimanagedmachinepool_types.go b/exp/api/v1beta2/ocimanagedmachinepool_types.go index 44e89be9..f7333da4 100644 --- a/exp/api/v1beta2/ocimanagedmachinepool_types.go +++ b/exp/api/v1beta2/ocimanagedmachinepool_types.go @@ -223,6 +223,7 @@ type OCIManagedMachinePool struct { } //+kubebuilder:object:root=true +// +kubebuilder:storageversion // OCIManagedMachinePoolList contains a list of OCIManagedMachinePool. type OCIManagedMachinePoolList struct {