Skip to content

Commit 4e89eb2

Browse files
authored
Dependency maintenance (#318)
* Basic dependency maintenance * Use `go tool` for tooling dependencies * More modern prometheus have less stringent label requirements. Change to a label name invalid for new prometheuses.
2 parents 27fcf6d + 3b48cb8 commit 4e89eb2

14 files changed

Lines changed: 293 additions & 380 deletions

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ include Makefile.vars.mk
1313
e2e_make := $(MAKE) -C e2e
1414
go_build ?= go build -o $(BIN_FILENAME) main.go
1515

16-
setup-envtest ?= go run sigs.k8s.io/controller-runtime/tools/setup-envtest
16+
setup-envtest ?= go tool sigs.k8s.io/controller-runtime/tools/setup-envtest
1717

1818
# Run tests (see https://book.kubebuilder.io/reference/envtest.html?highlight=envtest#configuring-envtest-for-integration-tests)
1919
ENVTEST_ASSETS_DIR=$(shell pwd)/testbin

Makefile.vars.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ CRD_ROOT_DIR ?= config/crd/
1010
CRD_DOCS_REF_PATH ?= docs/modules/ROOT/pages/references/api-reference.adoc
1111

1212
KIND_NODE_VERSION ?= v1.24.2
13-
KIND ?= go run sigs.k8s.io/kind
13+
KIND ?= go tool sigs.k8s.io/kind
1414

1515
ENABLE_LEADER_ELECTION ?= false
1616

@@ -26,7 +26,7 @@ BATS_FILES ?= .
2626

2727
INTEGRATION_TEST_DEBUG_OUTPUT ?= false
2828

29-
KUSTOMIZE ?= go run sigs.k8s.io/kustomize/kustomize/v5
29+
KUSTOMIZE ?= go tool sigs.k8s.io/kustomize/kustomize/v5
3030

3131
# Image URL to use all building/pushing image targets
3232
DOCKER_IMG ?= docker.io/projectsyn/lieutenant-operator:$(IMG_TAG)

config/crd/bases/syn.tools_clusters.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.15.0
6+
controller-gen.kubebuilder.io/version: v0.18.0
77
name: clusters.syn.tools
88
spec:
99
group: syn.tools
@@ -119,7 +119,6 @@ spec:
119119
description: |-
120120
CIVariables is a list of key-value pairs that will be set as CI variables in the Git repository.
121121
122-
123122
The variables are not expanded like PodSpec environment variables.
124123
items:
125124
description: EnvVar represents an environment added to the CI
@@ -171,9 +170,7 @@ spec:
171170
This field is effectively required, but due to backwards compatibility is
172171
allowed to be empty. Instances of this type with an empty value here are
173172
almost certainly wrong.
174-
TODO: Add other useful fields. apiVersion, kind, uid?
175173
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
176-
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
177174
type: string
178175
optional:
179176
description: Specify whether the Secret or its key
@@ -277,9 +274,7 @@ spec:
277274
This field is effectively required, but due to backwards compatibility is
278275
allowed to be empty. Instances of this type with an empty value here are
279276
almost certainly wrong.
280-
TODO: Add other useful fields. apiVersion, kind, uid?
281277
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
282-
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
283278
type: string
284279
type: object
285280
x-kubernetes-map-type: atomic

config/crd/bases/syn.tools_gitrepos.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.15.0
6+
controller-gen.kubebuilder.io/version: v0.18.0
77
name: gitrepos.syn.tools
88
spec:
99
group: syn.tools
@@ -83,7 +83,6 @@ spec:
8383
description: |-
8484
CIVariables is a list of key-value pairs that will be set as CI variables in the Git repository.
8585
86-
8786
The variables are not expanded like PodSpec environment variables.
8887
items:
8988
description: EnvVar represents an environment added to the CI system
@@ -131,9 +130,7 @@ spec:
131130
This field is effectively required, but due to backwards compatibility is
132131
allowed to be empty. Instances of this type with an empty value here are
133132
almost certainly wrong.
134-
TODO: Add other useful fields. apiVersion, kind, uid?
135133
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
136-
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
137134
type: string
138135
optional:
139136
description: Specify whether the Secret or its key must
@@ -220,9 +217,7 @@ spec:
220217
This field is effectively required, but due to backwards compatibility is
221218
allowed to be empty. Instances of this type with an empty value here are
222219
almost certainly wrong.
223-
TODO: Add other useful fields. apiVersion, kind, uid?
224220
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
225-
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
226221
type: string
227222
type: object
228223
x-kubernetes-map-type: atomic

config/crd/bases/syn.tools_tenants.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.15.0
6+
controller-gen.kubebuilder.io/version: v0.18.0
77
name: tenants.syn.tools
88
spec:
99
group: syn.tools
@@ -124,7 +124,6 @@ spec:
124124
description: |-
125125
CIVariables is a list of key-value pairs that will be set as CI variables in the Git repository.
126126
127-
128127
The variables are not expanded like PodSpec environment variables.
129128
items:
130129
description: EnvVar represents an environment added to the
@@ -176,9 +175,7 @@ spec:
176175
This field is effectively required, but due to backwards compatibility is
177176
allowed to be empty. Instances of this type with an empty value here are
178177
almost certainly wrong.
179-
TODO: Add other useful fields. apiVersion, kind, uid?
180178
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
181-
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
182179
type: string
183180
optional:
184181
description: Specify whether the Secret or its
@@ -285,9 +282,7 @@ spec:
285282
This field is effectively required, but due to backwards compatibility is
286283
allowed to be empty. Instances of this type with an empty value here are
287284
almost certainly wrong.
288-
TODO: Add other useful fields. apiVersion, kind, uid?
289285
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
290-
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
291286
type: string
292287
type: object
293288
x-kubernetes-map-type: atomic
@@ -373,7 +368,6 @@ spec:
373368
description: |-
374369
CIVariables is a list of key-value pairs that will be set as CI variables in the Git repository.
375370
376-
377371
The variables are not expanded like PodSpec environment variables.
378372
items:
379373
description: EnvVar represents an environment added to the CI
@@ -425,9 +419,7 @@ spec:
425419
This field is effectively required, but due to backwards compatibility is
426420
allowed to be empty. Instances of this type with an empty value here are
427421
almost certainly wrong.
428-
TODO: Add other useful fields. apiVersion, kind, uid?
429422
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
430-
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
431423
type: string
432424
optional:
433425
description: Specify whether the Secret or its key

config/crd/bases/syn.tools_tenanttemplates.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.15.0
6+
controller-gen.kubebuilder.io/version: v0.18.0
77
name: tenanttemplates.syn.tools
88
spec:
99
group: syn.tools
@@ -124,7 +124,6 @@ spec:
124124
description: |-
125125
CIVariables is a list of key-value pairs that will be set as CI variables in the Git repository.
126126
127-
128127
The variables are not expanded like PodSpec environment variables.
129128
items:
130129
description: EnvVar represents an environment added to the
@@ -176,9 +175,7 @@ spec:
176175
This field is effectively required, but due to backwards compatibility is
177176
allowed to be empty. Instances of this type with an empty value here are
178177
almost certainly wrong.
179-
TODO: Add other useful fields. apiVersion, kind, uid?
180178
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
181-
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
182179
type: string
183180
optional:
184181
description: Specify whether the Secret or its
@@ -285,9 +282,7 @@ spec:
285282
This field is effectively required, but due to backwards compatibility is
286283
allowed to be empty. Instances of this type with an empty value here are
287284
almost certainly wrong.
288-
TODO: Add other useful fields. apiVersion, kind, uid?
289285
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
290-
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
291286
type: string
292287
type: object
293288
x-kubernetes-map-type: atomic
@@ -373,7 +368,6 @@ spec:
373368
description: |-
374369
CIVariables is a list of key-value pairs that will be set as CI variables in the Git repository.
375370
376-
377371
The variables are not expanded like PodSpec environment variables.
378372
items:
379373
description: EnvVar represents an environment added to the CI
@@ -425,9 +419,7 @@ spec:
425419
This field is effectively required, but due to backwards compatibility is
426420
allowed to be empty. Instances of this type with an empty value here are
427421
almost certainly wrong.
428-
TODO: Add other useful fields. apiVersion, kind, uid?
429422
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
430-
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
431423
type: string
432424
optional:
433425
description: Specify whether the Secret or its key

config/rbac/role.yaml

Lines changed: 5 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ rules:
77
- apiGroups:
88
- ""
99
resources:
10+
- configmaps
1011
- secrets
1112
- serviceaccounts
1213
verbs:
@@ -26,20 +27,6 @@ rules:
2627
- get
2728
- list
2829
- update
29-
- apiGroups:
30-
- ""
31-
resources:
32-
- configmaps
33-
- secrets
34-
- serviceaccounts
35-
verbs:
36-
- create
37-
- delete
38-
- get
39-
- list
40-
- patch
41-
- update
42-
- watch
4330
- apiGroups:
4431
- rbac.authorization.k8s.io
4532
resources:
@@ -57,57 +44,7 @@ rules:
5744
- syn.tools
5845
resources:
5946
- clusters
60-
verbs:
61-
- create
62-
- delete
63-
- get
64-
- list
65-
- patch
66-
- update
67-
- watch
68-
- apiGroups:
69-
- syn.tools
70-
resources:
71-
- clusters/finalizers
72-
verbs:
73-
- update
74-
- apiGroups:
75-
- syn.tools
76-
resources:
77-
- clusters/status
78-
verbs:
79-
- get
80-
- patch
81-
- update
82-
- apiGroups:
83-
- syn.tools
84-
resources:
8547
- gitrepos
86-
verbs:
87-
- create
88-
- delete
89-
- get
90-
- list
91-
- patch
92-
- update
93-
- watch
94-
- apiGroups:
95-
- syn.tools
96-
resources:
97-
- gitrepos/finalizers
98-
verbs:
99-
- update
100-
- apiGroups:
101-
- syn.tools
102-
resources:
103-
- gitrepos/status
104-
verbs:
105-
- get
106-
- patch
107-
- update
108-
- apiGroups:
109-
- syn.tools
110-
resources:
11148
- tenants
11249
verbs:
11350
- create
@@ -120,12 +57,16 @@ rules:
12057
- apiGroups:
12158
- syn.tools
12259
resources:
60+
- clusters/finalizers
61+
- gitrepos/finalizers
12362
- tenants/finalizers
12463
verbs:
12564
- update
12665
- apiGroups:
12766
- syn.tools
12867
resources:
68+
- clusters/status
69+
- gitrepos/status
12970
- tenants/status
13071
verbs:
13172
- get

docs/modules/ROOT/pages/references/api-reference.adoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,6 @@ The token is stored under the key "token".
407407
In the case of GitLab, this would be a Project Access Token with read-write access to the repository.
408408
| *`ciVariables`* __xref:{anchor_prefix}-github-com-projectsyn-lieutenant-operator-api-v1alpha1-envvar[$$EnvVar$$] array__ | CIVariables is a list of key-value pairs that will be set as CI variables in the Git repository.
409409

410-
411410
The variables are not expanded like PodSpec environment variables.
412411
| *`tenantRef`* __link:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#localobjectreference-v1-core[$$LocalObjectReference$$]__ | TenantRef references the tenant this repo belongs to
413412
|===
@@ -452,7 +451,6 @@ The token is stored under the key "token".
452451
In the case of GitLab, this would be a Project Access Token with read-write access to the repository.
453452
| *`ciVariables`* __xref:{anchor_prefix}-github-com-projectsyn-lieutenant-operator-api-v1alpha1-envvar[$$EnvVar$$] array__ | CIVariables is a list of key-value pairs that will be set as CI variables in the Git repository.
454453

455-
456454
The variables are not expanded like PodSpec environment variables.
457455
|===
458456

e2e/lib/lieutenant.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ teardown() {
4141
}
4242

4343
kustomize() {
44-
go run sigs.k8s.io/kustomize/kustomize/v5 "${@}"
44+
go tool sigs.k8s.io/kustomize/kustomize/v5 "${@}"
4545
}
4646

4747
replace_in_file() {

generate.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
package main
55

6-
//go:generate go run sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
7-
//go:generate go run sigs.k8s.io/controller-tools/cmd/controller-gen rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=${CRD_ROOT_DIR}/bases crd:crdVersions=v1,deprecatedV1beta1CompatibilityPreserveUnknownFields=false
6+
//go:generate go tool sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
7+
//go:generate go tool sigs.k8s.io/controller-tools/cmd/controller-gen rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=${CRD_ROOT_DIR}/bases crd:crdVersions=v1,deprecatedV1beta1CompatibilityPreserveUnknownFields=false
88

99
// Generate API reference documentation
10-
//go:generate go run github.com/elastic/crd-ref-docs --source-path=api/v1alpha1 --config=docs/api-gen-config.yaml --renderer=asciidoctor --templates-dir=docs/api-templates --output-path=${CRD_DOCS_REF_PATH}
10+
//go:generate go tool github.com/elastic/crd-ref-docs --source-path=api/v1alpha1 --config=docs/api-gen-config.yaml --renderer=asciidoctor --templates-dir=docs/api-templates --output-path=${CRD_DOCS_REF_PATH}

0 commit comments

Comments
 (0)