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

port label validation doesn't filter invalid characters #12347

Open
deepbluemussel opened this issue Mar 22, 2022 · 3 comments
Open

port label validation doesn't filter invalid characters #12347

deepbluemussel opened this issue Mar 22, 2022 · 3 comments
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/jobspec type/bug

Comments

@deepbluemussel
Copy link

Nomad version

Nomad v1.2.6 (a6c6b475db5073e33885377b4a5c733e1161020c)

Issue

Any character is accepted in the name parameter of the stanza network. The job is applied without syntax errors and Nomad's GUI even displays the name with special characters.

However, this should not be possible if we refer to the control here.

On the other hand, Levant applies the check correctly and raises the syntax error.

image

Expected Result

Port label does not conform to naming requirements ^[a-zA-Z0-9_]+$

Actual Result

No issue is raised. Job is applied without errors.

Job file (if appropriate)

    network {
      port "myport,#!)'8" {
         to     = 8080
       } 
    }
@tgross tgross changed the title Nomad ports label syntax requirements isn't effective. Any character is accepted. port label validation doesn't filter invalid characters Mar 23, 2022
@tgross tgross added the stage/accepted Confirmed, and intend to work on. No timeline committment though. label Mar 23, 2022
@tgross
Copy link
Member

tgross commented Mar 23, 2022

Hi @deepbluemussel. I suspect that particular regex validation may no longer be used with the move to HCL2. But that's certainly a bug to fix.

@brettplarson
Copy link
Contributor

@tgross we also are seeing this error in Levant. Can you advise on this thread as well?

hashicorp/levant#448

Additionally, in general, - We also have a large community of people waiting for an answer on this thread. Can you advise?
https://discuss.hashicorp.com/t/future-of-nomad-pack-and-levant/39929

Thank you!!!

@tgross
Copy link
Member

tgross commented Jun 9, 2022

@brettplarson my colleague James has responded on hashicorp/levant#448. The discuss thread seems to be unrelated to this issue entirely. Unfortunately I don't have an official answer for you, either. But let's try to keep issues on topic please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/jobspec type/bug
Projects
Status: Needs Roadmapping
Development

No branches or pull requests

3 participants