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

Enclose label values that are numeric in quotes #1233

Closed
akefirad opened this issue May 27, 2023 · 3 comments
Closed

Enclose label values that are numeric in quotes #1233

akefirad opened this issue May 27, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@akefirad
Copy link

Description of the bug:

I'm not sure if this is a feature or bug, or even what tool needs to take care of it. But it seems the root cause of the issue is deep in Go libraries used in K8S ecosystem. Anyhow, the issue is that even though 123456789 is a perfectly valid value for a label, you cannot deploy the following manifest:

# manifest.yaml file
apiVersion: v1
kind: ServiceAccount
metadata:
  name: foo-account
  labels:
    foo: 123456789

Reproduction Steps:

Try to deploy the above manifest.

Error Log:

The attempt fails with different error messages, depending on the tool used to deploy the resource. For example, using kubectl apply fails with:

error: unable to decode "manifest.yaml": json: cannot unmarshal number into Go struct field ObjectMeta.metadata.labels of type string

ArgoCD fails with:

"" is invalid: patch: Invalid value "<manifest>" : cannot convert int64 to string

Environment:

  • Framework Version: #N/A
  • OS: #N/A

Other:

A quick solution would be to enclose the value in quotes to force it to be string. But would be nice if CDK8S does it automatically.


This is 🐛 Bug Report

@akefirad akefirad added bug Something isn't working needs-triage Priority and effort undetermined yet labels May 27, 2023
Copy link

This issue has not received any attention in 1 year and will be closed soon. If you want to keep it open, please leave a comment below @mentioning a maintainer.

@github-actions github-actions bot added the closing-soon Issue/PR will be closing soon if no response is provided label May 26, 2024
@akefirad
Copy link
Author

I think this has been fixed. Or at least I don’t see the issue anymore.

@github-actions github-actions bot removed the closing-soon Issue/PR will be closing soon if no response is provided label May 26, 2024
@iliapolo iliapolo removed the needs-triage Priority and effort undetermined yet label Jun 1, 2024
@iliapolo
Copy link
Member

iliapolo commented Jun 1, 2024

@akefirad

I think this has been fixed. Or at least I don’t see the issue anymore.

Good news. In any case this is not a cdk8s issue because there is no report of cdk8s malfunctioning here. Closing.

@iliapolo iliapolo closed this as completed Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants