Skip to content

Commit

Permalink
Merge pull request #54 from pfnet/go122
Browse files Browse the repository at this point in the history
Bump Go to 1.22
  • Loading branch information
ordovicia authored Aug 2, 2024
2 parents 08d19b1 + 9e229d2 commit 8e432d3
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ issues:
linters:
disable-all: true
enable:
- copyloopvar
- dupl
- errcheck
- exportloopref
- goconst
- gocyclo
- gofmt
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.21 as builder
FROM golang:1.22 as builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out

GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.54.2
GOLANGCI_LINT_VERSION ?= v1.59.1
golangci-lint:
@[ -f $(GOLANGCI_LINT) ] || { \
set -e ;\
Expand Down Expand Up @@ -156,7 +156,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest

## Tool Versions
KUSTOMIZE_VERSION ?= v5.2.1
CONTROLLER_TOOLS_VERSION ?= v0.13.0
CONTROLLER_TOOLS_VERSION ?= v0.15.0

.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/pfnet/image-pull-secrets-provisioner

go 1.21
go 1.22

toolchain go1.22.5

require (
github.com/aws/aws-sdk-go-v2/credentials v1.17.27
Expand Down
2 changes: 1 addition & 1 deletion hack/credits.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21 as builder
FROM golang:1.22 as builder

WORKDIR /workspace

Expand Down
1 change: 0 additions & 1 deletion internal/controller/aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ func TestAWSExtractRegion(t *testing.T) {
wantErr: true,
},
} {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion internal/controller/evictor.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ func (e *evictor) listPodsToEvict(

targets := []*corev1.Pod{}
for _, pod := range pods.Items {
pod := pod
if e.hasImagePullSecret(&pod, secret) {
continue
}
Expand Down
3 changes: 1 addition & 2 deletions internal/controller/serviceaccount_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,12 +431,11 @@ func (r *serviceAccountReconciler) listImagePullSecretsToCleanup(

targets := []*corev1.Secret{}
for _, secret := range secrets.Items {
secret := &secret
if secret.GetName() == inUse {
continue
}

targets = append(targets, secret)
targets = append(targets, &secret)
}

return targets, nil
Expand Down

0 comments on commit 8e432d3

Please sign in to comment.