Skip to content

Commit

Permalink
generate redisstatus object
Browse files Browse the repository at this point in the history
Co-authored-by: Carl Hedgren <[email protected]>
Co-authored-by: Thomas Krampl <[email protected]>
Co-authored-by: Christer Edvartsen <[email protected]>
  • Loading branch information
4 people committed May 28, 2024
1 parent ec699c0 commit 8ffc5b6
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
17 changes: 9 additions & 8 deletions pkg/apis/aiven.io/v1alpha1/redis_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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"`
Expand Down
23 changes: 23 additions & 0 deletions pkg/apis/aiven.io/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8ffc5b6

Please sign in to comment.