Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Replace Kubeyaml by go-yaml v3 #1933

Closed
2opremio opened this issue Apr 13, 2019 · 6 comments
Closed

Replace Kubeyaml by go-yaml v3 #1933

2opremio opened this issue Apr 13, 2019 · 6 comments

Comments

@2opremio
Copy link
Contributor

2opremio commented Apr 13, 2019

We are currently using gopkg.in/yaml.v2. However, gopkg.in/yaml.v3 provides a round trip parser through the use of Node. It provides comment preservation and and line-number information.

In turn, this would allow us to use Golang to update manifests during releases instead of invoking kubeyaml.

Advantages:

  • No runtime dependencies on Python, making the container image smaller.
  • Code cohesion: all the code will live in the same place, giving Flux more control over parsing.
@brezerk
Copy link
Contributor

brezerk commented May 5, 2019

one more point: getting rid of kubeyaml will make non x86_64 arch users life a bit easier :)

ts=2019-05-05T10:39:45.392945717Z caller=images.go:112 component=sync-loop workload=www-demo:helmrelease/brezblock container=chart-image repo=registry.internal-system.svc.cluster.local:5000/brezblock/brezblock pattern=regexp:^1.0.* current=registry.internal-system.svc.cluster.local:5000/brezblock/brezblock:1.0.32 info="added update to automation run" new=registry.internal-system.svc.cluster.local:5000/brezblock/brezblock:1.0.33-arm64 reason="latest 1.0.33-arm64 (2019-05-05 08:24:33.359935485 +0000 UTC) > current 1.0.32 (2018-12-06 16:05:24.080729393 +0000 UTC)"
ts=2019-05-05T10:39:45.65662969Z caller=loop.go:121 component=sync-loop jobID=78c6228f-7d3d-fc48-5bf3-b57bb0594dc6 state=done success=false err="applying changes: updating resource www-demo:helmrelease/brezblock in releases/brezblock.yaml: fork/exec /usr/lib/kubeyaml/kubeyaml: exec format error"

Apparently /usr/lib/kubeyaml/kubeyaml is build using ld-musl-x86_64.so sigh.

@2opremio are the sources for kubeyaml are publicly available? I can't find any references on https://quay.io/repository/squaremo/kubeyaml?tab=info tho

@2opremio
Copy link
Contributor Author

2opremio commented May 5, 2019

@2opremio
Copy link
Contributor Author

2opremio commented May 5, 2019

Are you planning to take up this issue? Let me know if you need any help

@brezerk
Copy link
Contributor

brezerk commented May 5, 2019

thank you!

well... it depends on the issue :)

regrading kubeyaml: exec format error -- yes, i'll try to see if it will be possible to produce multiarch images for kubeyaml as it is an a dependency for #1761.

as for the subject one: I am not Golang developer and just hacking things around so it would be too loud to say take it up :) If you think this is something relatively easy to pick up to some one new to Go dsl -- feel free to share the requirements and current implementation details. Other vice I don't really wish to waste your time.

Thanks!

@hiddeco
Copy link
Member

hiddeco commented Jun 11, 2019

Discovery I made last week when deciding about expanding kubeyaml or replacing it with yaml.v3:

We also currently do not attempt to preserve 100% of the formatting of the yaml parsed. The intent is to produce a format that most people would find pleasant by default.

go-yaml/yaml#459

@2opremio
Copy link
Contributor Author

which means ... goyaml v3 cannot really replace kubeyaml, so I will close this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants