Skip to content

Commit

Permalink
Merge pull request #572 from giantswarm/update-upstream
Browse files Browse the repository at this point in the history
Update from upstream main branch
  • Loading branch information
AndiDog authored Oct 25, 2023
2 parents df9e22a + e6e9717 commit cc199c4
Show file tree
Hide file tree
Showing 148 changed files with 5,943 additions and 862 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ kubeconfig
# vscode
.vscode

# go.work files
go.work
go.work.sum

# goland
.idea

Expand Down
8 changes: 6 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ linters-settings:
alias: apiextensionsv1
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
alias: metav1
- pkg: k8s.io/apimachinery/pkg/api/errors
alias: apierrors
- pkg: k8s.io/apimachinery/pkg/util/errors
alias: kerrors
- pkg: sigs.k8s.io/controller-runtime/pkg/conversion
Expand Down Expand Up @@ -165,6 +163,12 @@ linters-settings:
go: "1.20"
stylecheck:
go: "1.20"
depguard:
rules:
main:
deny:
- pkg: "io/ioutil"
desc: "ioutil is deprecated starting with Go 1.16"
issues:
max-same-issues: 0
max-issues-per-linter: 0
Expand Down
23 changes: 15 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ else
export GOPATH := $(shell go env GOPATH)
endif

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

# Release variables

STAGING_REGISTRY ?= gcr.io/k8s-staging-cluster-api-aws
Expand All @@ -100,6 +95,10 @@ RELEASE_ALIAS_TAG ?= $(PULL_BASE_REF)
RELEASE_DIR := out
RELEASE_POLICIES := $(RELEASE_DIR)/AWSIAMManagedPolicyControllers.json $(RELEASE_DIR)/AWSIAMManagedPolicyControllersWithEKS.json $(RELEASE_DIR)/AWSIAMManagedPolicyCloudProviderControlPlane.json $(RELEASE_DIR)/AWSIAMManagedPolicyCloudProviderNodes.json $(RELEASE_DIR)/AWSIAMManagedPolicyControllersWithS3.json
BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
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
ifeq ($(strip $(USER_FORK)),)
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
endif

# image name used to build the cmd/clusterawsadm
TOOLCHAIN_IMAGE := toolchain
Expand Down Expand Up @@ -224,6 +223,7 @@ generate-go-apis: ## Alias for .build/generate-go-apis
paths=./$(EXP_DIR)/api/... \
paths=./bootstrap/eks/api/... \
paths=./controlplane/eks/api/... \
paths=./controlplane/rosa/api/... \
paths=./iam/api/... \
paths=./controllers/... \
paths=./$(EXP_DIR)/controllers/... \
Expand Down Expand Up @@ -273,6 +273,14 @@ generate-go-apis: ## Alias for .build/generate-go-apis
--output-file-base=zz_generated.conversion $(GEN_OUTPUT_BASE) \
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt

$(CONVERSION_GEN) \
--input-dirs=./controlplane/rosa/api/v1beta2 \
--extra-peer-dirs=sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1 \
--extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1beta1 \
--build-tag=ignore_autogenerated_conversions \
--output-file-base=zz_generated.conversion $(GEN_OUTPUT_BASE) \
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt

touch $@

##@ lint and verify:
Expand Down Expand Up @@ -375,7 +383,7 @@ managers: ## Alias for manager-aws-infrastructure

.PHONY: manager-aws-infrastructure
manager-aws-infrastructure: ## Build manager binary
CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -ldflags "${LDFLAGS} -extldflags '-static'" -o $(BIN_DIR)/manager .
CGO_ENABLED=0 GOARCH=${ARCH} go build -ldflags "${LDFLAGS} -extldflags '-static'" -o $(BIN_DIR)/manager .

##@ test:

Expand Down Expand Up @@ -584,8 +592,7 @@ release-changelog: $(RELEASE_NOTES) check-release-tag check-previous-release-tag

.PHONY: promote-images
promote-images: $(KPROMO) $(YQ)
IMAGE_REVIEWERS="$(shell ./hack/get-project-maintainers.sh ${YQ})"
$(KPROMO) pr --project cluster-api-provider-aws --tag $(RELEASE_TAG) --reviewers "$(IMAGE_REVIEWERS)" --fork $(USER_FORK) --image cluster-api-aws-controller
$(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

.PHONY: release-binaries
release-binaries: ## Builds the binaries to publish with a release
Expand Down
28 changes: 19 additions & 9 deletions OWNERS_ALIASES
Original file line number Diff line number Diff line change
@@ -1,34 +1,44 @@
# See the OWNERS docs: https://github.com/kubernetes/community/blob/master/contributors/guide/owners.md
# See the OWNERS docs: <https://github.com/kubernetes/community/blob/master/contributors/guide/owners.md>

aliases:
# Correct as of 2022/10/13

# Correct as of 2023/10/04

sig-cluster-lifecycle-leads:
- fabriziopandini
- justinsb
- neolit123
- timothysc
# Correct as of 2022/10/13
- vincepri

# Correct as of 2023/10/04

cluster-api-admins:
- CecileRobertMichon
- vincepri
# Correct as of 2022/10/13

# Correct as of 2023/10/04

cluster-api-maintainers:
- CecileRobertMichon
- enxebre
- fabriziopandini
- killianmuldoon
- sbueringer
- vincepri
# Correct as of 2023/01/04

# Correct as of 2023/01/04

cluster-api-aws-admins:
- richardcase
cluster-api-aws-maintainers:
- richardcase
- Skarlso
- Ankitasw
- dlipovetsky
- vincepri
cluster-api-aws-reviewers:
- dthorsen
- pydctw
- shivi28
- AverageMarcus
- luthermonson
- cnmcavoy
- nrb
- faiq
37 changes: 37 additions & 0 deletions api/v1beta1/awscluster_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1beta1

import (
apiconversion "k8s.io/apimachinery/pkg/conversion"
infrav2 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2"
utilconversion "sigs.k8s.io/cluster-api/util/conversion"
"sigs.k8s.io/controller-runtime/pkg/conversion"
Expand Down Expand Up @@ -73,6 +74,37 @@ func (src *AWSCluster) ConvertTo(dstRaw conversion.Hub) error {

dst.Spec.NetworkSpec.AdditionalControlPlaneIngressRules = restored.Spec.NetworkSpec.AdditionalControlPlaneIngressRules

if restored.Spec.NetworkSpec.VPC.IPAMPool != nil {
if dst.Spec.NetworkSpec.VPC.IPAMPool == nil {
dst.Spec.NetworkSpec.VPC.IPAMPool = &infrav2.IPAMPool{}
}

restoreIPAMPool(restored.Spec.NetworkSpec.VPC.IPAMPool, dst.Spec.NetworkSpec.VPC.IPAMPool)
}

if restored.Spec.NetworkSpec.VPC.IsIPv6Enabled() && restored.Spec.NetworkSpec.VPC.IPv6.IPAMPool != nil {
if dst.Spec.NetworkSpec.VPC.IPv6.IPAMPool == nil {
dst.Spec.NetworkSpec.VPC.IPv6.IPAMPool = &infrav2.IPAMPool{}
}

restoreIPAMPool(restored.Spec.NetworkSpec.VPC.IPv6.IPAMPool, dst.Spec.NetworkSpec.VPC.IPv6.IPAMPool)
}

dst.Spec.NetworkSpec.AdditionalControlPlaneIngressRules = restored.Spec.NetworkSpec.AdditionalControlPlaneIngressRules

// Restore SubnetSpec.ResourceID field, if any.
for _, subnet := range restored.Spec.NetworkSpec.Subnets {
if len(subnet.ResourceID) == 0 {
continue
}
for i, dstSubnet := range dst.Spec.NetworkSpec.Subnets {
if dstSubnet.ID == subnet.ID {
dstSubnet.ResourceID = subnet.ResourceID
dstSubnet.DeepCopyInto(&dst.Spec.NetworkSpec.Subnets[i])
}
}
}

return nil
}

Expand Down Expand Up @@ -102,6 +134,7 @@ func restoreControlPlaneLoadBalancer(restored, dst *infrav2.AWSLoadBalancerSpec)
dst.DisableHostsRewrite = restored.DisableHostsRewrite
dst.PreserveClientIP = restored.PreserveClientIP
dst.IngressRules = restored.IngressRules
dst.AdditionalListeners = restored.AdditionalListeners
}

// ConvertFrom converts the v1beta1 AWSCluster receiver to a v1beta1 AWSCluster.
Expand Down Expand Up @@ -133,3 +166,7 @@ func (r *AWSClusterList) ConvertFrom(srcRaw conversion.Hub) error {

return Convert_v1beta2_AWSClusterList_To_v1beta1_AWSClusterList(src, r, nil)
}

func Convert_v1beta2_SubnetSpec_To_v1beta1_SubnetSpec(in *infrav2.SubnetSpec, out *SubnetSpec, s apiconversion.Scope) error {
return autoConvert_v1beta2_SubnetSpec_To_v1beta1_SubnetSpec(in, out, s)
}
4 changes: 4 additions & 0 deletions api/v1beta1/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,7 @@ func Convert_v1beta2_IPv6_To_v1beta1_IPv6(in *v1beta2.IPv6, out *IPv6, s convers
func Convert_v1beta2_NetworkSpec_To_v1beta1_NetworkSpec(in *v1beta2.NetworkSpec, out *NetworkSpec, s conversion.Scope) error {
return autoConvert_v1beta2_NetworkSpec_To_v1beta1_NetworkSpec(in, out, s)
}

func Convert_v1beta2_S3Bucket_To_v1beta1_S3Bucket(in *v1beta2.S3Bucket, out *S3Bucket, s conversion.Scope) error {
return autoConvert_v1beta2_S3Bucket_To_v1beta1_S3Bucket(in, out, s)
}
77 changes: 53 additions & 24 deletions api/v1beta1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cc199c4

Please sign in to comment.