Skip to content

Commit 1dbc0ed

Browse files
"(go/v4): Add status conditions by default. Adapt samples genaration accordingly"
1 parent 574a3da commit 1dbc0ed

File tree

73 files changed

+3513
-133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+3513
-133
lines changed

docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_types.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,23 @@ type CronJobStatus struct {
151151
// lastScheduleTime defines when was the last time the job was successfully scheduled.
152152
// +optional
153153
LastScheduleTime *metav1.Time `json:"lastScheduleTime,omitempty"`
154+
155+
// For Kubernetes API conventions, see:
156+
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties
157+
158+
// conditions represent the current state of the CronJob resource.
159+
// Each condition has a unique type and reflects the status of a specific aspect of the resource.
160+
//
161+
// Standard condition types include:
162+
// - "Available": the resource is fully functional
163+
// - "Progressing": the resource is being created or updated
164+
// - "Degraded": the resource failed to reach or maintain its desired state
165+
//
166+
// The status of each condition is one of True, False, or Unknown.
167+
// +listType=map
168+
// +listMapKey=type
169+
// +optional
170+
Conditions []metav1.Condition `json:"conditions,omitempty"`
154171
}
155172

156173
/*

docs/book/src/cronjob-tutorial/testdata/project/api/v1/zz_generated.deepcopy.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/book/src/cronjob-tutorial/testdata/project/config/crd/bases/batch.tutorial.kubebuilder.io_cronjobs.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3836,6 +3836,45 @@ spec:
38363836
type: object
38373837
x-kubernetes-map-type: atomic
38383838
type: array
3839+
conditions:
3840+
items:
3841+
properties:
3842+
lastTransitionTime:
3843+
format: date-time
3844+
type: string
3845+
message:
3846+
maxLength: 32768
3847+
type: string
3848+
observedGeneration:
3849+
format: int64
3850+
minimum: 0
3851+
type: integer
3852+
reason:
3853+
maxLength: 1024
3854+
minLength: 1
3855+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
3856+
type: string
3857+
status:
3858+
enum:
3859+
- "True"
3860+
- "False"
3861+
- Unknown
3862+
type: string
3863+
type:
3864+
maxLength: 316
3865+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
3866+
type: string
3867+
required:
3868+
- lastTransitionTime
3869+
- message
3870+
- reason
3871+
- status
3872+
- type
3873+
type: object
3874+
type: array
3875+
x-kubernetes-list-map-keys:
3876+
- type
3877+
x-kubernetes-list-type: map
38393878
lastScheduleTime:
38403879
format: date-time
38413880
type: string

docs/book/src/cronjob-tutorial/testdata/project/dist/chart/templates/crd/batch.tutorial.kubebuilder.io_cronjobs.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3842,6 +3842,45 @@ spec:
38423842
type: object
38433843
x-kubernetes-map-type: atomic
38443844
type: array
3845+
conditions:
3846+
items:
3847+
properties:
3848+
lastTransitionTime:
3849+
format: date-time
3850+
type: string
3851+
message:
3852+
maxLength: 32768
3853+
type: string
3854+
observedGeneration:
3855+
format: int64
3856+
minimum: 0
3857+
type: integer
3858+
reason:
3859+
maxLength: 1024
3860+
minLength: 1
3861+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
3862+
type: string
3863+
status:
3864+
enum:
3865+
- "True"
3866+
- "False"
3867+
- Unknown
3868+
type: string
3869+
type:
3870+
maxLength: 316
3871+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
3872+
type: string
3873+
required:
3874+
- lastTransitionTime
3875+
- message
3876+
- reason
3877+
- status
3878+
- type
3879+
type: object
3880+
type: array
3881+
x-kubernetes-list-map-keys:
3882+
- type
3883+
x-kubernetes-list-type: map
38453884
lastScheduleTime:
38463885
format: date-time
38473886
type: string

docs/book/src/cronjob-tutorial/testdata/project/dist/install.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3844,6 +3844,45 @@ spec:
38443844
type: object
38453845
x-kubernetes-map-type: atomic
38463846
type: array
3847+
conditions:
3848+
items:
3849+
properties:
3850+
lastTransitionTime:
3851+
format: date-time
3852+
type: string
3853+
message:
3854+
maxLength: 32768
3855+
type: string
3856+
observedGeneration:
3857+
format: int64
3858+
minimum: 0
3859+
type: integer
3860+
reason:
3861+
maxLength: 1024
3862+
minLength: 1
3863+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
3864+
type: string
3865+
status:
3866+
enum:
3867+
- "True"
3868+
- "False"
3869+
- Unknown
3870+
type: string
3871+
type:
3872+
maxLength: 316
3873+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
3874+
type: string
3875+
required:
3876+
- lastTransitionTime
3877+
- message
3878+
- reason
3879+
- status
3880+
- type
3881+
type: object
3882+
type: array
3883+
x-kubernetes-list-map-keys:
3884+
- type
3885+
x-kubernetes-list-type: map
38473886
lastScheduleTime:
38483887
format: date-time
38493888
type: string

docs/book/src/getting-started/testdata/project/api/v1alpha1/memcached_types.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,24 @@ type MemcachedSpec struct {
4545

4646
// MemcachedStatus defines the observed state of Memcached.
4747
type MemcachedStatus struct {
48+
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
49+
// Important: Run "make" to regenerate code after modifying this file
50+
4851
// For Kubernetes API conventions, see:
4952
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties
5053

5154
// conditions represent the current state of the Memcached resource.
5255
// Each condition has a unique type and reflects the status of a specific aspect of the resource.
5356
//
5457
// Standard condition types include:
55-
// - "Available": the resource is fully functional.
56-
// - "Progressing": the resource is being created or updated.
57-
// - "Degraded": the resource failed to reach or maintain its desired state.
58+
// - "Available": the resource is fully functional
59+
// - "Progressing": the resource is being created or updated
60+
// - "Degraded": the resource failed to reach or maintain its desired state
5861
//
5962
// The status of each condition is one of True, False, or Unknown.
6063
// +listType=map
6164
// +listMapKey=type
65+
// +optional
6266
Conditions []metav1.Condition `json:"conditions,omitempty"`
6367
}
6468

docs/book/src/getting-started/testdata/project/config/crd/bases/cache.example.com_memcacheds.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ spec:
5858
Each condition has a unique type and reflects the status of a specific aspect of the resource.
5959
6060
Standard condition types include:
61-
- "Available": the resource is fully functional.
62-
- "Progressing": the resource is being created or updated.
63-
- "Degraded": the resource failed to reach or maintain its desired state.
61+
- "Available": the resource is fully functional
62+
- "Progressing": the resource is being created or updated
63+
- "Degraded": the resource failed to reach or maintain its desired state
6464
6565
The status of each condition is one of True, False, or Unknown.
6666
items:

docs/book/src/getting-started/testdata/project/dist/chart/templates/crd/cache.example.com_memcacheds.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ spec:
6464
Each condition has a unique type and reflects the status of a specific aspect of the resource.
6565
6666
Standard condition types include:
67-
- "Available": the resource is fully functional.
68-
- "Progressing": the resource is being created or updated.
69-
- "Degraded": the resource failed to reach or maintain its desired state.
67+
- "Available": the resource is fully functional
68+
- "Progressing": the resource is being created or updated
69+
- "Degraded": the resource failed to reach or maintain its desired state
7070
7171
The status of each condition is one of True, False, or Unknown.
7272
items:

docs/book/src/getting-started/testdata/project/dist/install.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ spec:
6666
Each condition has a unique type and reflects the status of a specific aspect of the resource.
6767
6868
Standard condition types include:
69-
- "Available": the resource is fully functional.
70-
- "Progressing": the resource is being created or updated.
71-
- "Degraded": the resource failed to reach or maintain its desired state.
69+
- "Available": the resource is fully functional
70+
- "Progressing": the resource is being created or updated
71+
- "Degraded": the resource failed to reach or maintain its desired state
7272
7373
The status of each condition is one of True, False, or Unknown.
7474
items:

docs/book/src/multiversion-tutorial/testdata/project/api/v1/cronjob_types.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,23 @@ type CronJobStatus struct {
107107
// lastScheduleTime defines when was the last time the job was successfully scheduled.
108108
// +optional
109109
LastScheduleTime *metav1.Time `json:"lastScheduleTime,omitempty"`
110+
111+
// For Kubernetes API conventions, see:
112+
// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties
113+
114+
// conditions represent the current state of the CronJob resource.
115+
// Each condition has a unique type and reflects the status of a specific aspect of the resource.
116+
//
117+
// Standard condition types include:
118+
// - "Available": the resource is fully functional
119+
// - "Progressing": the resource is being created or updated
120+
// - "Degraded": the resource failed to reach or maintain its desired state
121+
//
122+
// The status of each condition is one of True, False, or Unknown.
123+
// +listType=map
124+
// +listMapKey=type
125+
// +optional
126+
Conditions []metav1.Condition `json:"conditions,omitempty"`
110127
}
111128

112129
// +kubebuilder:docs-gen:collapse=old stuff

0 commit comments

Comments
 (0)