Skip to content

Commit d24a78b

Browse files
committed
add featuregate status
1 parent 42edf4f commit d24a78b

6 files changed

Lines changed: 407 additions & 2 deletions

File tree

config/v1/0000_10_config-operator_01_featuregate.crd.yaml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,92 @@ spec:
5757
status:
5858
description: status holds observed values from the cluster. They may not be overridden.
5959
type: object
60+
properties:
61+
conditions:
62+
description: 'conditions represent the observations of the current state. Known .status.conditions.type are: "DeterminationDegraded"'
63+
type: array
64+
items:
65+
description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
66+
type: object
67+
required:
68+
- lastTransitionTime
69+
- message
70+
- reason
71+
- status
72+
- type
73+
properties:
74+
lastTransitionTime:
75+
description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
76+
type: string
77+
format: date-time
78+
message:
79+
description: message is a human readable message indicating details about the transition. This may be an empty string.
80+
type: string
81+
maxLength: 32768
82+
observedGeneration:
83+
description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
84+
type: integer
85+
format: int64
86+
minimum: 0
87+
reason:
88+
description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
89+
type: string
90+
maxLength: 1024
91+
minLength: 1
92+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
93+
status:
94+
description: status of the condition, one of True, False, Unknown.
95+
type: string
96+
enum:
97+
- "True"
98+
- "False"
99+
- Unknown
100+
type:
101+
description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
102+
type: string
103+
maxLength: 316
104+
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])$
105+
x-kubernetes-list-map-keys:
106+
- type
107+
x-kubernetes-list-type: map
108+
featureGates:
109+
description: featureGates contains a list of enabled and disabled featureGates that are keyed by payloadVersion. Operators other than the CVO and cluster-config-operator, must read the .status.featureGates, locate the version they are managing, find the enabled/disabled featuregates and make the operand and operator match. The enabled/disabled values for a particular version may change during the life of the cluster as various .spec.featureSet values are selected. Operators may choose to restart their processes to pick up these changes, but remembering past enable/disable lists is beyond the scope of this API and is the responsibility of individual operators. Only featureGates with .version in the ClusterVersion.status will be present in this list.
110+
type: array
111+
items:
112+
type: object
113+
required:
114+
- version
115+
properties:
116+
disabled:
117+
description: disabled is a list of all feature gates that are disabled in the cluster for the named version
118+
type: array
119+
items:
120+
type: object
121+
required:
122+
- name
123+
properties:
124+
name:
125+
description: name is the name of the FeatureGate
126+
type: string
127+
pattern: ^([A-Za-z0-9-]+\.)*[A-Za-z0-9-]+\.?$
128+
enabled:
129+
description: enabled is a list of all feature gates that are enabled in the cluster for the named version
130+
type: array
131+
items:
132+
type: object
133+
required:
134+
- name
135+
properties:
136+
name:
137+
description: name is the name of the FeatureGate
138+
type: string
139+
pattern: ^([A-Za-z0-9-]+\.)*[A-Za-z0-9-]+\.?$
140+
version:
141+
description: version matches the version provided by the ClusterVersion and in the ClusterOperator.Status.Versions field.
142+
type: string
143+
x-kubernetes-list-map-keys:
144+
- version
145+
x-kubernetes-list-type: map
60146
served: true
61147
storage: true
62148
subresources:

config/v1/types_feature.go

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,48 @@ type CustomFeatureGates struct {
7272
}
7373

7474
type FeatureGateStatus struct {
75+
// conditions represent the observations of the current state.
76+
// Known .status.conditions.type are: "DeterminationDegraded"
77+
// +listType=map
78+
// +listMapKey=type
79+
Conditions []metav1.Condition `json:"conditions,omitempty"`
80+
81+
// featureGates contains a list of enabled and disabled featureGates that are keyed by payloadVersion.
82+
// Operators other than the CVO and cluster-config-operator, must read the .status.featureGates, locate
83+
// the version they are managing, find the enabled/disabled featuregates and make the operand and operator match.
84+
// The enabled/disabled values for a particular version may change during the life of the cluster as various
85+
// .spec.featureSet values are selected.
86+
// Operators may choose to restart their processes to pick up these changes, but remembering past enable/disable
87+
// lists is beyond the scope of this API and is the responsibility of individual operators.
88+
// Only featureGates with .version in the ClusterVersion.status will be present in this list.
89+
// +listType=map
90+
// +listMapKey=version
91+
FeatureGates []FeatureGateDetails `json:"featureGates"`
92+
}
93+
94+
type FeatureGateDetails struct {
95+
// version matches the version provided by the ClusterVersion and in the ClusterOperator.Status.Versions field.
96+
// +kubebuilder:validation:Required
97+
// +required
98+
Version string `json:"version"`
99+
// enabled is a list of all feature gates that are enabled in the cluster for the named version
100+
// +optional
101+
Enabled []FeatureGateAttributes `json:"enabled"`
102+
// disabled is a list of all feature gates that are disabled in the cluster for the named version
103+
// +optional
104+
Disabled []FeatureGateAttributes `json:"disabled"`
105+
}
106+
107+
type FeatureGateAttributes struct {
108+
// name is the name of the FeatureGate
109+
// +kubebuilder:validation:Pattern=`^([A-Za-z0-9-]+\.)*[A-Za-z0-9-]+\.?$`
110+
// +kubebuilder:validation:Required
111+
// +required
112+
Name string `json:"name"`
113+
114+
// possible (probable?) future additions include
115+
// 1. support level (Stable, ServiceDeliveryOnly, TechPreview, DevPreview)
116+
// 2. description
75117
}
76118

77119
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

config/v1/zz_generated.deepcopy.go

Lines changed: 57 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/v1/zz_generated.swagger_doc_generated.go

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

0 commit comments

Comments
 (0)