Skip to content

Commit 3736d67

Browse files
committed
Merge branch 'main' into ghvalkeyconfig
Signed-off-by: utdrmac <matthew.boehm@percona.com>
2 parents a2c1818 + 9a724fb commit 3736d67

30 files changed

Lines changed: 1097 additions & 528 deletions

.devcontainer/devcontainer.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
{
22
"name": "Kubebuilder DevContainer",
3-
"image": "golang:1.24",
3+
"image": "golang:1.25",
44
"features": {
5-
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
5+
"ghcr.io/devcontainers/features/docker-in-docker:2": {
6+
"moby": false,
7+
"dockerDefaultAddressPool": "base=172.30.0.0/16,size=24"
8+
},
69
"ghcr.io/devcontainers/features/git:1": {}
710
},
811

9-
"runArgs": ["--network=host"],
12+
"runArgs": ["--privileged", "--init"],
1013

1114
"customizations": {
1215
"vscode": {
@@ -20,6 +23,10 @@
2023
}
2124
},
2225

26+
"remoteEnv": {
27+
"GO111MODULE": "on"
28+
},
29+
2330
"onCreateCommand": "bash .devcontainer/post-install.sh"
2431
}
2532

.devcontainer/post-install.sh

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,52 @@
11
#!/bin/bash
2-
set -x
2+
set -euo pipefail
33

4-
curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-$(go env GOARCH)
5-
chmod +x ./kind
6-
mv ./kind /usr/local/bin/kind
4+
echo "Installing Kubebuilder development tools..."
75

8-
curl -L -o kubebuilder https://go.kubebuilder.io/dl/latest/linux/$(go env GOARCH)
9-
chmod +x kubebuilder
10-
mv kubebuilder /usr/local/bin/
6+
ARCH=$(go env GOARCH)
117

12-
KUBECTL_VERSION=$(curl -L -s https://dl.k8s.io/release/stable.txt)
13-
curl -LO "https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/$(go env GOARCH)/kubectl"
14-
chmod +x kubectl
15-
mv kubectl /usr/local/bin/kubectl
8+
# Install kind
9+
if ! command -v kind &> /dev/null; then
10+
curl -Lo ./kind "https://kind.sigs.k8s.io/dl/latest/kind-linux-${ARCH}"
11+
chmod +x ./kind
12+
mv ./kind /usr/local/bin/kind
13+
fi
1614

17-
docker network create -d=bridge --subnet=172.19.0.0/24 kind
15+
# Install kubebuilder
16+
if ! command -v kubebuilder &> /dev/null; then
17+
curl -L -o kubebuilder "https://go.kubebuilder.io/dl/latest/linux/${ARCH}"
18+
chmod +x kubebuilder
19+
mv kubebuilder /usr/local/bin/
20+
fi
1821

22+
# Install kubectl
23+
if ! command -v kubectl &> /dev/null; then
24+
KUBECTL_VERSION=$(curl -L -s https://dl.k8s.io/release/stable.txt)
25+
curl -LO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/${ARCH}/kubectl"
26+
chmod +x kubectl
27+
mv kubectl /usr/local/bin/kubectl
28+
fi
29+
30+
# Wait for Docker to be ready
31+
for i in {1..30}; do
32+
if docker info >/dev/null 2>&1; then
33+
break
34+
fi
35+
if [ $i -eq 30 ]; then
36+
echo "WARNING: Docker not ready after 30s"
37+
fi
38+
sleep 1
39+
done
40+
41+
# Create kind network, ignore errors if exists or conflicts
42+
docker network inspect kind >/dev/null 2>&1 || docker network create kind || true
43+
44+
# Verify installations
45+
echo "Installed versions:"
1946
kind version
2047
kubebuilder version
48+
kubectl version --client
2149
docker --version
2250
go version
23-
kubectl version --client
51+
52+
echo "DevContainer ready!"

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"

.github/workflows/auto_update.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
# Step 1: Checkout the repository.
2525
steps:
2626
- name: Checkout repository
27-
uses: actions/checkout@v4
27+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2828
with:
2929
token: ${{ secrets.GITHUB_TOKEN }}
3030
fetch-depth: 0
@@ -37,7 +37,7 @@ jobs:
3737
3838
# Step 3: Set up Go environment.
3939
- name: Set up Go
40-
uses: actions/setup-go@v5
40+
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
4141
with:
4242
go-version: stable
4343

.github/workflows/lint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Clone the code
13-
uses: actions/checkout@v4
13+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1414

1515
- name: Setup Go
16-
uses: actions/setup-go@v5
16+
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
1717
with:
1818
go-version-file: go.mod
1919

2020
- name: Run linter
21-
uses: golangci/golangci-lint-action@v8
21+
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
2222
with:
23-
version: v2.4.0
23+
version: v2.7.2

.github/workflows/test-e2e.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Clone the code
13-
uses: actions/checkout@v4
13+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1414

1515
- name: Setup Go
16-
uses: actions/setup-go@v5
16+
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
1717
with:
1818
go-version-file: go.mod
1919

2020
- name: Install the latest version of kind
2121
run: |
22-
curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64
22+
curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-$(go env GOARCH)
2323
chmod +x ./kind
2424
sudo mv ./kind /usr/local/bin/kind
2525

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Clone the code
13-
uses: actions/checkout@v4
13+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1414

1515
- name: Setup Go
16-
uses: actions/setup-go@v5
16+
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
1717
with:
1818
go-version-file: go.mod
1919

.golangci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ linters:
1313
- govet
1414
- ineffassign
1515
- lll
16+
- modernize
1617
- misspell
1718
- nakedret
1819
- prealloc
@@ -26,6 +27,9 @@ linters:
2627
rules:
2728
- name: comment-spacings
2829
- name: import-shadowing
30+
modernize:
31+
disable:
32+
- omitzero
2933
exclusions:
3034
generated: lax
3135
rules:

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.24 AS builder
2+
FROM golang:1.25 AS builder
33
ARG TARGETOS
44
ARG TARGETARCH
55

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ setup-test-e2e: ## Set up a Kind cluster for e2e tests if it does not exist
7878
echo "Kind cluster '$(KIND_CLUSTER)' already exists. Skipping creation." ;; \
7979
*) \
8080
echo "Creating Kind cluster '$(KIND_CLUSTER)'..."; \
81-
$(KIND) create cluster --name $(KIND_CLUSTER) ;; \
81+
echo '{"kind": "Cluster", "apiVersion": "kind.x-k8s.io/v1alpha4", "nodes": [{"role": "control-plane"}, {"role": "worker"}, {"role": "worker"}]}' | $(KIND) create cluster --name $(KIND_CLUSTER) --config - ;; \
8282
esac
8383

8484
.PHONY: test-e2e
8585
test-e2e: setup-test-e2e manifests generate fmt vet ## Run the e2e tests. Expected an isolated environment using Kind.
86-
KIND=$(KIND) KIND_CLUSTER=$(KIND_CLUSTER) go test -tags=e2e ./test/e2e/ -v -ginkgo.v
86+
KIND=$(KIND) KIND_CLUSTER=$(KIND_CLUSTER) go test -tags=e2e ./test/e2e/ -v -ginkgo.v -ginkgo.label-filter "${TEST_LABELS}"
8787
$(MAKE) cleanup-test-e2e
8888

8989
.PHONY: cleanup-test-e2e
@@ -188,7 +188,7 @@ GOLANGCI_LINT = $(LOCALBIN)/golangci-lint
188188

189189
## Tool Versions
190190
KUSTOMIZE_VERSION ?= v5.7.1
191-
CONTROLLER_TOOLS_VERSION ?= v0.19.0
191+
CONTROLLER_TOOLS_VERSION ?= v0.20.0
192192

193193
#ENVTEST_VERSION is the version of controller-runtime release branch to fetch the envtest setup script (i.e. release-0.20)
194194
ENVTEST_VERSION ?= $(shell v='$(call gomodver,sigs.k8s.io/controller-runtime)'; \
@@ -200,7 +200,7 @@ ENVTEST_K8S_VERSION ?= $(shell v='$(call gomodver,k8s.io/api)'; \
200200
[ -n "$$v" ] || { echo "Set ENVTEST_K8S_VERSION manually (k8s.io/api replace has no tag)" >&2; exit 1; }; \
201201
printf '%s\n' "$$v" | sed -E 's/^v?[0-9]+\.([0-9]+).*/1.\1/')
202202

203-
GOLANGCI_LINT_VERSION ?= v2.5.0
203+
GOLANGCI_LINT_VERSION ?= v2.7.2
204204
.PHONY: kustomize
205205
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
206206
$(KUSTOMIZE): $(LOCALBIN)

0 commit comments

Comments
 (0)