Skip to content
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

Object Names and IDs - Add section for qualified names #47869

Open
juliusl opened this issue Sep 10, 2024 · 8 comments
Open

Object Names and IDs - Add section for qualified names #47869

juliusl opened this issue Sep 10, 2024 · 8 comments
Labels
language/en Issues or PRs related to English language needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/docs Categorizes an issue or PR as relevant to SIG Docs.

Comments

@juliusl
Copy link

juliusl commented Sep 10, 2024

I was having a really rough time trying to figure out where the rules were defined for the type property of a PodCondition. I know underscores are allowed but I didn't find a rule in this part of the docs that mention that _ is allowed.

Turns out this is the code that validates that property,

https://github.com/kubernetes/kubernetes/blob/abc056843c030ead11551e13171a4447701db24e/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L42

(via https://github.com/kubernetes/kubernetes/blob/abc056843c030ead11551e13171a4447701db24e/pkg/apis/core/validation/validation.go#L5390)

Which has a really nice explanation of what a qualified name is right above it,

const qnameCharFmt string = "[A-Za-z0-9]"
const qnameExtCharFmt string = "[-A-Za-z0-9_.]"
const qualifiedNameFmt string = "(" + qnameCharFmt + qnameExtCharFmt + "*)?" + qnameCharFmt
const qualifiedNameErrMsg string = "must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character"
const qualifiedNameMaxLength int = 63

var qualifiedNameRegexp = regexp.MustCompile("^" + qualifiedNameFmt + "$")

It would be great if this information was included in this particular doc.

@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

SIG Docs takes a lead on issue triage for this website, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Sep 10, 2024
@tamilselvan1102
Copy link
Contributor

@tamilselvan1102
Copy link
Contributor

/language en

@k8s-ci-robot k8s-ci-robot added the language/en Issues or PRs related to English language label Sep 10, 2024
@tamilselvan1102
Copy link
Contributor

/sig docs

@k8s-ci-robot k8s-ci-robot added the sig/docs Categorizes an issue or PR as relevant to SIG Docs. label Sep 10, 2024
@sftim
Copy link
Contributor

sftim commented Sep 13, 2024

I think we should document this, but it belongs elsewhere. https://kubernetes.io/docs/concepts/overview/working-with-objects/names/ is about the name and uid fields within object metadata only. This issue is about object status.

@juliusl
Copy link
Author

juliusl commented Sep 13, 2024

@sftim is the "qualified name" used elsewhere? Or is it specific to object status type naming? If the latter I agree but if the former, it might be beneficial to stick it in this section.

@tengqm
Copy link
Contributor

tengqm commented Sep 14, 2024

I cannot think of a better location for this concept.

@sftim
Copy link
Contributor

sftim commented Sep 14, 2024

I'd put the explanation in https://kubernetes.io/docs/reference/glossary/ and transclude (eg {{< glossary_definition prepend="Kubernetes also has a concept of a qualified name, which is" term_id="qualified-name" >}})) it into the Object Names and IDs page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language/en Issues or PRs related to English language needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/docs Categorizes an issue or PR as relevant to SIG Docs.
Projects
None yet
Development

No branches or pull requests

5 participants