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

Investigate trailing zero truncation issue with sigs.k8s.io/yaml package #9184

Closed
abhay-krishna opened this issue Jan 17, 2025 · 1 comment
Closed

Comments

@abhay-krishna
Copy link
Member

Description

We noticed an issue with the cluster config parsing where if a user wishes to create an EKS-A cluster with a Kubernetes version whose minor version is a multiple of 10, i.e., 1.30, 1.40, etc., the version gets converted into a float64 type when parsed and the trailing zeros gets dropped, thereby leading to downstream methods getting incorrect inputs such as 1.3, 1.4 for the Kubernetes version. This error manifests during cluster creation as

Error: unable to get cluster config from file: kubernetes version 1.3 is not supported by bundles manifest ...

where the Kubernetes version in the output will be the input Kubernetes version without the trailing zeros.

We determined this is caused by bugs (go-yaml/yaml#430, go-yaml/yaml#671) in the underlying gopkg.in/yaml.v2 parser used by the sigs.k8s.io/yaml module (same bug also logged in SIGs YAML) that we consume.

The short-term solution is for the user to always use quotes around their Kubernetes version which prevents it from being parsed as a float64 and instead correctly as a string. However we need to investigate if there is a programmatic way to solve this, possibly by using a different YAML library or making our parsing method aware of this issue and use context-aware logic.

@abhay-krishna
Copy link
Member Author

We have a fix for this in #9185. We circumvent the need for customer to add quotes by adding it in code ourselves after reading in the cluster config file and prior to parsing th contents.

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

1 participant