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

Labels referencing resources name can be too long #541

Closed
cyriltovena opened this issue Jan 31, 2019 · 4 comments
Closed

Labels referencing resources name can be too long #541

cyriltovena opened this issue Jan 31, 2019 · 4 comments
Labels
kind/bug These are bugs.
Milestone

Comments

@cyriltovena
Copy link
Collaborator

cyriltovena commented Jan 31, 2019

In Kubernetes you can create a resource with a 253 characters long name :

By convention, the names of Kubernetes resources should be up to maximum length of 253 characters and consist of lower case alphanumeric characters, -, and ., but certain resources have more specific restrictions.

However labels and annotations values are restricted to 63 characters :

Valid label values must be 63 characters or less and must be empty or begin and end with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between.

In Agones we're setting labels value for referencing parent resources, but if a parent resource has a long name this cause errors.

References:
https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/

/cc @victor-prodan

@cyriltovena cyriltovena added the kind/bug These are bugs. label Jan 31, 2019
@aLekSer
Copy link
Collaborator

aLekSer commented Feb 15, 2019

This give an error here:

 "agones.dev/agones/pkg/fleets.(*Controller).upsertGameServerSet
	/go/src/agones.dev/agones/pkg/fleets/controller.go:258"

I am thinking of CreationValidationHandler on Create and Update the Fleet to check the Fleet Name length (and insist on no more than 63).

@markmandel
Copy link
Member

Can this now be closed, or do we need to do GameServer as well?

@aLekSer
Copy link
Collaborator

aLekSer commented Feb 25, 2019

Let me check other places were we use name in labels.
Definitely need validation of this kind in GS.

	pod.ObjectMeta.Labels[GameServerPodLabel] = gs.ObjectMeta.Name

@aLekSer
Copy link
Collaborator

aLekSer commented Feb 27, 2019

@Kuqd I think this ticket could be closed now. All names which reside in Label covered with validation functions.

@markmandel markmandel added this to the 0.9.0 milestone Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug These are bugs.
Projects
None yet
Development

No branches or pull requests

3 participants