Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Service names #776

Merged

Conversation

jpodivin
Copy link
Contributor

@jpodivin jpodivin commented Mar 18, 2024

No description provided.

}
if len(executionName) > AnsibleExcecutionNameLabelLen {
executionName = executionName[:AnsibleExcecutionNameLabelLen]
}
labelValue := string(deployment.GetUID())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had continued using uid for labels to ensure that long deployment and nodeset names don't make us truncate the labels for AEE. We could have used uid for AEE names too, but we assert the names in kuttl tests (and the plan was to change those). There could be still be name collision, if the service, deployment and nodeset names are not kept small and unique.

Copy link
Contributor Author

@jpodivin jpodivin Mar 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point. Labels need to follow RFC-952, or used to, now the documentation specifies something more like RFC-1123.

There are ways to handle that though, by setting validation for nodeset, deployment, and service name. As it happens, we already have a package for that.

Edit: I knew this sounded familiar. I've introduced that validation for label myself in 13d56de but it must have gotten lost in the meantime.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added validation for nodeset, deployment and service names.

Copy link
Contributor

@rabi rabi Mar 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

k8s object names can be 253 chars. Limiting deployment/nodeset names to 63 chars would not achieve anything as we use a combination of deployment and nodeset name to build the label in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of them do, yes. But the validation here is meant to sanitize strings we'll eventually use as labels. These are limited to 63 chars.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@openshift-ci openshift-ci bot removed the lgtm label Mar 19, 2024
@morucci
Copy link

morucci commented Mar 19, 2024

recheck

2 similar comments
@morucci
Copy link

morucci commented Mar 19, 2024

recheck

@morucci
Copy link

morucci commented Mar 19, 2024

recheck

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/9d3f30d557f9492390c009c01b3b4ffc

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 45m 43s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 05m 35s
cifmw-crc-podified-edpm-baremetal FAILURE in 1h 23m 56s
✔️ dataplane-operator-docs-preview SUCCESS in 3m 17s

@jpodivin
Copy link
Contributor Author

recheck

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/e07a70ba7bf347278d7d71600d949f0a

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 34m 19s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 06m 59s
cifmw-crc-podified-edpm-baremetal FAILURE in 15m 41s
✔️ dataplane-operator-docs-preview SUCCESS in 2m 48s

@openshift-ci openshift-ci bot added the lgtm label Mar 22, 2024
@jpodivin
Copy link
Contributor Author

/retest

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/9da451d45e35475abec22b1d0e59d82d

openstack-k8s-operators-content-provider FAILURE in 7m 53s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
✔️ dataplane-operator-docs-preview SUCCESS in 2m 25s

@jpodivin
Copy link
Contributor Author

Hit by the go version mismatch error.

GetAnsibleExecutionNameAndLabel now consumes names, rather than entire specs of NodeSet
and deployment. Several labels were added, for nodeset, service and deployment.

Signed-off-by: Jiri Podivin <[email protected]>
Since we are using names of service, nodeset and deployment to create labels for
ansibleee resources we must ensure they comply with name standard[1].

Validation for nodeset name has been placed into relevant webhook, others will
follow when their respective resources have webhooks implemented.

Specifically, the label must conform to RFC1123.

[1] https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set

Signed-off-by: Jiri Podivin <[email protected]>
Copy link
Contributor

openshift-ci bot commented Mar 25, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fao89, jpodivin, slagle

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:
  • OWNERS [fao89,jpodivin,slagle]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/cc444cee4fb44318bfe3bec846ebec77

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 19m 09s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 14m 33s
cifmw-crc-podified-edpm-baremetal FAILURE in 1h 31m 46s
✔️ dataplane-operator-docs-preview SUCCESS in 2m 22s

@fao89
Copy link
Collaborator

fao89 commented Mar 25, 2024

recheck (it seems we need to bump the timeout)

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/a1c671e2ed3142b68a4a40d0108dc566

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 23m 49s
podified-multinode-edpm-deployment-crc FAILURE in 51m 35s
cifmw-crc-podified-edpm-baremetal RETRY_LIMIT in 2m 10s
✔️ dataplane-operator-docs-preview SUCCESS in 2m 15s

@fao89
Copy link
Collaborator

fao89 commented Mar 25, 2024

recheck cert_manager

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/2db91e14baca40d48e9ee898616f4d05

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 53m 10s
podified-multinode-edpm-deployment-crc FAILURE in 50m 13s
cifmw-crc-podified-edpm-baremetal FAILURE in 1h 32m 04s
✔️ dataplane-operator-docs-preview SUCCESS in 2m 13s

@jpodivin
Copy link
Contributor Author

recheck cert-manager

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/72f36dcf6e4c4cec8b86d444bfe4858c

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 04m 17s
podified-multinode-edpm-deployment-crc FAILURE in 50m 45s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 23m 12s
✔️ dataplane-operator-docs-preview SUCCESS in 3m 04s

@fao89
Copy link
Collaborator

fao89 commented Mar 27, 2024

recheck

@openshift-merge-bot openshift-merge-bot bot merged commit f6bc8fe into openstack-k8s-operators:main Mar 27, 2024
7 checks passed
if err = validate.Var(r.Name, "hostname_rfc1123"); err != nil {
openstackdataplanenodesetlog.Error(err, "Error validating OpenStackDataPlaneNodeSet name, name must follow RFC1123")
errors = append(errors, field.Invalid(
field.NewPath("Name"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general you want to return the json path of the CRD field that failed the validation. I think in this case that is field.NewPath("metadata").Child("name").

@jpodivin jpodivin deleted the service-names branch April 8, 2024 12:41
@yazug yazug mentioned this pull request Apr 18, 2024
yazug added a commit to yazug/dataplane-operator that referenced this pull request Apr 18, 2024
update default after running make bundle
change was not pulled in when the following pull request was merged
Merge pull request openstack-k8s-operators#776 from jpodivin/service-names

Signed-off-by: Jon Schlueter <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants