Skip to content

Commit

Permalink
feat: make SubNamespace compatible with kstatus
Browse files Browse the repository at this point in the history
  • Loading branch information
erikgb committed Oct 27, 2023
1 parent 7fc21ce commit 47213ab
Show file tree
Hide file tree
Showing 4 changed files with 157 additions and 14 deletions.
17 changes: 11 additions & 6 deletions api/v2alpha1/subnamespace_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ import (
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// SubNamespaceStatus defines the observed state of SubNamespace
// +kubebuilder:validation:Enum=ok;conflict
type SubNamespaceStatus string
type SubNamespaceStatus struct {
// The generation observed by the object controller.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`

const (
SubNamespaceOK = SubNamespaceStatus("ok")
SubNamespaceConflict = SubNamespaceStatus("conflict")
)
// Conditions represent the latest available observations of an object's state
// +listType=map
// +listMapKey=type
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
}

// SubNamespaceSpec defines the desired state of SubNamespace
type SubNamespaceSpec struct {
Expand All @@ -30,6 +34,7 @@ type SubNamespaceSpec struct {
// Keeping this version un-served for now
//+kubebuilder:unservedversion
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status

// SubNamespace is the Schema for the subnamespaces API
type SubNamespace struct {
Expand Down
24 changes: 24 additions & 0 deletions api/v2alpha1/zz_generated.deepcopy.go

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

59 changes: 55 additions & 4 deletions charts/accurate/crds/accurate.cybozu.com_subnamespaces.yaml

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

71 changes: 67 additions & 4 deletions config/crd/bases/accurate.cybozu.com_subnamespaces.yaml

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

0 comments on commit 47213ab

Please sign in to comment.