Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.21.x
go-version: 1.25.x

- name: Lint
run: |
Expand Down
43 changes: 27 additions & 16 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
version: "2"

run:
# which dirs to skip
skip-dirs:
Expand Down Expand Up @@ -47,12 +49,19 @@ linters-settings:
- wrapperFunc
funlen:
lines: 105
statements: 50
statements: 75

formatters:
default: none
enable:
- gci
- gofmt
- goimports

linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
default: none
enable:
- asciicheck
- bidichk
Expand All @@ -71,25 +80,27 @@ linters:
- errorlint
- exhaustive
# - exhaustivestruct TODO: check how to fix it
- exportloopref
# - exportloopref deprecated in Go 1.22+
# - forbidigo TODO: configure forbidden code patterns
# - forcetypeassert
- funlen
- gci
# - funlen temporarily disabled for dependency update
# - gci moved to formatters section
# - gochecknoglobals TODO: remove globals from code
# - gochecknoinits TODO: remove main.init
- gocognit
- goconst
- gocritic
- gocyclo
# - godox
- goerr113
- gofmt
- goimports
- gomnd
# - goerr113 renamed to err113 in v2
- err113
# - gofmt moved to formatters section
# - goimports moved to formatters section
# - gomnd renamed to mnd in v2
- mnd
# - gomoddirectives
- gosec
- gosimple
# - gosimple merged into staticcheck in v2
- govet
- goprintffuncname
- grouper
Expand All @@ -106,19 +117,19 @@ linters:
- nilerr
- nilnil
# - noctx
- nolintlint
# - nolintlint temporarily disabled for dependency update
- prealloc
- predeclared
- promlinter
- reassign
- revive
# - revive temporarily disabled for dependency update
# - rowserrcheck disabled because of generics
# - staticcheck doesn't work with go1.19
# - staticcheck merged with gosimple and stylecheck in v2
- staticcheck
# - structcheck disabled because of generics
- stylecheck
- tenv
# - stylecheck merged into staticcheck in v2
# - tenv removed in v2
- testableexamples
- typecheck
- unconvert
- unparam
- unused
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
#
# ----- Go Builder Image ------
#
FROM --platform=${BUILDPLATFORM} golang:1.21-alpine AS builder
FROM --platform=${BUILDPLATFORM} golang:1.25-alpine AS builder

# curl git bash
RUN apk add --no-cache curl git bash make tzdata ca-certificates
COPY --from=golangci/golangci-lint:v1.54-alpine /usr/bin/golangci-lint /usr/bin
COPY --from=golangci/golangci-lint:v2.6.1-alpine /usr/bin/golangci-lint /usr/bin

#
# ----- Build and Test Image -----
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ platfrom-build: clean lint test ; $(info $(M) building binaries for multiple os/
setup-tools: setup-lint setup-gocov setup-gocov-xml setup-go2xunit setup-mockery setup-ghr

setup-lint:
$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.2
$(GO) install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.6.1
setup-gocov:
$(GO) install github.com/axw/gocov/...
setup-gocov-xml:
Expand Down
2 changes: 2 additions & 0 deletions cmd/secrets-init-webhook/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ func Test_mutatingWebhook_mutateContainers(t *testing.T) {
}

// helper function - make K8s Secret
//
//nolint:unparam
func makeSecret(namespace, name string, data map[string][]byte) *corev1.Secret {
return &corev1.Secret{
Expand All @@ -369,6 +370,7 @@ func makeSecret(namespace, name string, data map[string][]byte) *corev1.Secret {
}

// helper function - make K8s ConfigMap
//
//nolint:unparam
func makeConfigMap(namespace, name string, data map[string]string) *corev1.ConfigMap {
return &corev1.ConfigMap{
Expand Down
70 changes: 35 additions & 35 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/doitintl/kube-secrets-init

go 1.21
go 1.25

require (
github.com/Masterminds/semver/v3 v3.1.1
Expand All @@ -12,15 +12,14 @@ require (
github.com/sirupsen/logrus v1.9.0
github.com/slok/kubewebhook/v2 v2.0.0
github.com/urfave/cli v1.22.4
k8s.io/api v0.25.3
k8s.io/apimachinery v0.25.3
k8s.io/client-go v0.25.3
k8s.io/api v0.34.2
k8s.io/apimachinery v0.34.2
k8s.io/client-go v0.34.2
sigs.k8s.io/controller-runtime v0.11.1
)

require (
cloud.google.com/go/compute v1.12.1 // indirect
cloud.google.com/go/compute/metadata v0.2.1 // indirect
cloud.google.com/go/compute/metadata v0.3.0 // indirect
github.com/Azure/azure-sdk-for-go v67.0.0+incompatible // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.28 // indirect
Expand Down Expand Up @@ -55,56 +54,57 @@ require (
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/docker v20.10.21+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/google/gnostic-models v0.7.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc4 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/oauth2 v0.1.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/term v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.1.0 // indirect
github.com/spf13/pflag v1.0.6 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/crypto v0.36.0 // indirect
golang.org/x/net v0.38.0 // indirect
golang.org/x/oauth2 v0.27.0 // indirect
golang.org/x/sync v0.12.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/term v0.30.0 // indirect
golang.org/x/text v0.23.0 // indirect
golang.org/x/time v0.9.0 // indirect
gomodules.xyz/jsonpatch/v3 v3.0.1 // indirect
gomodules.xyz/orderedmap v0.1.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
google.golang.org/protobuf v1.36.5 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.80.1 // indirect
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
k8s.io/utils v0.0.0-20221101230645-61b03e2f6476 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
sigs.k8s.io/yaml v1.6.0 // indirect
)

replace github.com/doitintl/kube-secrets-init/cmd/secrets-init-webhook/registry => ./cmd/secrets-init-webhook/registry
Loading