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

Add JSON/YAML marshalling/unmarshalling #5

Merged
merged 3 commits into from
Sep 5, 2023
Merged

Add JSON/YAML marshalling/unmarshalling #5

merged 3 commits into from
Sep 5, 2023

Conversation

kke
Copy link
Collaborator

@kke kke commented Sep 4, 2023

This allows k0sctl to do something like:

type K0s struct {
  version *version.Version
}

and have it automatically convert the string to a proper version object, making comparisons easier (with #4 specially) and reduce doing multiple conversions.

@kke kke added the enhancement New feature or request label Sep 4, 2023
@kke
Copy link
Collaborator Author

kke commented Sep 4, 2023

The YAML tests are a bit weird so that the dependency to a yaml package could be dropped, but as seen before the second commit, the tests passed just fine using the gopkg.in/yaml.v2 dependency and removing the dep only required changes to the tests, otherwise the code was untouched.

@kke kke requested review from twz123 and jnummelin September 4, 2023 12:44
@kke kke merged commit a97a29d into main Sep 5, 2023
2 checks passed
@kke kke deleted the marshaling branch September 5, 2023 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant