Skip to content

Commit 081fa73

Browse files
authored
Upgrade to Go 1.16 and fix report-card (#427)
* upgrade to go 1.16 * fix go-report-card
1 parent 0100489 commit 081fa73

File tree

10 files changed

+11
-10
lines changed

10 files changed

+11
-10
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: NTH Continuous Integration and Release
33
on: [push, pull_request, workflow_dispatch]
44

55
env:
6-
DEFAULT_GO_VERSION: ^1.15
6+
DEFAULT_GO_VERSION: ^1.16
77
GITHUB_USERNAME: ${{ secrets.EC2_BOT_GITHUB_USERNAME }}
88
GITHUB_TOKEN: ${{ secrets.EC2_BOT_GITHUB_TOKEN }}
99
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM golang:1.15 as builder
2+
FROM golang:1.16 as builder
33

44
## GOLANG env
55
ARG GOPROXY="https://proxy.golang.org|direct"

Dockerfile.windows

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG WINDOWS_VERSION=1809
22

33
# Build the manager binary
4-
FROM --platform=windows/amd64 golang:1.15 as builder
4+
FROM --platform=windows/amd64 golang:1.16 as builder
55

66
## GOLANG env
77
ENV GO111MODULE="on" CGO_ENABLED="0" GOOS="windows" GOARCH="amd64"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<a href="https://github.com/kubernetes/kubernetes/releases">
77
<img src="https://img.shields.io/badge/Kubernetes-%3E%3D%201.11-brightgreen" alt="kubernetes">
88
</a>
9-
<a href="https://golang.org/doc/go1.15">
9+
<a href="https://golang.org/doc/go1.16">
1010
<img src="https://img.shields.io/github/go-mod/go-version/aws/aws-node-termination-handler?color=blueviolet" alt="go-version">
1111
</a>
1212
<a href="https://opensource.org/licenses/Apache-2.0">

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/aws/aws-node-termination-handler
22

3-
go 1.15
3+
go 1.16
44

55
require (
66
github.com/aws/aws-sdk-go v1.33.1

pkg/monitor/sqsevent/sqs-monitor.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"encoding/json"
1818
"errors"
1919
"fmt"
20+
2021
"github.com/aws/aws-node-termination-handler/pkg/monitor"
2122
"github.com/aws/aws-sdk-go/aws"
2223
"github.com/aws/aws-sdk-go/aws/awserr"

pkg/monitor/sqsevent/sqs-monitor_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ func TestMonitor_DescribeInstancesError(t *testing.T) {
498498
}
499499
ec2Mock := h.MockedEC2{
500500
DescribeInstancesResp: ec2.DescribeInstancesOutput{},
501-
DescribeInstancesErr: awserr.New("InvalidInstanceID.NotFound", "The instance ID 'i-0d6bd3ce2bf8a6751' does not exist\n\tstatus code: 400, request id: 6a5c30e2-922d-464c-946c-a1ec76e5920b", fmt.Errorf("original error")),
501+
DescribeInstancesErr: awserr.New("InvalidInstanceID.NotFound", "The instance ID 'i-0d6bd3ce2bf8a6751' does not exist\n\tstatus code: 400, request id: 6a5c30e2-922d-464c-946c-a1ec76e5920b", fmt.Errorf("original error")),
502502
}
503503
drainChan := make(chan monitor.InterruptionEvent, 1)
504504

test/go-report-card-test/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1
1+
FROM public.ecr.aws/bitnami/golang:latest
22

33
WORKDIR /app
44

@@ -10,4 +10,4 @@ RUN go get github.com/gojp/goreportcard/cmd/goreportcard-cli
1010

1111
RUN go get -u golang.org/x/tools/cmd/goimports
1212

13-
CMD $GOPATH/bin/goreportcard-cli -v -t 90
13+
CMD $GOPATH/bin/goreportcard-cli -v -t 90

test/go-report-card-test/run-report-card-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function fail() {
1212
trap fail ERR
1313

1414
docker build --build-arg=GOPROXY=direct -t go-report-card-cli $SCRIPTPATH
15-
if [[ $(docker run -it -v $SCRIPTPATH/../../:/app go-report-card-cli /go/bin/goimports -l /app/) ]]; then
15+
if [[ $(docker run -i -v $SCRIPTPATH/../../:/app go-report-card-cli /go/bin/goimports -l /app/) ]]; then
1616
echo "❌ goimports found a problem in go source files. See above for the files with problems."
1717
EXIT_CODE=2
1818
else

test/webhook-test-proxy/Dockerfile.windows

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG WINDOWS_VERSION=1903
22

33
# Build the manager binary
4-
FROM --platform=windows/amd64 golang:1.15 AS builder
4+
FROM --platform=windows/amd64 golang:1.16 AS builder
55

66
## GOLANG env
77
ENV GO111MODULE="on" CGO_ENABLED="0" GOOS="windows" GOARCH="amd64"

0 commit comments

Comments
 (0)