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

app.oam.dev/component label length #6475

Open
gokcesurenkok opened this issue Mar 12, 2024 Discussed in #6471 · 0 comments
Open

app.oam.dev/component label length #6475

gokcesurenkok opened this issue Mar 12, 2024 Discussed in #6471 · 0 comments

Comments

@gokcesurenkok
Copy link

Discussed in #6471

Originally posted by spootrick March 8, 2024
I have created a component that can have a user submitted name input. Sometimes it can be longer than 63 characters and I cannot block it because it is a requirement by the user.

K8s labels must not be more than 63 characters, so here is my problem:

cannot create object: custom.component "rxpy29mfqh20vblfweylcw-assume-there-is-a-super-long-name-with-over-63-characters-long-0" invalid:
metadata.labels: Invalid value: "assume-there-is-a-super-long-name-with-over-63-characters-long-0": must not be more than 63 characters

When I examined a successfully created component, I saw that the following values were created:

labels
 ...
 app.oam.dev/cluster: local
 app.oam.dev/component: component-name
 app.oam.dev/name: xxx
 app.oam.dev/namespace: project-xxx
 workload.oam.dev/type: custom-component
 ...

I noticed that the name of the custom component is written as app.oam.dev/component. It fails with the above error message because it is more than the allowed length.

cue:

"custom-component": {
	type:        "component"
	description: "..."
	labels: {}
	annotations: {}
	attributes: {}
}

template: {
	output: {
		apiVersion: "example.com/v1alpha1"
		kind:       "MyKind"
		metadata: {
			name: parameter.clusterID + "-" + context.name
		}
		spec: {
			props: {
				name:       context.name
				clusterID:  parameter.clusterID
			}
		}
	}
	parameter: {
		clusterID: string
	}
}

input:

context:
  name: assume-there-is-a-super-long-name-with-over-63-characters-long-0
  namespace: project-test
parameter:
  clusterID: rxpy29mfqh20vblfweylcw

Can you please direct me to what might be possible to resolve this issue?

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant