-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[memcached] add CR name length validation #245
Conversation
Build failed (check pipeline). Post https://review.rdoproject.org/zuul/buildset/3c7f7a33788f4a9e8a2933b0cb07de37 ❌ openstack-k8s-operators-content-provider FAILURE in 12m 27s |
The memcached controller creates StatefulSet for the memcached to run. This adds a StatefulSet pod's label "controller-revision-hash": "<statefulset_name>-<hash>" to the pod. The kubernetes label is restricted under 63 char and the revision hash is an int32, 10 chars + the hyphen. With this the max name must not exceed 52 chars. Depends-On: openstack-k8s-operators/lib-common#532 Jira: https://issues.redhat.com/browse/OSPRH-8063 Signed-off-by: Martin Schuppert <[email protected]>
The memcached controller creates StatefulSet for the memcached to run. This adds a StatefulSet pod's label "controller-revision-hash": "<statefulset_name>-<hash>" to the pod. The kubernetes label is restricted under 63 char and the revision hash is an int32, 10 chars + the hyphen. With this the max name must not exceed 52 chars. Also the name of the created memcached instance must match a lowercase RFC 1123. Depends-On: openstack-k8s-operators/lib-common#532 Depends-On: openstack-k8s-operators/infra-operator#245 Jira: https://issues.redhat.com/browse/OSPRH-8063 Signed-off-by: Martin Schuppert <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me. Thanks!
unstructuredObj := &unstructured.Unstructured{Object: raw} | ||
_, err := controllerutil.CreateOrPatch( | ||
th.Ctx, th.K8sClient, unstructuredObj, func() error { return nil }) | ||
Expect(err).To(HaveOccurred()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you want to assert the message then you can use the following pattern to extract it from the error:
https://github.com/openstack-k8s-operators/nova-operator/blob/232a1f1b9ef305d2718ad728720edae03b4322d6/test/functional/validation_webhook_test.go#L125-L137
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gibizer, stuggi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
6191389
into
openstack-k8s-operators:main
The memcached controller creates StatefulSet for the memcached to run. This adds a StatefulSet pod's label "controller-revision-hash": "<statefulset_name>-<hash>" to the pod. The kubernetes label is restricted under 63 char and the revision hash is an int32, 10 chars + the hyphen. With this the max name must not exceed 52 chars. Also the name of the created memcached instance must match a lowercase RFC 1123. Depends-On: openstack-k8s-operators/lib-common#532 Depends-On: openstack-k8s-operators/infra-operator#245 Jira: https://issues.redhat.com/browse/OSPRH-8063 Signed-off-by: Martin Schuppert <[email protected]>
The memcached controller creates StatefulSet for the memcached to run. This adds a StatefulSet pod's label "controller-revision-hash": "<statefulset_name>-<hash>" to the pod. The kubernetes label is restricted under 63 char and the revision hash is an int32, 10 chars + the hyphen. With this the max name must not exceed 52 chars. Also the name of the created memcached instance must match a lowercase RFC 1123. Depends-On: openstack-k8s-operators/lib-common#532 Depends-On: openstack-k8s-operators/infra-operator#245 Jira: https://issues.redhat.com/browse/OSPRH-8063 Signed-off-by: Martin Schuppert <[email protected]>
The memcached controller creates StatefulSet for the memcached to run. This adds a StatefulSet pod's label
"controller-revision-hash": "<statefulset_name>-" to the pod. The kubernetes label is restricted under 63 char and the revision hash is an int32, 10 chars + the hyphen. With this the max name must not exceed 52 chars.
Depends-On: openstack-k8s-operators/lib-common#532
Jira: https://issues.redhat.com/browse/OSPRH-8063