Skip to content

Commit

Permalink
chore: add storageversion
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed Jan 9, 2024
1 parent 0c44796 commit f1c9e9c
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 89 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
43 changes: 22 additions & 21 deletions apis/lagoon/v1beta1/lagoonbuild_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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{})
}
Expand Down
43 changes: 22 additions & 21 deletions apis/lagoon/v1beta1/lagoontask_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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{})
}
Expand Down
43 changes: 21 additions & 22 deletions apis/lagoon/v1beta2/lagoonbuild_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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{})
}
Expand Down
41 changes: 21 additions & 20 deletions apis/lagoon/v1beta2/lagoontask_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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{})
}
Expand Down
6 changes: 4 additions & 2 deletions config/crd/bases/crd.lagoon.sh_lagoonbuilds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -762,7 +764,7 @@ spec:
type: object
type: object
served: true
storage: false
storage: true
status:
acceptedNames:
kind: ""
Expand Down
6 changes: 4 additions & 2 deletions config/crd/bases/crd.lagoon.sh_lagoontasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -726,7 +728,7 @@ spec:
type: object
type: object
served: true
storage: false
storage: true
status:
acceptedNames:
kind: ""
Expand Down

0 comments on commit f1c9e9c

Please sign in to comment.