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

Get the default version from vendored cilium/charts repo #2874

Closed
wants to merge 1 commit into from

Conversation

michi-covalent
Copy link
Contributor

Get the default Cilium version from vendored cilium/charts repo so that the build is reproducible.

Fixes: #2870

Get the default Cilium version from vendored cilium/charts repo so that
the build is reproducible.

Fixes: #2870

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
@michi-covalent
Copy link
Contributor Author

output from make:

% make
CGO_ENABLED=0 go build  \
	-ldflags "-w -s -X 'github.com/cilium/cilium/cilium-cli/defaults.CLIVersion=v0.16.20-21-gbed0f4506' -X 'github.com/cilium/cilium/cilium-cli/defaults.Version=v1.16.3'" \
	-o cilium \
	./cmd/cilium

Copy link
Member

@tklauser tklauser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense 👍

Now that we rely on cilium/charts for the version, I think we should also update the instructions in RELEASE.md to update that dependency before the release in order to make sure it will ship with the latest Cilium release baked in.

@Foxboron
Copy link

Foxboron commented Dec 3, 2024

Why can't this version be manually set as part of the release process?

@tklauser
Copy link
Member

tklauser commented Dec 3, 2024

Why can't this version be manually set as part of the release process?

Updating github.com/cilium/charts as part of the release process will be a manual action as well and extracting the latest version from there is IMO is less error prone than requiring the developer to manually updating the version. Do you see any reason why this won't work?

@Foxboron
Copy link

Foxboron commented Dec 3, 2024

Do you see any reason why this won't work?

It will. You just have an implied dependency on how vendor/github.com/cilium/charts structure their repository. Is the team aware of this inter-dependency, and what if it breaks?

This also doesn't fix the manual install process which still recommends the "curl from master" approach, so if you want to be consistent and clear to the users I don't see how you can solve this without having to manually type the version during release.

EDIT: that's stable.txt from cilium-cli, not cilium, sorry :)

@tklauser
Copy link
Member

tklauser commented Dec 3, 2024

Do you see any reason why this won't work?

It will. You just have an implied dependency on how vendor/github.com/cilium/charts structure their repository. Is the team aware of this inter-dependency, and what if it breaks?

Yes, but that (indirect) dependency already exists anyway. And it's the Cilium community (i.e. us) controlling that repository, so I don't see a big risk in depending on its structure. I actually think the chance of forgetting to manually update the version or getting it wrong on cilium-cli release is much higher.

This also doesn't fix the manual install process which still recommends the "curl from master" approach, so if you want to be consistent and clear to the users I don't see how you can solve this without having to manually type the version during release.

EDIT: that's stable.txt from cilium-cli, not cilium, sorry :)

👍

@tklauser
Copy link
Member

tklauser commented Dec 3, 2024

That being said, I'm not strongly opposed to changing to a manual approach as sugested. I just think it has the risk of being slightly more error-prone. But I'll let @michi-covalent decide on what approach to take here.

@Foxboron
Copy link

Foxboron commented Dec 3, 2024

Yes, but that (indirect) dependency already exists anyway. And it's the Cilium community (i.e. us) controlling that repository, so I don't see a big risk in depending on its structure. I actually think the chance of forgetting to manually update the version or getting it wrong on cilium-cli release is much higher.

Generally, overly clever things like this in build systems introduces errors and edge-cases, and the time spent fixing them once bugs happen, does not end up saving you a lot of time.

This is code that I would need to bring into the Arch downstream package as well, as the correct value can't be easily obtained.

Ref: https://gitlab.archlinux.org/archlinux/packaging/packages/cilium-cli/-/merge_requests/1

That being said, I'm not strongly opposed to changing to a manual approach as sugested.

You all know the projects better than me, I'm just speaking from a downstream perspective. Feel free to do what you think is best for you project.

@michi-covalent
Copy link
Contributor Author

thanks for the pointer https://gitlab.archlinux.org/archlinux/packaging/packages/cilium-cli/-/merge_requests/1/diffs, it helps to see how it's being built downstream.

let's just stop setting github.com/cilium/cilium/cilium-cli/defaults.Version using -ldflags. cilium-cli can just figure this out from the vendored charts, and i do want to avoid adding extra steps in the release process 🚀🙏

@michi-covalent
Copy link
Contributor Author

closing this one. will fix this in the cilium-cli code

@michi-covalent michi-covalent deleted the pr/michi/infinite-bash branch December 3, 2024 22:49
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

Successfully merging this pull request may close these issues.

curl'ing stable.txt from cilium/cilium makes builds unreproducible.
3 participants