Skip to content

Commit 9eb88c7

Browse files
authored
Merge pull request #4545 from richardcase/kpromo_fixes_post_release
fix: kpromo failed during release
2 parents 1fb82d9 + 8dd0caa commit 9eb88c7

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

Makefile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,6 @@ else
8282
export GOPATH := $(shell go env GOPATH)
8383
endif
8484

85-
USER_FORK ?= $(shell git config --get remote.origin.url | cut -d/ -f4) # only works on https://github.com/<username>/cluster-api.git style URLs
86-
ifeq ($(USER_FORK),)
87-
USER_FORK := $(shell git config --get remote.origin.url | cut -d: -f2 | cut -d/ -f1) # for [email protected]:<username>/cluster-api.git style URLs
88-
endif
89-
9085
# Release variables
9186

9287
STAGING_REGISTRY ?= gcr.io/k8s-staging-cluster-api-aws
@@ -100,6 +95,10 @@ RELEASE_ALIAS_TAG ?= $(PULL_BASE_REF)
10095
RELEASE_DIR := out
10196
RELEASE_POLICIES := $(RELEASE_DIR)/AWSIAMManagedPolicyControllers.json $(RELEASE_DIR)/AWSIAMManagedPolicyControllersWithEKS.json $(RELEASE_DIR)/AWSIAMManagedPolicyCloudProviderControlPlane.json $(RELEASE_DIR)/AWSIAMManagedPolicyCloudProviderNodes.json $(RELEASE_DIR)/AWSIAMManagedPolicyControllersWithS3.json
10297
BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
98+
USER_FORK ?= $(shell git config --get remote.origin.url | cut -d/ -f4) # only works on https://github.com/<username>/cluster-api-provider-aws.git style URLs
99+
ifeq ($(strip $(USER_FORK)),)
100+
USER_FORK := $(shell git config --get remote.origin.url | cut -d: -f2 | cut -d/ -f1) # for [email protected]:<username>/cluster-api-provider-aws.git style URLs
101+
endif
103102

104103
# image name used to build the cmd/clusterawsadm
105104
TOOLCHAIN_IMAGE := toolchain
@@ -584,8 +583,7 @@ release-changelog: $(RELEASE_NOTES) check-release-tag check-previous-release-tag
584583

585584
.PHONY: promote-images
586585
promote-images: $(KPROMO) $(YQ)
587-
IMAGE_REVIEWERS="$(shell ./hack/get-project-maintainers.sh ${YQ})"
588-
$(KPROMO) pr --project cluster-api-provider-aws --tag $(RELEASE_TAG) --reviewers "$(IMAGE_REVIEWERS)" --fork $(USER_FORK) --image cluster-api-aws-controller
586+
$(KPROMO) pr --project cluster-api-aws --tag $(RELEASE_TAG) --reviewers "$(shell ./hack/get-project-maintainers.sh ${YQ})" --fork $(USER_FORK) --image cluster-api-aws-controller
589587

590588
.PHONY: release-binaries
591589
release-binaries: ## Builds the binaries to publish with a release

docs/book/src/development/releasing.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,22 @@ Promote the container images from the staging registry to the production registr
2929
3. Wait for an image to appear with the tagged release version.
3030
4. If you don't have a GitHub token, create one by going to your GitHub settings, in [Personal access tokens](https://github.com/settings/tokens). Make sure you give the token the `repo` scope.
3131
5. Create a PR to promote the images:
32+
3233
```bash
3334
export GITHUB_TOKEN=<your GH token>
3435
make promote-images
3536
```
37+
3638
**Notes**:
39+
*`make promote-images` target tries to figure out your Github user handle in order to find the forked [k8s.io](https://github.com/kubernetes/k8s.io) repository.
40+
If you have not forked the repo, please do it before running the Makefile target.
41+
* if `make promote-images` fails with an error like `FATAL while checking fork of kubernetes/k8s.io` you may be able to solve it by manually setting the USER_FORK variable i.e. `export USER_FORK=<personal GitHub handle>`
3742
* `kpromo` uses `[email protected]:...` as remote to push the branch for the PR. If you don't have `ssh` set up you can configure
3843
git to use `https` instead via `git config --global url."https://github.com/".insteadOf [email protected]:`.
3944
* This will automatically create a PR in [k8s.io](https://github.com/kubernetes/k8s.io) and assign the CAPA maintainers.
4045
6. Wait for the PR to be approved (typically by CAPA maintainers authorized to merge PRs into the k8s.io repository) and merged.
4146
7. Verify the images are available in the production registry:
47+
4248
```bash
4349
docker pull registry.k8s.io/cluster-api-aws/cluster-api-aws-controller:${VERSION}
4450
```
@@ -69,6 +75,7 @@ Promote the container images from the staging registry to the production registr
6975
7076
1. Publish release. Use the pre-release option for release candidate versions of Cluster API Provider AWS.
7177
1. Email `[email protected]` to announce the release. You can use this template for the email:
78+
7279
```
7380
Subject: [ANNOUNCE] cluster-api-provider-aws v2.1.0 is released
7481
Body:
@@ -78,4 +85,5 @@ Promote the container images from the staging registry to the production registr
7885
If you have any questions about this release or CAPA, please join us on our Slack channel:
7986
https://kubernetes.slack.com/archives/CD6U2V71N
8087
```
81-
1. Update the Title and Description of the Slack channel to point to the new version.
88+
89+
1. Update the Title and Description of the Slack channel to point to the new version.

0 commit comments

Comments
 (0)