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

clusterctl: make clusterctl be available via go install #11466

Closed
sivchari opened this issue Nov 22, 2024 · 5 comments · Fixed by #11468
Closed

clusterctl: make clusterctl be available via go install #11466

sivchari opened this issue Nov 22, 2024 · 5 comments · Fixed by #11468
Labels
area/clusterctl Issues or PRs related to clusterctl kind/bug Categorizes issue or PR as related to a bug. needs-priority Indicates an issue lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@sivchari
Copy link
Member

sivchari commented Nov 22, 2024

What steps did you take and what happened?

related with #11464

Currently, clusterctl is unavailable via go install since a following error is occurred.

$ kind create cluster --name quick
Creating cluster "quick" ...
 ✓ Ensuring node image (kindest/node:v1.27.3) 🖼
 ✓ Preparing nodes 📦
 ✓ Writing configuration 📜
 ✓ Starting control-plane 🕹️
 ✓ Installing CNI 🔌
 ✓ Installing StorageClass 💾
Set kubectl context to "kind-quick"
You can now use your cluster with:

kubectl cluster-info --context kind-quick

Have a nice day! 👋

$ clusterctl init --infrastructure docker
Fetching providers
Installing cert-manager version="v1.16.1"
Waiting for cert-manager to be available...
Installing provider="cluster-api" version="v1.8.5" targetNamespace="capi-system"
Installing provider="bootstrap-kubeadm" version="v1.8.5" targetNamespace="capi-kubeadm-bootstrap-system"
Installing provider="control-plane-kubeadm" version="v1.8.5" targetNamespace="capi-kubeadm-control-plane-system"
Installing provider="infrastructure-docker" version="v1.8.5" targetNamespace="capd-system"

Your management cluster has been initialized successfully!

You can now create your first workload cluster by running the following:

  clusterctl generate cluster [name] --kubernetes-version [version] | kubectl apply -f -

Error: unable to verify clusterctl version: unable to semver parse clusterctl GitVersion: strconv.ParseUint: parsing "": invalid syntax

This error is that why the clusterctl isn't embed the some versions since the go install doesn't use ldflag.
To use go install is general way to install some binaries and this validation in clusterctl is only used to compare local version with latest version.
Since we can embed the these variables by providing the ldflags to the go install, I think it's better way to do comparison if these variables is set.
In additional, current comparison only check the patch version. So it doesn't suggest new clusterctl version when local clusterctl is vX.Y.Z and latest one is vX.Y+1.Z.
That's why, I think it's also better to fix this implementation.

What did you expect to happen?

Make clusterctl be available via go install.

Cluster API version

v1.8.5

Kubernetes version

No response

Anything else you would like to add?

No response

Label(s) to be applied

/kind bug
One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels.

/area clusterctl

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. area/clusterctl Issues or PRs related to clusterctl needs-priority Indicates an issue lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 22, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If CAPI contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@chrischdi
Copy link
Member

Probably we should also prepare for golang/go#50603

/reopen

Maybe we should open a separate issue for this, but reopening here until we move to a different one.

@k8s-ci-robot k8s-ci-robot reopened this Nov 24, 2024
@k8s-ci-robot
Copy link
Contributor

@chrischdi: Reopened this issue.

In response to this:

Probably we should also prepare for golang/go#50603

/reopen

Maybe we should open a separate issue for this, but reopening here until we move to a different one.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@chrischdi
Copy link
Member

chrischdi commented Nov 25, 2024

/close

Makeing a note for myself to add it to the Kubernetes v1.33 Bump issue as soon as it exists (this contains our go bump)

@k8s-ci-robot
Copy link
Contributor

@chrischdi: Closing this issue.

In response to this:

/close

Makeing a node for myself to add it to the Kubernetes v1.33 Bump issue as soon as it exists (this contains our go bump)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/clusterctl Issues or PRs related to clusterctl kind/bug Categorizes issue or PR as related to a bug. needs-priority Indicates an issue lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
3 participants