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

Bootstrap-contoller manager image in v0.1.7 release tag references a v0.2.0 tag that doesn't exist #56

Closed
philjb opened this issue Oct 5, 2023 · 2 comments

Comments

@philjb
Copy link
Contributor

philjb commented Oct 5, 2023

Issue

The v0.1.7 release references a non-existant tag v0.2.0 in the config/ Kustomization folder. See the code snippet below from the v0.1.7 git tag.

https://github.com/cluster-api-provider-k3s/cluster-api-k3s/blob/e4ea03ae2a8deb9bffc481bd882f5f52b162a569/bootstrap/config/manager/kustomization.yaml#L7-L8

Details

This PR #49 to the build makefile parameterized this but I think the v0.1.7 release didn't set the env var BOOTSTRAP_IMG_TAG for based on the tag name.

GHCR only shows two images for the bootstrap-controller - v0.1.6-hotfix.2 and v0.1.7. https://github.com/cluster-api-provider-k3s/cluster-api-k3s/pkgs/container/cluster-api-k3s%2Fbootstrap-controller/versions?filters%5Bversion_type%5D=tagged

Screenshot 2023-10-05 at 10 33 51 AM

There's no image for the v0.2.0 tag so my kustomization file to pull in bootstrap controller doesn't work "out of the box".

Here's an example of how I generate the manifests for the k3s bootstrap controller

---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: capi-k3s-bootstrap-system
resources:
- [email protected]:cluster-api-provider-k3s/cluster-api-k3s.git/bootstrap/config/default?ref=v0.1.7

fixed already?

It looks like the issue in the makefile and the workflow release script have been fixed with PR #50 which is in release v0.1.7 so I'm not sure how the v0.1.7 release kustomize artifacts ended up with a v0.1.2 tag.

I will add more to this ticket as I learn more.

Problem

I think this is the issue. The Makefile is attempting to determine the tag that is currently checked out on this line:

https://github.com/cluster-api-provider-k3s/cluster-api-k3s/blob/e4ea03ae2a8deb9bffc481bd882f5f52b162a569/Makefile#L94

When I checkout a tag locally and run that git describe --abbrev=0 I get this message (on git version 2.41.0)

> git describe --abbrev=0
fatal: No annotated tags can describe 'e4ea03ae2a8deb9bffc481bd882f5f52b162a569'.
However, there were unannotated tags: try --tags.

So we either need git describe --abbrev=0 --tags or need to annotated the release tags. All the tags are currently so-called "lightweight" tags that point to another commit and are not objects themselves (with their own hash).

> git for-each-ref refs/tags
08dd84510f1568ffea748ae4bf2d1836cb69a93d commit refs/tags/v0.1.5
7f5c26d6603b44d7ea009fb6be00bf04f5617595 commit refs/tags/v0.1.6
1cde851a7cc264eff79427c8fb778751e57033b4 commit refs/tags/v0.1.6-hotfix.0
1df9aff3ac4f272b4de33fef4f9f5f48af1ec787 commit refs/tags/v0.1.6-hotfix.1
4d8982eca85361c96ba6befc71ab35ad2fa5e1b9 commit refs/tags/v0.1.6-hotfix.2
e4ea03ae2a8deb9bffc481bd882f5f52b162a569 commit refs/tags/v0.1.7

The second column would show tag for an annotated tag.

Typically, release tags are annotated tags as they include a tag message and optionally signing and verifying the tag.

@philjb
Copy link
Contributor Author

philjb commented Oct 5, 2023

I believe this PR addresses the root cause: #57

The v0.1.7 release tag(branch) will still have the wrong image tag for the bootstrap controller though.

@philjb
Copy link
Contributor Author

philjb commented Oct 5, 2023

Oh I see: the release artifact at https://github.com/cluster-api-provider-k3s/cluster-api-k3s/releases/download/v0.1.7/bootstrap-components.yaml has the correct image tag, but the tag in the git repo for file bootstrap/config/manager/kustomization.yaml lists the wrong tag: cluster-api-k3s/bootstrap/config/manager/kustomization.yaml

The release generating process doesn't actually use the code in the git tag verbatim. This kustomize edit line changes the code of the tag used to build the relesae:

https://github.com/cluster-api-provider-k3s/cluster-api-k3s/blob/e4ea03ae2a8deb9bffc481bd882f5f52b162a569/Makefile#L154-L155

@philjb philjb changed the title Bootstrap-contoller manager image in v0.1.7 release references a v0.2.0 tag that doesn't exist Bootstrap-contoller manager image in v0.1.7 release tag references a v0.2.0 tag that doesn't exist Oct 5, 2023
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