Skip to content

Commit d7b4a91

Browse files
committed
Enable CRD descriptions except 'core'
This enables CRD descriptions for all openstack-operator CRDs except the *core* CRs including OpenStackControlplane and OpenStackVersion. The OpenStackControlplane CR is quite large with descriptions enabled and thus needs to stay disabled.
1 parent cb3fdc6 commit d7b4a91

11 files changed

+2765
-2
lines changed

Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ ENVTEST_K8S_VERSION = 1.31
6060

6161
SETUP_ENVTEST_VERSION ?= release-0.22
6262

63-
CRDDESC_OVERRIDE ?= :maxDescLen=0
63+
# CRD description settings
64+
# Disable descriptions for OpenStackControlPlane (and OpenStackVersion because it is in the same package),
65+
# enable for all others
66+
CRDDESC_CORE ?= :maxDescLen=0
67+
CRDDESC_OTHER ?=
6468

6569
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
6670
ifeq (,$(shell go env GOBIN))
@@ -135,10 +139,13 @@ help: ## Display this help.
135139

136140
# (dprince) FIXME: controller-gen crd didn't seem to like multiple paths so I didn't split it. So we can continue using kubebuilder
137141
# I did split out the rbac for both binaries so we can use separate roles
142+
# NOTE: we generate the OpenStackControlplane CR in a separate step to avoid the CRD descriptions
143+
# which increase the size greatly and may ultimately cause issues with CR upgrades
138144
.PHONY: manifests
139145
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
140146
mkdir -p config/operator/rbac && \
141-
$(CONTROLLER_GEN) crd$(CRDDESC_OVERRIDE) output:crd:artifacts:config=config/crd/bases webhook paths="./..." && \
147+
$(CONTROLLER_GEN) crd$(CRDDESC_OTHER) output:crd:artifacts:config=config/crd/bases webhook paths="./..." && \
148+
$(CONTROLLER_GEN) crd$(CRDDESC_CORE) output:crd:artifacts:config=config/crd/bases paths="./api/core/..." && \
142149
$(CONTROLLER_GEN) rbac:roleName=manager-role paths="{./api/client/...,./api/core/...,./api/dataplane/...,./internal/controller/client/...,./internal/controller/core/...,./internal/controller/dataplane/...,./internal/...}" output:dir=config/rbac && \
143150
$(CONTROLLER_GEN) rbac:roleName=operator-role paths="./internal/controller/operator/..." paths="./api/operator/..." output:dir=config/operator/rbac && \
144151
rm -f api/bases/* && cp -a config/crd/bases api/

api/bases/client.openstack.org_openstackclients.yaml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,75 +29,144 @@ spec:
2929
name: v1beta1
3030
schema:
3131
openAPIV3Schema:
32+
description: OpenStackClient is the Schema for the openstackclients API
3233
properties:
3334
apiVersion:
35+
description: |-
36+
APIVersion defines the versioned schema of this representation of an object.
37+
Servers should convert recognized schemas to the latest internal value, and
38+
may reject unrecognized values.
39+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
3440
type: string
3541
kind:
42+
description: |-
43+
Kind is a string value representing the REST resource this object represents.
44+
Servers may infer this from the endpoint the client submits requests to.
45+
Cannot be updated.
46+
In CamelCase.
47+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
3648
type: string
3749
metadata:
3850
type: object
3951
spec:
52+
description: OpenStackClientSpec defines the desired state of OpenStackClient
4053
properties:
4154
caBundleSecretName:
55+
description: CaBundleSecretName - holding the CA certs in a pre-created
56+
bundle file
4257
type: string
4358
containerImage:
59+
description: ContainerImage for the OpenstackClient container (will
60+
be set to environmental default if empty)
4461
type: string
4562
env:
63+
description: List of environment variables to set in the container.
4664
items:
65+
description: EnvVar represents an environment variable present in
66+
a Container.
4767
properties:
4868
name:
69+
description: Name of the environment variable. Must be a C_IDENTIFIER.
4970
type: string
5071
value:
72+
description: |-
73+
Variable references $(VAR_NAME) are expanded
74+
using the previously defined environment variables in the container and
75+
any service environment variables. If a variable cannot be resolved,
76+
the reference in the input string will be unchanged. Double $$ are reduced
77+
to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
78+
"$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
79+
Escaped references will never be expanded, regardless of whether the variable
80+
exists or not.
81+
Defaults to "".
5182
type: string
5283
valueFrom:
84+
description: Source for the environment variable's value. Cannot
85+
be used if value is not empty.
5386
properties:
5487
configMapKeyRef:
88+
description: Selects a key of a ConfigMap.
5589
properties:
5690
key:
91+
description: The key to select.
5792
type: string
5893
name:
5994
default: ""
95+
description: |-
96+
Name of the referent.
97+
This field is effectively required, but due to backwards compatibility is
98+
allowed to be empty. Instances of this type with an empty value here are
99+
almost certainly wrong.
100+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
60101
type: string
61102
optional:
103+
description: Specify whether the ConfigMap or its key
104+
must be defined
62105
type: boolean
63106
required:
64107
- key
65108
type: object
66109
x-kubernetes-map-type: atomic
67110
fieldRef:
111+
description: |-
112+
Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
113+
spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
68114
properties:
69115
apiVersion:
116+
description: Version of the schema the FieldPath is
117+
written in terms of, defaults to "v1".
70118
type: string
71119
fieldPath:
120+
description: Path of the field to select in the specified
121+
API version.
72122
type: string
73123
required:
74124
- fieldPath
75125
type: object
76126
x-kubernetes-map-type: atomic
77127
resourceFieldRef:
128+
description: |-
129+
Selects a resource of the container: only resources limits and requests
130+
(limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
78131
properties:
79132
containerName:
133+
description: 'Container name: required for volumes,
134+
optional for env vars'
80135
type: string
81136
divisor:
82137
anyOf:
83138
- type: integer
84139
- type: string
140+
description: Specifies the output format of the exposed
141+
resources, defaults to "1"
85142
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
86143
x-kubernetes-int-or-string: true
87144
resource:
145+
description: 'Required: resource to select'
88146
type: string
89147
required:
90148
- resource
91149
type: object
92150
x-kubernetes-map-type: atomic
93151
secretKeyRef:
152+
description: Selects a key of a secret in the pod's namespace
94153
properties:
95154
key:
155+
description: The key of the secret to select from. Must
156+
be a valid secret key.
96157
type: string
97158
name:
98159
default: ""
160+
description: |-
161+
Name of the referent.
162+
This field is effectively required, but due to backwards compatibility is
163+
allowed to be empty. Instances of this type with an empty value here are
164+
almost certainly wrong.
165+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
99166
type: string
100167
optional:
168+
description: Specify whether the Secret or its key must
169+
be defined
101170
type: boolean
102171
required:
103172
- key
@@ -114,35 +183,61 @@ spec:
114183
nodeSelector:
115184
additionalProperties:
116185
type: string
186+
description: NodeSelector to target subset of worker nodes
117187
type: object
118188
openStackConfigMap:
119189
default: openstack-config
190+
description: OpenStackConfigMap is the name of the ConfigMap containing
191+
the clouds.yaml
120192
type: string
121193
openStackConfigSecret:
122194
default: openstack-config-secret
195+
description: OpenStackConfigSecret is the name of the Secret containing
196+
the secure.yaml
123197
type: string
124198
required:
125199
- containerImage
126200
- openStackConfigMap
127201
- openStackConfigSecret
128202
type: object
129203
status:
204+
description: OpenStackClientStatus defines the observed state of OpenStackClient
130205
properties:
131206
conditions:
207+
description: Conditions
132208
items:
209+
description: Condition defines an observation of a API resource
210+
operational state.
133211
properties:
134212
lastTransitionTime:
213+
description: |-
214+
Last time the condition transitioned from one status to another.
215+
This should be when the underlying condition changed. If that is not known, then using the time when
216+
the API field changed is acceptable.
135217
format: date-time
136218
type: string
137219
message:
220+
description: A human readable message indicating details about
221+
the transition.
138222
type: string
139223
reason:
224+
description: The reason for the condition's last transition
225+
in CamelCase.
140226
type: string
141227
severity:
228+
description: |-
229+
Severity provides a classification of Reason code, so the current situation is immediately
230+
understandable and could act accordingly.
231+
It is meant for situations where Status=False and it should be indicated if it is just
232+
informational, warning (next reconciliation might fix it) or an error (e.g. DB create issue
233+
and no actions to automatically resolve the issue can/should be done).
234+
For conditions where Status=Unknown or Status=True the Severity should be SeverityNone.
142235
type: string
143236
status:
237+
description: Status of the condition, one of True, False, Unknown.
144238
type: string
145239
type:
240+
description: Type of condition in CamelCase.
146241
type: string
147242
required:
148243
- lastTransitionTime
@@ -153,11 +248,15 @@ spec:
153248
hash:
154249
additionalProperties:
155250
type: string
251+
description: Map of hashes to track e.g. pod spec
156252
type: object
157253
observedGeneration:
254+
description: ObservedGeneration - the most recent generation observed
255+
for this object.
158256
format: int64
159257
type: integer
160258
podName:
259+
description: PodName
161260
type: string
162261
type: object
163262
type: object

0 commit comments

Comments
 (0)