Skip to content

Commit 4af7174

Browse files
committed
updated controller version
1 parent 9828dcd commit 4af7174

File tree

11 files changed

+159
-750
lines changed

11 files changed

+159
-750
lines changed

api/v1beta1/runner_webhook.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
ctrl "sigs.k8s.io/controller-runtime"
2222
logf "sigs.k8s.io/controller-runtime/pkg/log"
2323
"sigs.k8s.io/controller-runtime/pkg/webhook"
24+
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
2425
)
2526

2627
// log is for logging in this package.
@@ -51,26 +52,26 @@ func (r *Runner) Default() {
5152
var _ webhook.Validator = &Runner{}
5253

5354
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
54-
func (r *Runner) ValidateCreate() error {
55+
func (r *Runner) ValidateCreate() (admission.Warnings, error) {
5556
// runnerlog.Info("validate create", "name", r.Name)
5657

57-
return nil
58+
return nil, nil
5859
}
5960

6061
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
61-
func (r *Runner) ValidateUpdate(old runtime.Object) error {
62+
func (r *Runner) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
6263
// runnerlog.Info("validate update", "name", r.Name)
6364

6465
// we do not want to permit changing of the name of the runner (or better, we'd rather avoid dealing with cleaning)
6566

6667
// TODO(user): fill in your validation logic upon object update.
67-
return nil
68+
return nil, nil
6869
}
6970

7071
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
71-
func (r *Runner) ValidateDelete() error {
72+
func (r *Runner) ValidateDelete() (admission.Warnings, error) {
7273
// runnerlog.Info("validate delete", "name", r.Name)
7374

7475
// TODO(user): fill in your validation logic upon object deletion.
75-
return nil
76+
return nil, nil
7677
}

api/v1beta1/webhook_suite_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import (
3636
ctrl "sigs.k8s.io/controller-runtime"
3737
"sigs.k8s.io/controller-runtime/pkg/client"
3838
"sigs.k8s.io/controller-runtime/pkg/envtest"
39-
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
4039
logf "sigs.k8s.io/controller-runtime/pkg/log"
4140
"sigs.k8s.io/controller-runtime/pkg/log/zap"
4241
)
@@ -53,9 +52,7 @@ var cancel context.CancelFunc
5352
func TestAPIs(t *testing.T) {
5453
RegisterFailHandler(Fail)
5554

56-
RunSpecsWithDefaultAndCustomReporters(t,
57-
"Webhook Suite",
58-
[]Reporter{printer.NewlineReporter{}})
55+
RunSpecs(t, "Webhook Suite")
5956
}
6057

6158
var _ = BeforeSuite(func() {

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/gitlab.k8s.alekc.dev_multirunners.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
54
metadata:
65
annotations:
7-
controller-gen.kubebuilder.io/version: v0.4.1
8-
creationTimestamp: null
6+
controller-gen.kubebuilder.io/version: v0.13.0
97
name: multirunners.gitlab.k8s.alekc.dev
108
spec:
119
group: gitlab.k8s.alekc.dev
@@ -1092,9 +1090,3 @@ spec:
10921090
storage: true
10931091
subresources:
10941092
status: {}
1095-
status:
1096-
acceptedNames:
1097-
kind: ""
1098-
plural: ""
1099-
conditions: []
1100-
storedVersions: []

config/crd/bases/gitlab.k8s.alekc.dev_runners.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
54
metadata:
65
annotations:
7-
controller-gen.kubebuilder.io/version: v0.4.1
8-
creationTimestamp: null
6+
controller-gen.kubebuilder.io/version: v0.13.0
97
name: runners.gitlab.k8s.alekc.dev
108
spec:
119
group: gitlab.k8s.alekc.dev
@@ -1087,9 +1085,3 @@ spec:
10871085
storage: true
10881086
subresources:
10891087
status: {}
1090-
status:
1091-
acceptedNames:
1092-
kind: ""
1093-
plural: ""
1094-
conditions: []
1095-
storedVersions: []

config/rbac/role.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
21
---
32
apiVersion: rbac.authorization.k8s.io/v1
43
kind: ClusterRole
54
metadata:
6-
creationTimestamp: null
75
name: manager-role
86
rules:
97
- apiGroups:

config/webhook/manifests.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
21
---
32
apiVersion: admissionregistration.k8s.io/v1
43
kind: MutatingWebhookConfiguration
54
metadata:
6-
creationTimestamp: null
75
name: mutating-webhook-configuration
86
webhooks:
97
- admissionReviewVersions:
@@ -27,12 +25,10 @@ webhooks:
2725
resources:
2826
- runners
2927
sideEffects: None
30-
3128
---
3229
apiVersion: admissionregistration.k8s.io/v1
3330
kind: ValidatingWebhookConfiguration
3431
metadata:
35-
creationTimestamp: null
3632
name: validating-webhook-configuration
3733
webhooks:
3834
- admissionReviewVersions:

controllers/suite_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import (
3232
controllerruntime "sigs.k8s.io/controller-runtime"
3333
"sigs.k8s.io/controller-runtime/pkg/client"
3434
"sigs.k8s.io/controller-runtime/pkg/envtest"
35-
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
3635
logf "sigs.k8s.io/controller-runtime/pkg/log"
3736
"sigs.k8s.io/controller-runtime/pkg/log/zap"
3837

@@ -51,10 +50,7 @@ var testEnv *envtest.Environment
5150

5251
func TestAPIs(t *testing.T) {
5352
RegisterFailHandler(Fail)
54-
55-
RunSpecsWithDefaultAndCustomReporters(t,
56-
"Controller Suite",
57-
[]Reporter{printer.NewlineReporter{}})
53+
RunSpecs(t, "Controller Suite")
5854
}
5955

6056
var _ = BeforeSuite(func() {

go.mod

Lines changed: 41 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,77 @@
11
module gitlab.k8s.alekc.dev
22

3-
go 1.19
3+
go 1.20
44

55
require (
66
github.com/BurntSushi/toml v0.3.1
7-
github.com/go-logr/logr v1.2.3
7+
github.com/go-logr/logr v1.2.4
88
github.com/onsi/ginkgo v1.16.5
9-
github.com/onsi/gomega v1.19.0
10-
github.com/xanzy/go-gitlab v0.81.0
11-
k8s.io/api v0.25.0
12-
k8s.io/apimachinery v0.25.0
13-
k8s.io/client-go v0.25.0
14-
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed
15-
sigs.k8s.io/controller-runtime v0.13.0
9+
github.com/onsi/gomega v1.27.10
10+
github.com/xanzy/go-gitlab v0.95.1
11+
k8s.io/api v0.28.4
12+
k8s.io/apimachinery v0.28.4
13+
k8s.io/client-go v0.28.4
14+
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2
15+
sigs.k8s.io/controller-runtime v0.16.3
1616
)
1717

1818
require (
19-
cloud.google.com/go v0.97.0 // indirect
20-
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
21-
github.com/Azure/go-autorest/autorest v0.11.27 // indirect
22-
github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
23-
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
24-
github.com/Azure/go-autorest/logger v0.2.1 // indirect
25-
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
26-
github.com/PuerkitoBio/purell v1.1.1 // indirect
27-
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
2819
github.com/beorn7/perks v1.0.1 // indirect
29-
github.com/cespare/xxhash/v2 v2.1.2 // indirect
20+
github.com/cespare/xxhash/v2 v2.2.0 // indirect
3021
github.com/davecgh/go-spew v1.1.1 // indirect
31-
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
22+
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
3223
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
33-
github.com/fsnotify/fsnotify v1.5.4 // indirect
34-
github.com/go-logr/zapr v1.2.3 // indirect
35-
github.com/go-openapi/jsonpointer v0.19.5 // indirect
36-
github.com/go-openapi/jsonreference v0.19.5 // indirect
37-
github.com/go-openapi/swag v0.19.14 // indirect
24+
github.com/fsnotify/fsnotify v1.6.0 // indirect
25+
github.com/go-logr/zapr v1.2.4 // indirect
26+
github.com/go-openapi/jsonpointer v0.19.6 // indirect
27+
github.com/go-openapi/jsonreference v0.20.2 // indirect
28+
github.com/go-openapi/swag v0.22.3 // indirect
3829
github.com/gogo/protobuf v1.3.2 // indirect
39-
github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
4030
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
4131
github.com/golang/protobuf v1.5.3 // indirect
42-
github.com/google/gnostic v0.5.7-v3refs // indirect
43-
github.com/google/go-cmp v0.5.8 // indirect
32+
github.com/google/gnostic-models v0.6.8 // indirect
33+
github.com/google/go-cmp v0.5.9 // indirect
4434
github.com/google/go-querystring v1.1.0 // indirect
45-
github.com/google/gofuzz v1.1.0 // indirect
46-
github.com/google/uuid v1.1.2 // indirect
35+
github.com/google/gofuzz v1.2.0 // indirect
36+
github.com/google/uuid v1.3.0 // indirect
4737
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
4838
github.com/hashicorp/go-retryablehttp v0.7.2 // indirect
4939
github.com/imdario/mergo v0.3.12 // indirect
5040
github.com/josharian/intern v1.0.0 // indirect
5141
github.com/json-iterator/go v1.1.12 // indirect
52-
github.com/mailru/easyjson v0.7.6 // indirect
53-
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
42+
github.com/mailru/easyjson v0.7.7 // indirect
43+
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
5444
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
5545
github.com/modern-go/reflect2 v1.0.2 // indirect
5646
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
5747
github.com/nxadm/tail v1.4.8 // indirect
5848
github.com/pkg/errors v0.9.1 // indirect
59-
github.com/prometheus/client_golang v1.12.2 // indirect
60-
github.com/prometheus/client_model v0.2.0 // indirect
61-
github.com/prometheus/common v0.32.1 // indirect
62-
github.com/prometheus/procfs v0.7.3 // indirect
49+
github.com/prometheus/client_golang v1.16.0 // indirect
50+
github.com/prometheus/client_model v0.4.0 // indirect
51+
github.com/prometheus/common v0.44.0 // indirect
52+
github.com/prometheus/procfs v0.10.1 // indirect
6353
github.com/spf13/pflag v1.0.5 // indirect
64-
go.uber.org/atomic v1.7.0 // indirect
65-
go.uber.org/multierr v1.6.0 // indirect
66-
go.uber.org/zap v1.21.0 // indirect
67-
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect
68-
golang.org/x/net v0.8.0 // indirect
69-
golang.org/x/oauth2 v0.6.0 // indirect
70-
golang.org/x/sys v0.6.0 // indirect
71-
golang.org/x/term v0.6.0 // indirect
72-
golang.org/x/text v0.8.0 // indirect
54+
go.uber.org/multierr v1.11.0 // indirect
55+
go.uber.org/zap v1.25.0 // indirect
56+
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
57+
golang.org/x/net v0.17.0 // indirect
58+
golang.org/x/oauth2 v0.8.0 // indirect
59+
golang.org/x/sys v0.13.0 // indirect
60+
golang.org/x/term v0.13.0 // indirect
61+
golang.org/x/text v0.13.0 // indirect
7362
golang.org/x/time v0.3.0 // indirect
74-
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
63+
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
7564
google.golang.org/appengine v1.6.7 // indirect
76-
google.golang.org/protobuf v1.29.0 // indirect
65+
google.golang.org/protobuf v1.31.0 // indirect
7766
gopkg.in/inf.v0 v0.9.1 // indirect
7867
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
7968
gopkg.in/yaml.v2 v2.4.0 // indirect
8069
gopkg.in/yaml.v3 v3.0.1 // indirect
81-
k8s.io/apiextensions-apiserver v0.25.0 // indirect
82-
k8s.io/component-base v0.25.0 // indirect
83-
k8s.io/klog/v2 v2.70.1 // indirect
84-
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
85-
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
70+
k8s.io/apiextensions-apiserver v0.28.3 // indirect
71+
k8s.io/component-base v0.28.3 // indirect
72+
k8s.io/klog/v2 v2.100.1 // indirect
73+
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
74+
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
8675
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
8776
sigs.k8s.io/yaml v1.3.0 // indirect
8877
)

0 commit comments

Comments
 (0)