File tree 7 files changed +74
-2
lines changed
7 files changed +74
-2
lines changed Original file line number Diff line number Diff line change
1
+ aws-iam-authenticator
2
+
3
+ bin
4
+
1
5
/dist
2
6
/_output
3
7
Original file line number Diff line number Diff line change
1
+ 1.21.5
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ ARG golang_image=public.ecr.aws/docker/library/golang:1.21.5
17
17
FROM --platform=$BUILDPLATFORM $golang_image AS builder
18
18
WORKDIR /go/src/github.com/kubernetes-sigs/aws-iam-authenticator
19
19
COPY . .
20
+ RUN go version
20
21
RUN goproxy=https://goproxy.io go mod download
21
22
ARG TARGETOS TARGETARCH
22
23
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make bin
Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ image: .image-linux-$(GOARCH)
100
100
.PHONY : .image-linux-%
101
101
.image-linux-% :
102
102
docker buildx build --output=type=docker --platform linux/$* \
103
+ --build-arg golang_image=$(shell hack/setup-go.sh) \
103
104
--tag aws-iam-authenticator:$(VERSION ) _$(GIT_COMMIT ) _$(BUILD_DATE_STRIPPED ) -linux_$* .
104
105
105
106
.PHONY : goreleaser
@@ -111,8 +112,7 @@ endif
111
112
112
113
.PHONY : test
113
114
test :
114
- go test -v -coverprofile=coverage.out -race $(PKG ) /pkg/...
115
- go tool cover -html=coverage.out -o coverage.html
115
+ ./hack/test-unit.sh
116
116
117
117
.PHONY : integration
118
118
integration :
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # Copyright 2020 The Kubernetes Authors.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ # script to setup go version as needed
17
+ # MUST BE RUN FROM THE REPO ROOT DIRECTORY
18
+
19
+ # read go-version file unless GO_VERSION is set
20
+ GO_VERSION=" ${GO_VERSION:- " $( cat .go-version) " } "
21
+ GO_IMAGE=public.ecr.aws/docker/library/golang:$GO_VERSION
22
+
23
+ # gotoolchain
24
+ # https://go.dev/doc/toolchain
25
+ export GOSUMDB=" sum.golang.org"
26
+ export GOTOOLCHAIN=go${GO_VERSION}
27
+
28
+ # force go modules
29
+ export GO111MODULE=on
30
+
31
+ echo $GO_IMAGE
Original file line number Diff line number Diff line change @@ -78,6 +78,10 @@ if [[ "${CREATE_TEST_ROLE}" = "true" ]]; then
78
78
TEST_ROLE_ARN=" $( echo ${create_role_output} | jq -r ' .Role.Arn' ) "
79
79
fi
80
80
81
+ source hack/setup-go.sh
82
+
83
+ go version
84
+
81
85
make clean
82
86
make bin
83
87
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ # Copyright 2016 The Kubernetes Authors.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ set -o errexit
18
+ set -o pipefail
19
+ set -o nounset
20
+
21
+ # cd to the repo root and setup go
22
+ REPO_ROOT=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " /.. & > /dev/null && pwd) "
23
+
24
+ source hack/setup-go.sh
25
+
26
+ pushd ${REPO_ROOT}
27
+
28
+ go version
29
+ go test -v -coverprofile=coverage.out -race sigs.k8s.io/aws-iam-authenticator/pkg/...
30
+ go tool cover -html=coverage.out -o coverage.html
31
+ popd
You can’t perform that action at this time.
0 commit comments