diff --git a/Makefile b/Makefile index 9a4c9409..f85f09ac 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # Image URL to use all building/pushing image targets IMG ?= controller:latest # Produce CRDs that work back to Kubernetes 1.11 (no version conversion) -CRD_OPTIONS ?= "crd:trivialVersions=false" +CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false" CONTROLLER_NAMESPACE ?= lagoon-builddeploy diff --git a/apis/lagoon/v1beta1/lagoonbuild_types.go b/apis/lagoon/v1beta1/lagoonbuild_types.go index c901ef22..ed3aa281 100644 --- a/apis/lagoon/v1beta1/lagoonbuild_types.go +++ b/apis/lagoon/v1beta1/lagoonbuild_types.go @@ -22,6 +22,28 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// +kubebuilder:object:root=true +// +kubebuilder:deprecatedversion:warning="use lagoonbuilds.crd.lagoon.sh/v1beta2" + +// LagoonBuild is the Schema for the lagoonbuilds API +type LagoonBuild struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec LagoonBuildSpec `json:"spec,omitempty"` + Status LagoonBuildStatus `json:"status,omitempty"` + StatusMessages *LagoonStatusMessages `json:"statusMessages,omitempty"` +} + +// +kubebuilder:object:root=true + +// LagoonBuildList contains a list of LagoonBuild +type LagoonBuildList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []LagoonBuild `json:"items"` +} + // BuildStatusType const for the status type type BuildStatusType string @@ -83,27 +105,6 @@ type LagoonBuildConditions struct { // Condition string `json:"condition"` } -// +kubebuilder:object:root=true - -// LagoonBuild is the Schema for the lagoonbuilds API -type LagoonBuild struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec LagoonBuildSpec `json:"spec,omitempty"` - Status LagoonBuildStatus `json:"status,omitempty"` - StatusMessages *LagoonStatusMessages `json:"statusMessages,omitempty"` -} - -// +kubebuilder:object:root=true - -// LagoonBuildList contains a list of LagoonBuild -type LagoonBuildList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []LagoonBuild `json:"items"` -} - func init() { SchemeBuilder.Register(&LagoonBuild{}, &LagoonBuildList{}) } diff --git a/apis/lagoon/v1beta1/lagoontask_types.go b/apis/lagoon/v1beta1/lagoontask_types.go index bb48276d..20393163 100644 --- a/apis/lagoon/v1beta1/lagoontask_types.go +++ b/apis/lagoon/v1beta1/lagoontask_types.go @@ -30,6 +30,28 @@ import ( // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. +// +kubebuilder:object:root=true +// +kubebuilder:deprecatedversion:warning="use lagoontasks.crd.lagoon.sh/v1beta2" + +// LagoonTask is the Schema for the lagoontasks API +type LagoonTask struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec LagoonTaskSpec `json:"spec,omitempty"` + Status LagoonTaskStatus `json:"status,omitempty"` + StatusMessages *LagoonStatusMessages `json:"statusMessages,omitempty"` +} + +// +kubebuilder:object:root=true + +// LagoonTaskList contains a list of LagoonTask +type LagoonTaskList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []LagoonTask `json:"items"` +} + // TaskStatusType const for the status type type TaskStatusType string @@ -152,27 +174,6 @@ type LagoonTaskConditions struct { // Condition string `json:"condition"` } -// +kubebuilder:object:root=true - -// LagoonTask is the Schema for the lagoontasks API -type LagoonTask struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec LagoonTaskSpec `json:"spec,omitempty"` - Status LagoonTaskStatus `json:"status,omitempty"` - StatusMessages *LagoonStatusMessages `json:"statusMessages,omitempty"` -} - -// +kubebuilder:object:root=true - -// LagoonTaskList contains a list of LagoonTask -type LagoonTaskList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []LagoonTask `json:"items"` -} - func init() { SchemeBuilder.Register(&LagoonTask{}, &LagoonTaskList{}) } diff --git a/apis/lagoon/v1beta2/lagoonbuild_types.go b/apis/lagoon/v1beta2/lagoonbuild_types.go index 6db883a6..fcbcc7b5 100644 --- a/apis/lagoon/v1beta2/lagoonbuild_types.go +++ b/apis/lagoon/v1beta2/lagoonbuild_types.go @@ -22,6 +22,27 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// +kubebuilder:object:root=true +//+kubebuilder:storageversion + +// LagoonBuild is the Schema for the lagoonbuilds API +type LagoonBuild struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec LagoonBuildSpec `json:"spec,omitempty"` + Status LagoonBuildStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// LagoonBuildList contains a list of LagoonBuild +type LagoonBuildList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []LagoonBuild `json:"items"` +} + // BuildStatusType const for the status type type BuildStatusType string @@ -52,8 +73,6 @@ func (b BuildStatusType) ToLower() string { // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. -//+kubebuilder:subresource:status - // LagoonBuildSpec defines the desired state of LagoonBuild type LagoonBuildSpec struct { // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster @@ -83,26 +102,6 @@ type LagoonBuildConditions struct { // Condition string `json:"condition"` } -// +kubebuilder:object:root=true - -// LagoonBuild is the Schema for the lagoonbuilds API -type LagoonBuild struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec LagoonBuildSpec `json:"spec,omitempty"` - Status LagoonBuildStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// LagoonBuildList contains a list of LagoonBuild -type LagoonBuildList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []LagoonBuild `json:"items"` -} - func init() { SchemeBuilder.Register(&LagoonBuild{}, &LagoonBuildList{}) } diff --git a/apis/lagoon/v1beta2/lagoontask_types.go b/apis/lagoon/v1beta2/lagoontask_types.go index 19e45ebc..cc1d18a2 100644 --- a/apis/lagoon/v1beta2/lagoontask_types.go +++ b/apis/lagoon/v1beta2/lagoontask_types.go @@ -30,6 +30,27 @@ import ( // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. +// +kubebuilder:object:root=true +//+kubebuilder:storageversion + +// LagoonTask is the Schema for the lagoontasks API +type LagoonTask struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec LagoonTaskSpec `json:"spec,omitempty"` + Status LagoonTaskStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// LagoonTaskList contains a list of LagoonTask +type LagoonTaskList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []LagoonTask `json:"items"` +} + // TaskStatusType const for the status type type TaskStatusType string @@ -140,26 +161,6 @@ type LagoonTaskConditions struct { // Condition string `json:"condition"` } -// +kubebuilder:object:root=true - -// LagoonTask is the Schema for the lagoontasks API -type LagoonTask struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec LagoonTaskSpec `json:"spec,omitempty"` - Status LagoonTaskStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// LagoonTaskList contains a list of LagoonTask -type LagoonTaskList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []LagoonTask `json:"items"` -} - func init() { SchemeBuilder.Register(&LagoonTask{}, &LagoonTaskList{}) } diff --git a/config/crd/bases/crd.lagoon.sh_lagoonbuilds.yaml b/config/crd/bases/crd.lagoon.sh_lagoonbuilds.yaml index 9337223b..4d8db47c 100644 --- a/config/crd/bases/crd.lagoon.sh_lagoonbuilds.yaml +++ b/config/crd/bases/crd.lagoon.sh_lagoonbuilds.yaml @@ -16,7 +16,9 @@ spec: singular: lagoonbuild scope: Namespaced versions: - - name: v1beta1 + - deprecated: true + deprecationWarning: use lagoonbuilds.crd.lagoon.sh/v1beta2 + name: v1beta1 schema: openAPIV3Schema: description: LagoonBuild is the Schema for the lagoonbuilds API @@ -762,7 +764,7 @@ spec: type: object type: object served: true - storage: false + storage: true status: acceptedNames: kind: "" diff --git a/config/crd/bases/crd.lagoon.sh_lagoontasks.yaml b/config/crd/bases/crd.lagoon.sh_lagoontasks.yaml index 82cc0acb..0f88b0bd 100644 --- a/config/crd/bases/crd.lagoon.sh_lagoontasks.yaml +++ b/config/crd/bases/crd.lagoon.sh_lagoontasks.yaml @@ -16,7 +16,9 @@ spec: singular: lagoontask scope: Namespaced versions: - - name: v1beta1 + - deprecated: true + deprecationWarning: use lagoontasks.crd.lagoon.sh/v1beta2 + name: v1beta1 schema: openAPIV3Schema: description: LagoonTask is the Schema for the lagoontasks API @@ -726,7 +728,7 @@ spec: type: object type: object served: true - storage: false + storage: true status: acceptedNames: kind: ""