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

Keys with hyphens support #681

Closed
ghpu opened this issue Aug 23, 2023 · 2 comments
Closed

Keys with hyphens support #681

ghpu opened this issue Aug 23, 2023 · 2 comments

Comments

@ghpu
Copy link

ghpu commented Aug 23, 2023

Bug Report

Kubernetes uses hyphens in some of their property names. For instance "ephemeral-storage" limits.

But KCL grammar states that NAME cannot contain hyphens :
NAME: /$?[a-zA-Z_]\w*/

4. What is your KCL components version?

Version: 0.5.4-20ab3eb4b9179219d6837a57f5d35286
Platform: x86_64-unknown-linux-gnu
GitCommit: VERGEN_IDEMPOTENT_OUTPUT

@Peefy
Copy link
Contributor

Peefy commented Aug 23, 2023

@ghpu Hi there. Thank you for your feedback. We can use string expressions. For example:

requests = {
    cpu = "1"
    memory = "1Gi"
    "ephemeral-storage" = "1Gi"
}

The output YAML is

requests:
  cpu: '1'
  memory: 1Gi
  ephemeral-storage: 1Gi

@ghpu
Copy link
Author

ghpu commented Aug 23, 2023

Thanks a lot, I was trying to use it as a compact form like requests."ephemeral-storage" = "1Gi" . But complete form suits me very well .

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

2 participants