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

Label and Annotation key validation does not allow the "/" char, resulting in label with truncated key #12720

Open
fgiudici opened this issue Nov 29, 2024 · 9 comments
Labels
kind/bug priority/1 QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this size/2 Size Estimate 2 status/backport-candidate
Milestone

Comments

@fgiudici
Copy link
Member

Setup

  • Rancher version: v2.9.3
  • Rancher UI Extensions:
  • Browser type & version: Mozilla Firefox 132.0.1

Describe the bug
In the Registration creation component of the Elemental UI extension it is not possible to add Label and Annotation templates with keys having the "/" character.
In particular as soon as the "/" char is typed in the key field, the row disappears from the UI.
Moreover, if the resource is created, the resulting resource (looking at the yaml) will contain the templates label/annotation with the key (which will be anyway truncated with what was typed in till the UI row disappeared).
See attached video.

To Reproduce

Add a Label/Annotation with a key containing "/" (e.g., elemental.cattle.io/InternalIP).
Result
Row disappear while typing, but label is present with a truncated label key in the created resource

Expected Result

The Label and Annotation rows do not disappear from the UI when keys are valid.
The labels key validation should match the Kubernetes label keys syntax: see https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set .

Screenshots
Video:
https://github.com/user-attachments/assets/cbe1cb93-b748-4ff8-aef2-7e577ce87f62

Additional context

After checking with @aalves08, he suggested to track here the issue as the component used in the Elemental UI belongs here.

@github-actions github-actions bot added the QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this label Nov 29, 2024
@richard-cox richard-cox added this to the v2.11.0 milestone Dec 2, 2024
@richard-cox
Copy link
Member

richard-cox commented Dec 18, 2024

@richard-cox
Copy link
Member

I've noticed this on other use cases of the label and annotation component, but it's when focus is removed from the key input that the row is removed. Looking at the yaml the key is added (with empty string)

@rak-phillip
Copy link
Member

I don't think that this is directly related to #11226, but it's something to look out for; we previously modified input on every keypress in the yaml editor and we could be doing something similar here.

@richard-cox
Copy link
Member

Linking #13005 (contains example video)

@richard-cox
Copy link
Member

richard-cox commented Jan 13, 2025

When looking at this need to determine how #13070 is involved and would impact the fix

@gaktive
Copy link
Member

gaktive commented Jan 13, 2025

#10958 is also in the mix here as we see more validation bugs come in around this area.

@gaktive
Copy link
Member

gaktive commented Jan 13, 2025

Of note, PR #13071 has come up through @skanakal to help with #13070 though there may be something to leverage here. Still, as noted across multiple tickets, this area has a few bugs around it.

@gaktive
Copy link
Member

gaktive commented Jan 14, 2025

We need this to unblock #13069

@richard-cox
Copy link
Member

Linking e2e tests that's probably blocked on this #13191

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug priority/1 QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this size/2 Size Estimate 2 status/backport-candidate
Projects
None yet
Development

No branches or pull requests

5 participants