diff --git a/Makefile b/Makefile index 1c5a523..fc2816e 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ CONTROLLER_GEN ?= go run sigs.k8s.io/controller-tools/cmd/controller-gen test: go test ./... -count=1 -all: mocks test generate doc +all: generate mocks test doc # Generate code generate: diff --git a/pkg/apis/aiven.io/v1alpha1/redis_types.go b/pkg/apis/aiven.io/v1alpha1/redis_types.go index 9cd77a8..ee0ff46 100644 --- a/pkg/apis/aiven.io/v1alpha1/redis_types.go +++ b/pkg/apis/aiven.io/v1alpha1/redis_types.go @@ -9,11 +9,20 @@ func init() { &Redis{}, &RedisList{}, ) } +// +kubebuilder:object:generate=true +type RedisStatus struct { + // Conditions represent the latest available observations of a service state + Conditions []metav1.Condition `json:"conditions,omitempty"` + + // Service state + State string `json:"state,omitempty"` +} // Types defined here because importing them directly from aiven-operator introduces dependency resolution hell // Copied and simplified types as of v0.12.0 // +kubebuilder:object:root=true +// +kubebuilder:subresource:status type Redis struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -25,14 +34,6 @@ type RedisSpec struct { ServiceCommonSpec } -type RedisStatus struct { - // Conditions represent the latest available observations of a service state - Conditions []metav1.Condition `json:"conditions,omitempty"` - - // Service state - State string `json:"state,omitempty"` -} - // +kubebuilder:object:root=true type RedisList struct { metav1.TypeMeta `json:",inline"` diff --git a/pkg/apis/aiven.io/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/aiven.io/v1alpha1/zz_generated.deepcopy.go index bf53503..9c5c552 100644 --- a/pkg/apis/aiven.io/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/aiven.io/v1alpha1/zz_generated.deepcopy.go @@ -5,6 +5,7 @@ package aiven_io_v1alpha1 import ( + "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -125,3 +126,25 @@ func (in *RedisList) DeepCopyObject() runtime.Object { } return nil } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RedisStatus) DeepCopyInto(out *RedisStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisStatus. +func (in *RedisStatus) DeepCopy() *RedisStatus { + if in == nil { + return nil + } + out := new(RedisStatus) + in.DeepCopyInto(out) + return out +}