Skip to content

Commit 97c7bdc

Browse files
committed
Address various issues with OperatorCondition codebase
1. Update codegen to generate operatorv2 client code 2. Vendor operator-framework/api 0.9.0 3. Adopt the new changes on OperatorCondition API from api repo. 4. Update OperatorCondition v2 references across the codebase 5. Update e2e test case for OperatorCondition Signed-off-by: Vu Dinh <[email protected]>
1 parent 86eda22 commit 97c7bdc

Some content is hidden

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

51 files changed

+1824
-244
lines changed

deploy/chart/crds/0000_50_olm_00-operatorconditions.crd.yaml

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,170 @@ spec:
132132
maxLength: 316
133133
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])$
134134
served: true
135+
storage: false
136+
subresources:
137+
status: {}
138+
- name: v2
139+
schema:
140+
openAPIV3Schema:
141+
description: OperatorCondition is a Custom Resource of type `OperatorCondition` which is used to convey information to OLM about the state of an operator.
142+
type: object
143+
required:
144+
- metadata
145+
properties:
146+
apiVersion:
147+
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
148+
type: string
149+
kind:
150+
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
151+
type: string
152+
metadata:
153+
type: object
154+
spec:
155+
description: OperatorConditionSpec allows an operator to report state to OLM and provides cluster admin with the ability to manually override state reported by the operator.
156+
type: object
157+
properties:
158+
conditions:
159+
type: array
160+
items:
161+
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, 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 }"
162+
type: object
163+
required:
164+
- lastTransitionTime
165+
- message
166+
- reason
167+
- status
168+
- type
169+
properties:
170+
lastTransitionTime:
171+
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.
172+
type: string
173+
format: date-time
174+
message:
175+
description: message is a human readable message indicating details about the transition. This may be an empty string.
176+
type: string
177+
maxLength: 32768
178+
observedGeneration:
179+
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.
180+
type: integer
181+
format: int64
182+
minimum: 0
183+
reason:
184+
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.
185+
type: string
186+
maxLength: 1024
187+
minLength: 1
188+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
189+
status:
190+
description: status of the condition, one of True, False, Unknown.
191+
type: string
192+
enum:
193+
- "True"
194+
- "False"
195+
- Unknown
196+
type:
197+
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)
198+
type: string
199+
maxLength: 316
200+
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])$
201+
deployments:
202+
type: array
203+
items:
204+
type: string
205+
overrides:
206+
type: array
207+
items:
208+
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, 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 }"
209+
type: object
210+
required:
211+
- message
212+
- reason
213+
- status
214+
- type
215+
properties:
216+
lastTransitionTime:
217+
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.
218+
type: string
219+
format: date-time
220+
message:
221+
description: message is a human readable message indicating details about the transition. This may be an empty string.
222+
type: string
223+
maxLength: 32768
224+
observedGeneration:
225+
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.
226+
type: integer
227+
format: int64
228+
minimum: 0
229+
reason:
230+
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.
231+
type: string
232+
maxLength: 1024
233+
minLength: 1
234+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
235+
status:
236+
description: status of the condition, one of True, False, Unknown.
237+
type: string
238+
enum:
239+
- "True"
240+
- "False"
241+
- Unknown
242+
type:
243+
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)
244+
type: string
245+
maxLength: 316
246+
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])$
247+
serviceAccounts:
248+
type: array
249+
items:
250+
type: string
251+
status:
252+
description: OperatorConditionStatus allows OLM to convey which conditions have been observed.
253+
type: object
254+
properties:
255+
conditions:
256+
type: array
257+
items:
258+
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, 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 }"
259+
type: object
260+
required:
261+
- lastTransitionTime
262+
- message
263+
- reason
264+
- status
265+
- type
266+
properties:
267+
lastTransitionTime:
268+
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.
269+
type: string
270+
format: date-time
271+
message:
272+
description: message is a human readable message indicating details about the transition. This may be an empty string.
273+
type: string
274+
maxLength: 32768
275+
observedGeneration:
276+
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.
277+
type: integer
278+
format: int64
279+
minimum: 0
280+
reason:
281+
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.
282+
type: string
283+
maxLength: 1024
284+
minLength: 1
285+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
286+
status:
287+
description: status of the condition, one of True, False, Unknown.
288+
type: string
289+
enum:
290+
- "True"
291+
- "False"
292+
- Unknown
293+
type:
294+
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)
295+
type: string
296+
maxLength: 316
297+
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])$
298+
served: true
135299
storage: true
136300
subresources:
137301
status: {}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ require (
2626
github.com/onsi/gomega v1.10.2
2727
github.com/openshift/api v0.0.0-20200331152225-585af27e34fd
2828
github.com/openshift/client-go v0.0.0-20200326155132-2a6cd50aedd0
29-
github.com/operator-framework/api v0.6.0
29+
github.com/operator-framework/api v0.6.2
3030
github.com/operator-framework/operator-registry v1.13.6
3131
github.com/otiai10/copy v1.2.0
3232
github.com/pkg/errors v0.9.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,8 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ
769769
github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
770770
github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
771771
github.com/operator-framework/api v0.3.7-0.20200602203552-431198de9fc2/go.mod h1:Xbje9x0SHmh0nihE21kpesB38vk3cyxnE6JdDS8Jo1Q=
772-
github.com/operator-framework/api v0.6.0 h1:Ed/iyfsEfsODr3dTrVVQKRVknqyEz8CQntXU7ogP+/E=
773-
github.com/operator-framework/api v0.6.0/go.mod h1:L7IvLd/ckxJEJg/t4oTTlnHKAJIP/p51AvEslW3wYdY=
772+
github.com/operator-framework/api v0.6.2 h1:8zxKHj7kxhCxK2eLbZSjM8+OY7ypMVLfwYK8RjfRNh0=
773+
github.com/operator-framework/api v0.6.2/go.mod h1:L7IvLd/ckxJEJg/t4oTTlnHKAJIP/p51AvEslW3wYdY=
774774
github.com/operator-framework/operator-registry v1.13.6 h1:h/dIjQQS7uneQNRifrSz7h0xg4Xyjg6C9f6XZofbMPg=
775775
github.com/operator-framework/operator-registry v1.13.6/go.mod h1:YhnIzOVjRU2ZwZtzt+fjcjW8ujJaSFynBEu7QVKaSdU=
776776
github.com/otiai10/copy v1.2.0 h1:HvG945u96iNadPoG2/Ja2+AUJeW5YuFQMixq9yirC+k=

0 commit comments

Comments
 (0)