Skip to content

Commit 4195e4a

Browse files
author
Jelle Dijkstra
committed
(chore) initial scaffold from release version: v4.5.1
1 parent 0d97bfb commit 4195e4a

File tree

98 files changed

+1038
-7563
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+1038
-7563
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Kubebuilder DevContainer",
3-
"image": "docker.io/golang:1.24",
3+
"image": "docker.io/golang:1.23",
44
"features": {
55
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
66
"ghcr.io/devcontainers/features/git:1": {}

.github/workflows/build-and-publish-image.yml

Lines changed: 0 additions & 67 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Lint
22

33
on:
44
push:
5-
branches:
6-
- master
75
pull_request:
86

97
jobs:
@@ -20,6 +18,6 @@ jobs:
2018
go-version-file: go.mod
2119

2220
- name: Run linter
23-
uses: golangci/golangci-lint-action@v3
21+
uses: golangci/golangci-lint-action@v6
2422
with:
25-
version: v1.64.5
23+
version: v1.63.4

.github/workflows/test-e2e.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: E2E Tests
22

33
on:
44
push:
5-
branches:
6-
- master
75
pull_request:
86

97
jobs:

.github/workflows/test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Tests
22

33
on:
44
push:
5-
branches:
6-
- master
75
pull_request:
86

97
jobs:

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,3 @@ go.work
2525
*.swp
2626
*.swo
2727
*~
28-
29-
/certs

.golangci.yml

Lines changed: 37 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,47 @@
1-
---
21
run:
3-
# Timeout for analysis.
42
timeout: 5m
5-
6-
# Modules download mode (do not modify go.mod)
7-
module-download-mode: readonly
8-
9-
# Include test files (see below to exclude certain linters)
10-
tests: true
3+
allow-parallel-runners: true
114

125
issues:
6+
# don't skip warning about doc comments
7+
# don't exclude the default set of lint
8+
exclude-use-default: false
9+
# restore some of the defaults
10+
# (fill in the rest as needed)
1311
exclude-rules:
14-
# Exclude certain linters for test code
15-
- path: "_test\\.go"
12+
- path: "api/*"
13+
linters:
14+
- lll
15+
- path: "internal/*"
1616
linters:
17-
- bodyclose
1817
- dupl
19-
- dogsled
20-
- funlen
21-
- gosec
22-
23-
output:
24-
formats: colored-line-number
25-
print-issued-lines: true
26-
print-linter-name: true
27-
28-
linters-settings:
29-
depguard:
30-
rules:
31-
main:
32-
# Packages that are not allowed where the value is a suggestion.
33-
deny:
34-
- pkg: "github.com/pkg/errors"
35-
desc: Should be replaced by standard lib errors package
36-
cyclop:
37-
# The maximal code complexity to report.
38-
max-complexity: 15
39-
skip-tests: true
40-
funlen:
41-
lines: 100
42-
nestif:
43-
min-complexity: 6
44-
forbidigo:
45-
forbid:
46-
- http\.NotFound.* # return RFC 7807 problem details instead
47-
- http\.Error.* # return RFC 7807 problem details instead
48-
gomoddirectives:
49-
replace-allow-list:
50-
- github.com/abbot/go-http-auth # https://github.com/traefik/traefik/issues/6873#issuecomment-637654361
51-
18+
- lll
5219
linters:
5320
disable-all: true
5421
enable:
55-
# enabled by default by golangci-lint
56-
- errcheck # checking for unchecked errors, these unchecked errors can be critical bugs in some cases
57-
- gosimple # specializes in simplifying a code
58-
- govet # reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
59-
- ineffassign # detects when assignments to existing variables are not used
60-
- staticcheck # is a go vet on steroids, applying a ton of static analysis checks
61-
- typecheck # like the front-end of a Go compiler, parses and type-checks Go code
62-
- unused # checks for unused constants, variables, functions and types
63-
# extra enabled by us
64-
- asasalint # checks for pass []any as any in variadic func(...any)
65-
- asciicheck # checks that your code does not contain non-ASCII identifiers
66-
- bidichk # checks for dangerous unicode character sequences
67-
- bodyclose # checks whether HTTP response body is closed successfully
68-
- cyclop # checks function and package cyclomatic complexity
69-
- dupl # tool for code clone detection
70-
- durationcheck # checks for two durations multiplied together
71-
- dogsled # find assignments/declarations with too many blank identifiers
72-
- errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
73-
- errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
74-
- exhaustive # checks exhaustiveness of enum switch statements
75-
- exptostd # detects functions from golang.org/x/exp/ that can be replaced by std functions
76-
- copyloopvar # checks for pointers to enclosing loop variables
77-
- fatcontext # detects nested contexts in loops and function literals
78-
- forbidigo # forbids identifiers
79-
- funlen # tool for detection of long functions
80-
- gocheckcompilerdirectives # validates go compiler directive comments (//go:)
81-
- goconst # finds repeated strings that could be replaced by a constant
82-
- gocritic # provides diagnostics that check for bugs, performance and style issues
83-
- gofmt # checks if the code is formatted according to 'gofmt' command
84-
- goimports # in addition to fixing imports, goimports also formats your code in the same style as gofmt
85-
- gomoddirectives # manages the use of 'replace', 'retract', and 'excludes' directives in go.mod
86-
- gomodguard # allow and block lists linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations
87-
- goprintffuncname # checks that printf-like functions are named with f at the end
88-
- gosec # inspects source code for security problems
89-
- loggercheck # checks key value pairs for common logger libraries (kitlog,klog,logr,zap)
90-
- makezero # finds slice declarations with non-zero initial length
91-
- mirror # reports wrong mirror patterns of bytes/strings usage
92-
- misspell # finds commonly misspelled English words
93-
- nakedret # finds naked returns in functions greater than a specified function length
94-
- nestif # reports deeply nested if statements
95-
- nilerr # finds the code that returns nil even if it checks that the error is not nil
96-
- nolintlint # reports ill-formed or insufficient nolint directives
97-
- nosprintfhostport # checks for misuse of Sprintf to construct a host with port in a URL
98-
- perfsprint # Golang linter for performance, aiming at usages of fmt.Sprintf which have faster alternatives
99-
- predeclared # finds code that shadows one of Go's predeclared identifiers
100-
- promlinter # checks Prometheus metrics naming via promlint
101-
- reassign # checks that package variables are not reassigned
102-
- revive # fast, configurable, extensible, flexible, and beautiful linter for Go, drop-in replacement of golint
103-
- rowserrcheck # checks whether Err of rows is checked successfully
104-
- sqlclosecheck # checks that sql.Rows and sql.Stmt are closed
105-
- sloglint # A Go linter that ensures consistent code style when using log/slog
106-
- tagliatelle # checks the struct tags.
107-
- testableexamples # checks if examples are testable (have an expected output)
108-
- tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes
109-
- usetesting # detects using os.Setenv instead of t.Setenv since Go1.17
110-
- unconvert # removes unnecessary type conversions
111-
- unparam # reports unused function parameters
112-
- usestdlibvars # detects the possibility to use variables/constants from the Go standard library
113-
- wastedassign # finds wasted assignment statements
114-
fast: false
22+
- dupl
23+
- errcheck
24+
- copyloopvar
25+
- ginkgolinter
26+
- goconst
27+
- gocyclo
28+
- gofmt
29+
- goimports
30+
- gosimple
31+
- govet
32+
- ineffassign
33+
- lll
34+
- misspell
35+
- nakedret
36+
- prealloc
37+
- revive
38+
- staticcheck
39+
- typecheck
40+
- unconvert
41+
- unparam
42+
- unused
43+
44+
linters-settings:
45+
revive:
46+
rules:
47+
- name: comment-spacings

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# Build the manager binary
2-
FROM docker.io/golang:1.24 AS builder
2+
FROM docker.io/golang:1.23 AS builder
33
ARG TARGETOS
44
ARG TARGETARCH
55

66
WORKDIR /workspace
77
# Copy the Go Modules manifests
88
COPY go.mod go.mod
99
COPY go.sum go.sum
10-
1110
# cache deps before building and copying source so that we don't need to re-download as much
1211
# and so that source changes don't invalidate our downloaded layer
1312
RUN go mod download

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

Makefile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ help: ## Display this help.
4343

4444
.PHONY: manifests
4545
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
46-
$(CONTROLLER_GEN) rbac:roleName=manager-role crd:allowDangerousTypes=true webhook paths="./..." output:crd:artifacts:config=config/crd/bases
46+
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
4747

4848
.PHONY: generate
4949
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
@@ -63,8 +63,7 @@ test: manifests generate fmt vet setup-envtest ## Run tests.
6363

6464
# TODO(user): To use a different vendor for e2e tests, modify the setup under 'tests/e2e'.
6565
# The default setup assumes Kind is pre-installed and builds/loads the Manager Docker image locally.
66-
# Prometheus and CertManager are installed by default; skip with:
67-
# - PROMETHEUS_INSTALL_SKIP=true
66+
# CertManager is installed by default; skip with:
6867
# - CERT_MANAGER_INSTALL_SKIP=true
6968
.PHONY: test-e2e
7069
test-e2e: manifests generate fmt vet ## Run the e2e tests. Expected an isolated environment using Kind.
@@ -122,10 +121,10 @@ PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
122121
docker-buildx: ## Build and push docker image for the manager for cross-platform support
123122
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
124123
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
125-
- $(CONTAINER_TOOL) buildx create --name atom-operator-builder
126-
$(CONTAINER_TOOL) buildx use atom-operator-builder
124+
- $(CONTAINER_TOOL) buildx create --name atom-operator-v3-builder
125+
$(CONTAINER_TOOL) buildx use atom-operator-v3-builder
127126
- $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross .
128-
- $(CONTAINER_TOOL) buildx rm atom-operator-builder
127+
- $(CONTAINER_TOOL) buildx rm atom-operator-v3-builder
129128
rm Dockerfile.cross
130129

131130
.PHONY: build-installer
@@ -173,7 +172,7 @@ GOLANGCI_LINT = $(LOCALBIN)/golangci-lint
173172

174173
## Tool Versions
175174
KUSTOMIZE_VERSION ?= v5.5.0
176-
CONTROLLER_TOOLS_VERSION ?= v0.17.1
175+
CONTROLLER_TOOLS_VERSION ?= v0.17.2
177176
#ENVTEST_VERSION is the version of controller-runtime release branch to fetch the envtest setup script (i.e. release-0.20)
178177
ENVTEST_VERSION ?= $(shell go list -m -f "{{ .Version }}" sigs.k8s.io/controller-runtime | awk -F'[v.]' '{printf "release-%d.%d", $$2, $$3}')
179178
#ENVTEST_K8S_VERSION is the version of Kubernetes to use for setting up ENVTEST binaries (i.e. 1.31)

0 commit comments

Comments
 (0)