Skip to content

Commit 7e587e0

Browse files
authored
build: Use new clusterctl-aws name for clusterawsadm (#863)
This was renamed as part of CAPA v2.6.0 to create a clusterctl plugin and now CAPA releases both clusterctl-aws and clusterawsadm. However clusterawsadm will be removed in the nearish future so make the change here now so we are prepared for it.
1 parent f109fa6 commit 7e587e0

File tree

5 files changed

+20
-14
lines changed

5 files changed

+20
-14
lines changed

devbox.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
"yamale@latest",
3131
"yamllint@latest",
3232
"yq-go@latest",
33-
"path:./hack/flakes#clusterawsadm",
3433
"path:./hack/flakes#clusterctl",
34+
"path:./hack/flakes#clusterctl-aws",
3535
"path:./hack/flakes#controller-gen",
3636
"path:./hack/flakes#go-mod-upgrade",
3737
"path:./hack/flakes#golangci-lint",

hack/flakes/flake.nix

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
ldflags = [ "-s" "-w" ];
5858
};
5959

60-
clusterawsadm = buildGo122Module rec {
61-
name = "clusterawsadm";
60+
clusterctl-aws = buildGo122Module rec {
61+
name = "clusterctl-aws";
6262
version = "2.6.1";
6363
src = fetchFromGitHub {
6464
owner = "kubernetes-sigs";
@@ -69,17 +69,23 @@
6969
doCheck = false;
7070
subPackages = [ "cmd/clusterawsadm" ];
7171
vendorHash = "sha256-WRKViPMlJVV3uS+TK6Rd4EoEQ5ttdXDoOqoYiuga1WE=";
72-
ldflags = let t = "sigs.k8s.io/cluster-api-provider-aws/v2/version"; in [
72+
ldflags = let modPrefix = "sigs.k8s.io/cluster-api-provider-aws/v2";
73+
v = "${modPrefix}/version";
74+
c = "${modPrefix}/cmd/clusterawsadm/cmd/version"; in [
7375
"-s"
7476
"-w"
75-
"-X" "${t}.gitVersion=v${version}"
76-
"-X" "${t}.gitCommit=v${version}"
77-
"-X" "${t}.gitReleaseCommit=v${version}"
78-
"-X" "${t}.gitMajor=${lib.versions.major version}"
79-
"-X" "${t}.gitMinor=${lib.versions.minor version}"
80-
"-X" "${t}.buildDate=19700101-00:00:00"
81-
"-X" "${t}.gitTreeState=clean"
77+
"-X" "${v}.gitVersion=v${version}"
78+
"-X" "${v}.gitCommit=v${version}"
79+
"-X" "${v}.gitReleaseCommit=v${version}"
80+
"-X" "${v}.gitMajor=${lib.versions.major version}"
81+
"-X" "${v}.gitMinor=${lib.versions.minor version}"
82+
"-X" "${v}.buildDate=19700101-00:00:00"
83+
"-X" "${v}.gitTreeState=clean"
84+
"-X" "${c}.CLIName=clusterctl-aws"
8285
];
86+
preInstall = ''
87+
mv $GOPATH/bin/clusterawsadm $GOPATH/bin/clusterctl-aws
88+
'';
8389
};
8490

8591
release-please = buildNpmPackage rec {

make/clusterctl.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ clusterctl.init:
1414
EXP_RUNTIME_SDK=true \
1515
EXP_CLUSTER_RESOURCE_SET=true \
1616
EXP_MACHINE_POOL=true \
17-
AWS_B64ENCODED_CREDENTIALS=$$(clusterawsadm bootstrap credentials encode-as-profile) \
17+
AWS_B64ENCODED_CREDENTIALS=$$(clusterctl-aws bootstrap credentials encode-as-profile) \
1818
NUTANIX_ENDPOINT="" NUTANIX_PASSWORD="" NUTANIX_USER="" \
1919
clusterctl init \
2020
--kubeconfig=$(KIND_KUBECONFIG) \

make/dev.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ dev.update-webhook-image-on-kind:
3939
.PHONY: dev.update-bootstrap-credentials-aws
4040
dev.update-bootstrap-credentials-aws: export KUBECONFIG := $(KIND_KUBECONFIG)
4141
dev.update-bootstrap-credentials-aws:
42-
kubectl patch secret capa-manager-bootstrap-credentials -n capa-system -p="{\"data\":{\"credentials\": \"$$(clusterawsadm bootstrap credentials encode-as-profile)\"}}"
42+
kubectl patch secret capa-manager-bootstrap-credentials -n capa-system -p="{\"data\":{\"credentials\": \"$$(clusterctl-aws bootstrap credentials encode-as-profile)\"}}"
4343
kubectl rollout restart deployment capa-controller-manager -n capa-system
4444
kubectl rollout status deployment capa-controller-manager -n capa-system
4545

make/go.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ endif
9191
$(info $(M) $(if $(filter $(E2E_DRYRUN), true),dry-,)running e2e tests$(if $(E2E_LABEL), labelled "$(E2E_LABEL)")$(if $(E2E_FOCUS), matching "$(E2E_FOCUS)"))
9292
env E2E_IMAGE_TAG="$$(gojq --raw-output '.version+"-"+.runtime.goarch' $(REPO_ROOT)/dist/metadata.json)" \
9393
envsubst -no-unset -no-empty -i '$(E2E_CONF_FILE)' -o '$(E2E_CONF_FILE_ENVSUBST)'
94-
env AWS_B64ENCODED_CREDENTIALS="$$(clusterawsadm bootstrap credentials encode-as-profile 2>/dev/null)" \
94+
env AWS_B64ENCODED_CREDENTIALS="$$(clusterctl-aws bootstrap credentials encode-as-profile 2>/dev/null)" \
9595
ginkgo run \
9696
--r \
9797
--show-node-events \

0 commit comments

Comments
 (0)