Skip to content

Commit

Permalink
Merge branch 'upgrade-release-2-3' into s3-user-data-support-for-awsm…
Browse files Browse the repository at this point in the history
…achinepool
  • Loading branch information
AndiDog committed Jun 27, 2024
2 parents fb30470 + af0411a commit ae00e05
Show file tree
Hide file tree
Showing 12 changed files with 924 additions and 74 deletions.
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ include $(ROOT_DIR_RELATIVE)/common.mk

# Go
GO_VERSION ?=1.21.5
GO_CONTAINER_IMAGE ?= public.ecr.aws/docker/library/golang:$(GO_VERSION)
GO_CONTAINER_IMAGE ?= golang:$(GO_VERSION)

# Directories.
ARTIFACTS ?= $(REPO_ROOT)/_artifacts
Expand Down Expand Up @@ -588,7 +588,7 @@ release-manifests: ## Release manifest files

.PHONY: release-changelog
release-changelog: $(RELEASE_NOTES) check-release-tag check-previous-release-tag check-github-token $(RELEASE_DIR)
$(RELEASE_NOTES) --debug --org $(GH_ORG_NAME) --repo $(GH_REPO_NAME) --start-sha $(shell git rev-list -n 1 ${PREVIOUS_VERSION}) --end-sha $(shell git rev-list -n 1 ${RELEASE_TAG}) --output $(RELEASE_DIR)/CHANGELOG.md --go-template go-template:$(REPO_ROOT)/hack/changelog.tpl --dependencies=true
$(RELEASE_NOTES) --debug --org $(GH_ORG_NAME) --repo $(GH_REPO_NAME) --start-sha $(shell git rev-list -n 1 ${PREVIOUS_VERSION}) --end-sha $(shell git rev-list -n 1 ${RELEASE_TAG}) --output $(RELEASE_DIR)/CHANGELOG.md --go-template go-template:$(REPO_ROOT)/hack/changelog.tpl --dependencies=false

.PHONY: promote-images
promote-images: $(KPROMO) $(YQ)
Expand All @@ -610,12 +610,11 @@ release-binary: $(RELEASE_DIR) versions.mk build-toolchain ## Release binary
-e CGO_ENABLED=0 \
-e GOOS=$(GOOS) \
-e GOARCH=$(GOARCH) \
--mount=source=gocache,target=/go/pkg/mod \
--mount=source=gocache,target=/root/.cache/go-build \
-e GOCACHE=/tmp/ \
--user $$(id -u):$$(id -g) \
-v "$$(pwd):/workspace$(DOCKER_VOL_OPTS)" \
-w /workspace \
$(TOOLCHAIN_IMAGE) \
git config --global --add safe.directory /workspace; \
$(GO_CONTAINER_IMAGE) \
go build -ldflags '$(LDFLAGS) -extldflags "-static"' \
-o $(RELEASE_DIR)/$(notdir $(RELEASE_BINARY))-$(GOOS)-$(GOARCH)$(EXT) $(RELEASE_BINARY)

Expand Down
2 changes: 1 addition & 1 deletion cloudbuild-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ timeout: 3000s
options:
substitution_option: ALLOW_LOOSE
steps:
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20220609-2e4c91eb7e'
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20240210-29014a6e3a'
entrypoint: make
env:
- DOCKER_CLI_EXPERIMENTAL=enabled
Expand Down
2 changes: 1 addition & 1 deletion cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ timeout: 3000s
options:
substitution_option: ALLOW_LOOSE
steps:
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20220609-2e4c91eb7e'
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20240210-29014a6e3a'
entrypoint: make
env:
- DOCKER_CLI_EXPERIMENTAL=enabled
Expand Down
18 changes: 0 additions & 18 deletions controllers/awscluster_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -714,24 +714,6 @@ func mockedDeleteVPCCallsForNonExistentVPC(m *mocks.MockEC2APIMockRecorder) {
}

func mockedDeleteVPCCalls(m *mocks.MockEC2APIMockRecorder) {
m.DescribeVpcEndpointsPages(gomock.Eq(&ec2.DescribeVpcEndpointsInput{
Filters: []*ec2.Filter{
{
Name: aws.String("vpc-id"),
Values: aws.StringSlice([]string{"vpc-exists"}),
},
}}),
gomock.Any()).Do(func(_, y interface{}) {
funct := y.(func(page *ec2.DescribeVpcEndpointsOutput, lastPage bool) bool)
funct(&ec2.DescribeVpcEndpointsOutput{VpcEndpoints: []*ec2.VpcEndpoint{{
VpcEndpointId: aws.String("vpce-12345"),
}}}, true)
}).Return(nil).AnyTimes()

m.DeleteVpcEndpoints(gomock.Eq(&ec2.DeleteVpcEndpointsInput{
VpcEndpointIds: aws.StringSlice([]string{"vpce-12345"}),
})).Return(&ec2.DeleteVpcEndpointsOutput{}, nil).AnyTimes()

m.DescribeSubnetsWithContext(context.TODO(), gomock.Eq(&ec2.DescribeSubnetsInput{
Filters: []*ec2.Filter{
{
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module sigs.k8s.io/cluster-api-provider-aws/v2

go 1.21

toolchain go1.21.5

replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.5.3

require (
Expand Down
2 changes: 1 addition & 1 deletion hack/ensure-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ EOF
fi

local go_version
IFS=" " read -ra go_version <<< "$(go version)"
IFS=" " read -ra go_version <<<"$(go version)"
local minimum_go_version
minimum_go_version=go1.21.5
if [[ "${minimum_go_version}" != $(echo -e "${minimum_go_version}\n${go_version[2]}" | sort -s -t. -k 1,1 -k 2,2n -k 3,3n | head -n1) && "${go_version[2]}" != "devel" ]]; then
Expand Down
2 changes: 2 additions & 0 deletions hack/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module sigs.k8s.io/cluster-api-provider-aws/hack/tools

go 1.21

toolchain go1.21.5

require (
github.com/a8m/envsubst v1.4.2
github.com/ahmetb/gen-crd-api-reference-docs v0.3.0
Expand Down
3 changes: 2 additions & 1 deletion hack/tools/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ github.com/ahmetb/gen-crd-api-reference-docs v0.3.0/go.mod h1:TdjdkYhlOifCQWPs1U
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs=
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs=
github.com/alecthomas/assert/v2 v2.3.0 h1:mAsH2wmvjsuvyBvAmCtm7zFsBlb8mIHx5ySLVdDZXL0=
github.com/alecthomas/assert/v2 v2.3.0/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ=
github.com/alecthomas/participle/v2 v2.1.0 h1:z7dElHRrOEEq45F2TG5cbQihMtNTv8vwldytDj7Wrz4=
github.com/alecthomas/participle/v2 v2.1.0/go.mod h1:Y1+hAs8DHPmc3YUFzqllV+eSQ9ljPTk0ZkPMtEdAx2c=
github.com/alecthomas/participle/v2 v2.1.1 h1:hrjKESvSqGHzRb4yW1ciisFJ4p3MGYih6icjJvbsmV8=
github.com/alecthomas/repr v0.3.0 h1:NeYzUPfjjlqHY4KtzgKJiWd6sVq2eNUPTi34PiFGjY8=
github.com/alecthomas/repr v0.3.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
Expand Down
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
publish = "docs/book/book"

[build.environment]
GO_VERSION = "1.21"
GO_VERSION = "1.21.5"

# Standard Netlify redirects
[[redirects]]
Expand Down
9 changes: 9 additions & 0 deletions pkg/cloud/services/network/vpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,15 @@ func (s *Service) deleteVPCEndpoints() error {
return nil
}

// Gather all services that might have been enabled.
services := sets.New[string]()
if s.scope.Bucket() != nil {
services.Insert(fmt.Sprintf("com.amazonaws.%s.s3", s.scope.Region()))
}
if services.Len() == 0 {
return nil
}

// Get all existing endpoints.
endpoints, err := s.describeVPCEndpoints()
if err != nil {
Expand Down
Loading

0 comments on commit ae00e05

Please sign in to comment.