nutanix-cloud-native / cluster-api-provider-nutanix

Kubernetes-native declarative infrastructure provider for Nutanix AHV
https://opendocs.nutanix.com/capx/latest/getting_started/
Apache License 2.0
42 stars 22 forks source link

Install a local clusterctl executable and use it in make targets #349

Closed dlipovetsky closed 11 months ago

dlipovetsky commented 11 months ago

What this PR does / why we need it: The dev docs rely on the clusterctl executable, as do some make targets. The clusterctl version should correspond to the cluster-api go module dependency version.

I expect this change to make it easier to follow the developer documentation.

If we like this approach for clusterctl, we can also consider it for kind, and even kubectl.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): Fixes #

How Has This Been Tested?:

Here's output of running a make target that depends on clusterctl:

> make --debug test-clusterctl-create
GNU Make 4.3
Built for x86_64-redhat-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating makefiles....
Updating goal targets....
 File 'test-clusterctl-create' does not exist.
   File '/home/dlipovetsky/nutanix/cluster-api-provider-nutanix/hack/tools/bin/clusterctl' does not exist.
  Must remake target '/home/dlipovetsky/nutanix/cluster-api-provider-nutanix/hack/tools/bin/clusterctl'.
curl -sSfL -o /home/dlipovetsky/nutanix/cluster-api-provider-nutanix/hack/tools/bin/clusterctl https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.3.5/clusterctl-linux-amd64
chmod u+x /home/dlipovetsky/nutanix/cluster-api-provider-nutanix/hack/tools/bin/clusterctl
  Successfully remade target file '/home/dlipovetsky/nutanix/cluster-api-provider-nutanix/hack/tools/bin/clusterctl'.
Must remake target 'test-clusterctl-create'.
/home/dlipovetsky/nutanix/cluster-api-provider-nutanix/hack/tools/bin/clusterctl version
clusterctl version: &version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.5", GitCommit:"58770484dee6c99c10e32c06652e9f9643f78e9e", GitTreeState:"clean", BuildDate:"2023-03-02T15:57:13Z", GoVersion:"go1.19.6", Compiler:"gc", Platform:"linux/amd64"}
Using configuration File="/home/dlipovetsky/.cluster-api/clusterctl.yaml"
/home/dlipovetsky/nutanix/cluster-api-provider-nutanix/hack/tools/bin/clusterctl config repositories | grep nutanix
Using configuration File="/home/dlipovetsky/.cluster-api/clusterctl.yaml"
nutanix        InfrastructureProvider   file:///$HOME/.cluster-api/overrides/infrastructure-nutanix/v0.0.0/                         infrastructure-components.yaml
Using configuration File="/home/dlipovetsky/.cluster-api/clusterctl.yaml"
/home/dlipovetsky/nutanix/cluster-api-provider-nutanix/hack/tools/bin/clusterctl generate cluster mycluster -i nutanix:v1.3.99 --list-variables -v 10
Using configuration File="/home/dlipovetsky/.cluster-api/clusterctl.yaml"
Using Override="cluster-template.yaml" Provider="infrastructure-nutanix" Version="v1.3.99"

Special notes for your reviewer:

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:

NONE
nutanix-cn-prow-bot[bot] commented 11 months ago

Hi @dlipovetsky. Thanks for your PR.

I'm waiting for a nutanix-cloud-native member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
thunderboltsid commented 11 months ago

/ok-to-test

codecov[bot] commented 11 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (c136d25) 13.62% compared to head (7fe7c97) 13.62%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #349 +/- ## ======================================= Coverage 13.62% 13.62% ======================================= Files 4 4 Lines 1013 1013 ======================================= Hits 138 138 Misses 875 875 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

deepakm-ntnx commented 11 months ago

/lgtm

dlipovetsky commented 11 months ago

I had to rebase on main. I did that, and force-pushed. There were no rebase conflicts.

thunderboltsid commented 11 months ago

/lgtm /approve

dlipovetsky commented 11 months ago

I had to rebase again, but this time I used GitHub's "built-in" rebase, and existing approvals were not revoked.

dlipovetsky commented 11 months ago

Well, adding a fixup commit dismissed all the reviews, except one. So I decided to squash the fixup commit now, rather than wait for later.

thunderboltsid commented 11 months ago

/lgtm /approve

nutanix-cn-prow-bot[bot] commented 11 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dkoshkin, dlipovetsky, supershal, thunderboltsid

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix/blob/main/OWNERS)~~ [thunderboltsid] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment