From f855a4172e66cabf58101de76b14b6d3de5e52ca Mon Sep 17 00:00:00 2001 From: "Weber.Yang" Date: Wed, 27 Sep 2023 22:40:39 -0500 Subject: [PATCH] Bump CAPI to v1.5.2 (#149) --- .go-version | 2 +- Dockerfile | 2 +- Makefile | 2 +- go.mod | 4 ++-- go.sum | 8 ++++---- test/e2e/config/elf-dev.yaml | 24 ++++++++++++------------ test/e2e/data/capi/metadata.yaml | 3 +++ webhooks/elfmachine_webhook_mutation.go | 4 ++++ 8 files changed, 28 insertions(+), 21 deletions(-) diff --git a/.go-version b/.go-version index 8909929f..95393fc7 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.20.7 +1.20.8 diff --git a/Dockerfile b/Dockerfile index a80948f0..b8b4d8b0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ ARG ARCH # Build the manager binary -FROM golang:1.20.7 as builder +FROM golang:1.20.8 as builder WORKDIR /workspace # Run this with docker build --build_arg $(go env GOPROXY) to override the goproxy diff --git a/Makefile b/Makefile index e1aadf33..5f9e9038 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ VERSION ?= $(shell cat clusterctl-settings.json | jq .config.nextVersion -r) # # Go. # -GO_VERSION ?= 1.20.7 +GO_VERSION ?= 1.20.8 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) diff --git a/go.mod b/go.mod index fd532b10..53023d2d 100644 --- a/go.mod +++ b/go.mod @@ -19,8 +19,8 @@ require ( k8s.io/client-go v0.27.2 k8s.io/klog/v2 v2.90.1 k8s.io/utils v0.0.0-20230209194617-a36077c30491 - sigs.k8s.io/cluster-api v1.5.1 - sigs.k8s.io/cluster-api/test v1.5.1 + sigs.k8s.io/cluster-api v1.5.2 + sigs.k8s.io/cluster-api/test v1.5.2 sigs.k8s.io/controller-runtime v0.15.1 ) diff --git a/go.sum b/go.sum index f128f0b5..d21438c3 100644 --- a/go.sum +++ b/go.sum @@ -1147,10 +1147,10 @@ k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/cluster-api v1.5.1 h1:+oO4EbVQcbBJr5wjqmdjvewPHSTbVLigXZqPk3ZO8t0= -sigs.k8s.io/cluster-api v1.5.1/go.mod h1:EGJUNpFWi7dF426tO8MG/jE+w7T0UO5KyMnOwQ5riUY= -sigs.k8s.io/cluster-api/test v1.5.1 h1:kYUfzE6RFsopXek+l/LDnh4gtfjTi2FUghEY8zx0Z9U= -sigs.k8s.io/cluster-api/test v1.5.1/go.mod h1:mFlsY1y0lApBgQyXbmVprdzCK+9MQNp1C38K+aZdn5A= +sigs.k8s.io/cluster-api v1.5.2 h1:pCsyEHwTBb7n+U5Z2OA5STxdJ1EuSpJv8FLBx4lii3s= +sigs.k8s.io/cluster-api v1.5.2/go.mod h1:EGJUNpFWi7dF426tO8MG/jE+w7T0UO5KyMnOwQ5riUY= +sigs.k8s.io/cluster-api/test v1.5.2 h1:Hlorgn4ebGdSxP4IZAT7eMweAowh4n0/vdhc4HAPNF8= +sigs.k8s.io/cluster-api/test v1.5.2/go.mod h1:mFlsY1y0lApBgQyXbmVprdzCK+9MQNp1C38K+aZdn5A= sigs.k8s.io/controller-runtime v0.15.1 h1:9UvgKD4ZJGcj24vefUFgZFP3xej/3igL9BsOUTb/+4c= sigs.k8s.io/controller-runtime v0.15.1/go.mod h1:7ngYvp1MLT+9GeZ+6lH3LOlcHkp/+tzA/fmHa4iq9kk= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/test/e2e/config/elf-dev.yaml b/test/e2e/config/elf-dev.yaml index 2304f7dd..9d74b413 100644 --- a/test/e2e/config/elf-dev.yaml +++ b/test/e2e/config/elf-dev.yaml @@ -11,27 +11,27 @@ # - from the CAPE repository root, `make test-e2e` to build the elf provider image and run e2e tests. images: - - name: k8s.gcr.io/cluster-api/cluster-api-controller:v1.5.1 + - name: k8s.gcr.io/cluster-api/cluster-api-controller:v1.5.2 loadBehavior: tryLoad - - name: k8s.gcr.io/cluster-api/kubeadm-bootstrap-controller:v1.5.1 + - name: k8s.gcr.io/cluster-api/kubeadm-bootstrap-controller:v1.5.2 loadBehavior: tryLoad - - name: k8s.gcr.io/cluster-api/kubeadm-control-plane-controller:v1.5.1 + - name: k8s.gcr.io/cluster-api/kubeadm-control-plane-controller:v1.5.2 loadBehavior: tryLoad - name: k8s.gcr.io/smartxworks/cape-manager:e2e loadBehavior: mustLoad - - name: quay.io/jetstack/cert-manager-cainjector:v1.12.3 + - name: quay.io/jetstack/cert-manager-cainjector:v1.13.0 loadBehavior: tryLoad - - name: quay.io/jetstack/cert-manager-webhook:v1.12.3 + - name: quay.io/jetstack/cert-manager-webhook:v1.13.0 loadBehavior: tryLoad - - name: quay.io/jetstack/cert-manager-controller:v1.12.3 + - name: quay.io/jetstack/cert-manager-controller:v1.13.0 loadBehavior: tryLoad providers: - name: cluster-api type: CoreProvider versions: - - name: v1.5.1 # Use manifest from source files - value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.1/core-components.yaml" + - name: v1.5.2 # Use manifest from source files + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.2/core-components.yaml" type: "url" contract: v1beta1 files: @@ -45,8 +45,8 @@ providers: files: - sourcePath: "../data/capi/metadata.yaml" versions: - - name: v1.5.1 # Use manifest from source files - value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.1/bootstrap-components.yaml" + - name: v1.5.2 # Use manifest from source files + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.2/bootstrap-components.yaml" type: "url" contract: v1beta1 files: @@ -60,8 +60,8 @@ providers: files: - sourcePath: "../data/capi/metadata.yaml" versions: - - name: v1.5.1 # Use manifest from source files - value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.1/control-plane-components.yaml" + - name: v1.5.2 # Use manifest from source files + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.2/control-plane-components.yaml" type: "url" contract: v1beta1 files: diff --git a/test/e2e/data/capi/metadata.yaml b/test/e2e/data/capi/metadata.yaml index ffe51cf8..49d96b1c 100644 --- a/test/e2e/data/capi/metadata.yaml +++ b/test/e2e/data/capi/metadata.yaml @@ -6,6 +6,9 @@ apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3 kind: Metadata releaseSeries: + - major: 1 + minor: 5 + contract: v1beta1 - major: 1 minor: 4 contract: v1beta1 diff --git a/webhooks/elfmachine_webhook_mutation.go b/webhooks/elfmachine_webhook_mutation.go index 0c30a099..9c53b92d 100644 --- a/webhooks/elfmachine_webhook_mutation.go +++ b/webhooks/elfmachine_webhook_mutation.go @@ -33,6 +33,10 @@ import ( ) func (m *ElfMachineMutation) SetupWebhookWithManager(mgr ctrl.Manager) error { + if m.decoder == nil { + m.decoder = admission.NewDecoder(mgr.GetScheme()) + } + hookServer := mgr.GetWebhookServer() hookServer.Register("/mutate-infrastructure-cluster-x-k8s-io-v1beta1-elfmachine", &webhook.Admission{Handler: m}) return ctrl.NewWebhookManagedBy(mgr).