Skip to content

Commit 7d8d7ae

Browse files
authored
chore: disable automatic k8s.io package updates (#94)
as there are few more things to do when updating k8s.io/controller-runtime (e.g. using the same version in kind cluster - relevant when we start with integration tests) we will disable the dump dependabot update PRs Signed-off-by: Mario Constanti <[email protected]>
1 parent acb41e2 commit 7d8d7ae

File tree

3 files changed

+30
-6
lines changed

3 files changed

+30
-6
lines changed

.github/dependabot.yml

+15-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,20 @@
77

88
version: 2
99
updates:
10-
- package-ecosystem: "gomod" # See documentation for possible values
11-
directory: "/" # Location of package manifests
10+
- package-ecosystem: "github-actions"
11+
directory: "/"
1212
schedule:
1313
interval: "weekly"
14+
- package-ecosystem: "gomod"
15+
directory: "/"
16+
schedule:
17+
interval: "weekly"
18+
ignore:
19+
# Ignore k8s, controller-runtime and its transitives modules as they are upgraded manually.
20+
# we also have to update local kind cluster configuration (hack/kind-with-registry.sh)
21+
- dependency-name: "sigs.k8s.io/controller-runtime"
22+
update-types:
23+
["version-update:semver-major", "version-update:semver-minor"]
24+
- dependency-name: "k8s.io/*"
25+
update-types:
26+
["version-update:semver-major", "version-update:semver-minor"]

Makefile

+9-1
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ SLICE ?= $(LOCALBIN)/kubectl-slice
171171
NANCY ?= $(LOCALBIN)/nancy
172172
GOVULNCHECK ?= $(LOCALBIN)/govulncheck
173173
KBOM ?= $(LOCALBIN)/bom
174+
KIND ?= $(LOCALBIN)/kind
174175

175176
## Tool Versions
176177
KUSTOMIZE_VERSION ?= v5.0.1
@@ -182,6 +183,7 @@ MDTOC_VERSION ?= v1.1.0
182183
SLICE_VERSION ?= v1.2.6
183184
NANCY_VERSION ?= v1.0.42
184185
KBOM_VERSION ?= v0.5.1
186+
KIND_VERSION ?= v0.22.0
185187

186188
.PHONY: kustomize
187189
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.
@@ -246,11 +248,17 @@ $(GOVULNCHECK): $(LOCALBIN)
246248
GOBIN=$(LOCALBIN) go install golang.org/x/vuln/cmd/govulncheck@latest
247249

248250
.PHONY: kbom
249-
kbom: $(KBOM) ## Download nancy locally if necessary. If wrong version is installed, it will be overwritten.
251+
kbom: $(KBOM) ## Download kbom locally if necessary. If wrong version is installed, it will be overwritten.
250252
$(KBOM): $(LOCALBIN)
251253
test -s $(LOCALBIN)/bom && $(LOCALBIN)/bom version | grep -q $(KBOM_VERSION) || \
252254
GOBIN=$(LOCALBIN) go install sigs.k8s.io/bom/cmd/bom@$(KBOM_VERSION)
253255

256+
.PHONY: kind
257+
kind: $(KIND) ## Download kind locally if necessary. If wrong version is installed, it will be overwritten.
258+
$(KIND): $(LOCALBIN)
259+
test -s $(LOCALBIN)/kind && $(LOCALBIN)/kind version | grep -q $(KIND_VERSION) || \
260+
GOBIN=$(LOCALBIN) go install sigs.k8s.io/kind@$(KIND_VERSION)
261+
254262
##@ Lint / Verify
255263
.PHONY: lint
256264
lint: $(GOLANGCI_LINT) ## Run linting.

hack/kind-with-registry.sh

+6-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ if [[ "${TRACE-0}" == "1" ]]; then
1818
fi
1919

2020
KIND_CLUSTER_NAME=${CAPI_KIND_CLUSTER_NAME:-"garm-operator"}
21+
KIND_BINARY="bin/kind"
22+
# available versions can be found at https://github.com/kubernetes-sigs/kind/releases
23+
NODE_IMAGE="kindest/node:v1.28.7@sha256:9bc6c451a289cf96ad0bbaf33d416901de6fd632415b076ab05f5fa7e4f65c58"
2124

2225
# 1. If kind cluster already exists exit.
23-
if [[ "$(kind get clusters)" =~ .*"${KIND_CLUSTER_NAME}".* ]]; then
26+
if [[ "$(${KIND_BINARY} get clusters)" =~ .*"${KIND_CLUSTER_NAME}".* ]]; then
2427
echo "kind cluster already exists, moving on"
2528
exit 0
2629
fi
@@ -42,7 +45,7 @@ fi
4245
# https://github.com/kubernetes-sigs/kind/issues/2875
4346
# https://github.com/containerd/containerd/blob/main/docs/cri/config.md#registry-configuration
4447
# See: https://github.com/containerd/containerd/blob/main/docs/hosts.md
45-
cat <<EOF | kind create cluster --name="$KIND_CLUSTER_NAME" --config=-
48+
cat <<EOF | "${KIND_BINARY}" create cluster --name="${KIND_CLUSTER_NAME}" --image="${NODE_IMAGE}" --config=-
4649
kind: Cluster
4750
apiVersion: kind.x-k8s.io/v1alpha4
4851
containerdConfigPatches:
@@ -59,7 +62,7 @@ EOF
5962
# We want a consistent name that works from both ends, so we tell containerd to
6063
# alias localhost:${reg_port} to the registry container when pulling images
6164
REGISTRY_DIR="/etc/containerd/certs.d/localhost:${reg_port}"
62-
for node in $(kind get nodes --name "$KIND_CLUSTER_NAME"); do
65+
for node in $(${KIND_BINARY} get nodes --name "${KIND_CLUSTER_NAME}"); do
6366
docker exec "${node}" mkdir -p "${REGISTRY_DIR}"
6467
cat <<EOF | docker exec -i "${node}" cp /dev/stdin "${REGISTRY_DIR}/hosts.toml"
6568
[host."http://${reg_name}:5000"]

0 commit comments

Comments
 (0)