From a451de4333e64b7e92f284058f5f85d214e49772 Mon Sep 17 00:00:00 2001 From: Andrew McDermott Date: Mon, 24 Jun 2019 15:23:18 +0100 Subject: [PATCH 1/2] Switch builds to use Go 1.12 --- Dockerfile | 2 +- Dockerfile.rhel7 | 2 +- Makefile | 2 +- hack/go-fmt.sh | 2 +- hack/go-lint.sh | 2 +- hack/go-vet.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 21ce2ca0d7..32fdcc9eb4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.svc.ci.openshift.org/openshift/release:golang-1.10 AS builder +FROM registry.svc.ci.openshift.org/openshift/release:golang-1.12 AS builder WORKDIR /go/src/sigs.k8s.io/cluster-api-provider-aws COPY . . # VERSION env gets set in the openshift/release image and refers to the golang version, which interfers with our own diff --git a/Dockerfile.rhel7 b/Dockerfile.rhel7 index 1a00c1ed38..44b6f8f9f8 100644 --- a/Dockerfile.rhel7 +++ b/Dockerfile.rhel7 @@ -1,4 +1,4 @@ -FROM registry.svc.ci.openshift.org/ocp/builder:golang-1.10 AS builder +FROM registry.svc.ci.openshift.org/ocp/builder:golang-1.12 AS builder WORKDIR /go/src/sigs.k8s.io/cluster-api-provider-aws COPY . . # VERSION env gets set in the openshift/release image and refers to the golang version, which interfers with our own diff --git a/Makefile b/Makefile index d0378efd19..ea5ab00c1d 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ ifeq ($(NO_DOCKER), 1) IMAGE_BUILD_CMD = imagebuilder CGO_ENABLED = 1 else - DOCKER_CMD := docker run --rm -e CGO_ENABLED=1 -v "$(PWD)":/go/src/sigs.k8s.io/cluster-api-provider-aws:Z -w /go/src/sigs.k8s.io/cluster-api-provider-aws openshift/origin-release:golang-1.10 + DOCKER_CMD := docker run --rm -e CGO_ENABLED=1 -v "$(PWD)":/go/src/sigs.k8s.io/cluster-api-provider-aws:Z -w /go/src/sigs.k8s.io/cluster-api-provider-aws openshift/origin-release:golang-1.12 IMAGE_BUILD_CMD = docker build endif diff --git a/hack/go-fmt.sh b/hack/go-fmt.sh index b14cb7df8a..a654a2fc2e 100755 --- a/hack/go-fmt.sh +++ b/hack/go-fmt.sh @@ -11,6 +11,6 @@ else --env IS_CONTAINER=TRUE \ --volume "${PWD}:/go/src/sigs.k8s.io/${REPO_NAME}:z" \ --workdir "/go/src/sigs.k8s.io/${REPO_NAME}" \ - openshift/origin-release:golang-1.10 \ + openshift/origin-release:golang-1.12 \ ./hack/go-fmt.sh "${@}" fi diff --git a/hack/go-lint.sh b/hack/go-lint.sh index b07f9b3633..044d4a1b4c 100755 --- a/hack/go-lint.sh +++ b/hack/go-lint.sh @@ -9,6 +9,6 @@ else --env IS_CONTAINER=TRUE \ --volume "${PWD}:/go/src/sigs.k8s.io/${REPO_NAME}:z" \ --workdir "/go/src/sigs.k8s.io/${REPO_NAME}" \ - openshift/origin-release:golang-1.10 \ + openshift/origin-release:golang-1.12 \ ./hack/go-lint.sh "${@}" fi diff --git a/hack/go-vet.sh b/hack/go-vet.sh index d2b8952d15..54e2d12cee 100755 --- a/hack/go-vet.sh +++ b/hack/go-vet.sh @@ -7,6 +7,6 @@ else --env IS_CONTAINER=TRUE \ --volume "${PWD}:/go/src/sigs.k8s.io/${REPO_NAME}:z" \ --workdir "/go/src/sigs.k8s.io/${REPO_NAME}" \ - openshift/origin-release:golang-1.10 \ + openshift/origin-release:golang-1.12 \ ./hack/go-vet.sh "${@}" fi; From e7c445c648c956422797764c55b238b76b502eda Mon Sep 17 00:00:00 2001 From: Andrew McDermott Date: Mon, 24 Jun 2019 15:22:54 +0100 Subject: [PATCH 2/2] Reformat pkg/actuators/machine/actuator_test.go for Go 1.12 and 1.10 --- pkg/actuators/machine/actuator_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/actuators/machine/actuator_test.go b/pkg/actuators/machine/actuator_test.go index bbe5a46042..912ecf90fa 100644 --- a/pkg/actuators/machine/actuator_test.go +++ b/pkg/actuators/machine/actuator_test.go @@ -493,6 +493,7 @@ func TestActuator(t *testing.T) { }, { name: "Delete machine failed (no running instances)", + describeInstancesOutput: &ec2.DescribeInstancesOutput{ Reservations: []*ec2.Reservation{ { @@ -506,6 +507,7 @@ func TestActuator(t *testing.T) { }, { name: "Delete machine failed (error terminating instances)", + terminateInstancesErr: fmt.Errorf("error"), operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *machinev1.Machine) { actuator.Delete(context.TODO(), cluster, machine)