Skip to content

Commit 95f7b9d

Browse files
committed
Update Toolchain to Fix test issues
1 parent c6f9319 commit 95f7b9d

File tree

9 files changed

+156
-193
lines changed

9 files changed

+156
-193
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
184184

185185
## Tool Versions
186186
KUSTOMIZE_VERSION ?= v3.8.7
187-
CONTROLLER_TOOLS_VERSION ?= v0.11.1
187+
CONTROLLER_TOOLS_VERSION ?= v0.16.5
188188

189189
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
190190
.PHONY: kustomize

api/v1alpha1/zz_generated.deepcopy.go

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

config/crd/bases/cerberus.snappcloud.io_accesstokens.yaml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.11.1
7-
creationTimestamp: null
6+
controller-gen.kubebuilder.io/version: v0.16.5
87
name: accesstokens.cerberus.snappcloud.io
98
spec:
109
group: cerberus.snappcloud.io
@@ -21,14 +20,19 @@ spec:
2120
description: AccessToken is the Schema for the accesstokens API
2221
properties:
2322
apiVersion:
24-
description: 'APIVersion defines the versioned schema of this representation
25-
of an object. Servers should convert recognized schemas to the latest
26-
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
23+
description: |-
24+
APIVersion defines the versioned schema of this representation of an object.
25+
Servers should convert recognized schemas to the latest internal value, and
26+
may reject unrecognized values.
27+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
2728
type: string
2829
kind:
29-
description: 'Kind is a string value representing the REST resource this
30-
object represents. Servers may infer this from the endpoint the client
31-
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
30+
description: |-
31+
Kind is a string value representing the REST resource this object represents.
32+
Servers may infer this from the endpoint the client submits requests to.
33+
Cannot be updated.
34+
In CamelCase.
35+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
3236
type: string
3337
metadata:
3438
type: object
@@ -51,8 +55,9 @@ spec:
5155
description: AllowedWebservices is a list of Webservice that the token
5256
has access to
5357
items:
54-
description: SecretReference represents a Secret Reference. It has
55-
enough information to retrieve secret in any namespace
58+
description: |-
59+
SecretReference represents a Secret Reference. It has enough information to retrieve secret
60+
in any namespace
5661
properties:
5762
name:
5863
description: name is unique within a namespace to reference
@@ -71,11 +76,12 @@ spec:
7176
minimum: 0
7277
type: integer
7378
state:
74-
description: 'State shows the state of the token (whether you use
75-
token or it''s just a draft) Valid values are: - "Active" (default):
76-
uses token in authorization procedure - "Expired": won''t include
77-
token in authorization procedure - "Suspended": shows that the token
78-
is currently not usable, but it may become Active later'
79+
description: |-
80+
State shows the state of the token (whether you use token or it's just a draft)
81+
Valid values are:
82+
- "Active" (default): uses token in authorization procedure
83+
- "Expired": won't include token in authorization procedure
84+
- "Suspended": shows that the token is currently not usable, but it may become Active later
7985
enum:
8086
- Active
8187
- Expired

config/crd/bases/cerberus.snappcloud.io_webserviceaccessbindings.yaml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.11.1
7-
creationTimestamp: null
6+
controller-gen.kubebuilder.io/version: v0.16.5
87
name: webserviceaccessbindings.cerberus.snappcloud.io
98
spec:
109
group: cerberus.snappcloud.io
@@ -22,14 +21,19 @@ spec:
2221
API
2322
properties:
2423
apiVersion:
25-
description: 'APIVersion defines the versioned schema of this representation
26-
of an object. Servers should convert recognized schemas to the latest
27-
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
24+
description: |-
25+
APIVersion defines the versioned schema of this representation of an object.
26+
Servers should convert recognized schemas to the latest internal value, and
27+
may reject unrecognized values.
28+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
2829
type: string
2930
kind:
30-
description: 'Kind is a string value representing the REST resource this
31-
object represents. Servers may infer this from the endpoint the client
32-
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
31+
description: |-
32+
Kind is a string value representing the REST resource this object represents.
33+
Servers may infer this from the endpoint the client submits requests to.
34+
Cannot be updated.
35+
In CamelCase.
36+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
3337
type: string
3438
metadata:
3539
type: object
@@ -46,12 +50,14 @@ spec:
4650
webservices:
4751
description: WebServices are the target service accesses
4852
items:
49-
description: LocalObjectReference contains enough information to
50-
let you locate the referenced object inside the same namespace.
53+
description: |-
54+
LocalObjectReference contains enough information to let you locate the
55+
referenced object inside the same namespace.
5156
properties:
5257
name:
53-
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
54-
TODO: Add other useful fields. apiVersion, kind, uid?'
58+
description: |-
59+
Name of the referent.
60+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
5561
type: string
5662
type: object
5763
x-kubernetes-map-type: atomic

config/crd/bases/cerberus.snappcloud.io_webservices.yaml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.11.1
7-
creationTimestamp: null
6+
controller-gen.kubebuilder.io/version: v0.16.5
87
name: webservices.cerberus.snappcloud.io
98
spec:
109
group: cerberus.snappcloud.io
@@ -21,14 +20,19 @@ spec:
2120
description: WebService is the Schema for the webservices API
2221
properties:
2322
apiVersion:
24-
description: 'APIVersion defines the versioned schema of this representation
25-
of an object. Servers should convert recognized schemas to the latest
26-
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
23+
description: |-
24+
APIVersion defines the versioned schema of this representation of an object.
25+
Servers should convert recognized schemas to the latest internal value, and
26+
may reject unrecognized values.
27+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
2728
type: string
2829
kind:
29-
description: 'Kind is a string value representing the REST resource this
30-
object represents. Servers may infer this from the endpoint the client
31-
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
30+
description: |-
31+
Kind is a string value representing the REST resource this object represents.
32+
Servers may infer this from the endpoint the client submits requests to.
33+
Cannot be updated.
34+
In CamelCase.
35+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
3236
type: string
3337
metadata:
3438
type: object
@@ -56,7 +60,8 @@ spec:
5660
minimum: 0
5761
type: integer
5862
upstreamHttpAuth:
59-
description: UpstreamHttpAuth tells Cerberus whether it needs to forward
63+
description: |-
64+
UpstreamHttpAuth tells Cerberus whether it needs to forward
6065
authentication to another (HTTP) service or not
6166
properties:
6267
address:

config/rbac/role.yaml

Lines changed: 59 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -2,118 +2,70 @@
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:
5-
creationTimestamp: null
65
name: manager-role
76
rules:
8-
- apiGroups:
9-
- cerberus.snappcloud.io
10-
resources:
11-
- accesstokens
12-
verbs:
13-
- create
14-
- delete
15-
- get
16-
- list
17-
- patch
18-
- update
19-
- watch
20-
- apiGroups:
21-
- cerberus.snappcloud.io
22-
resources:
23-
- accesstokens/finalizers
24-
verbs:
25-
- update
26-
- apiGroups:
27-
- cerberus.snappcloud.io
28-
resources:
29-
- accesstokens/status
30-
verbs:
31-
- get
32-
- patch
33-
- update
34-
- apiGroups:
35-
- cerberus.snappcloud.io
36-
resources:
37-
- webserviceaccessbindings
38-
verbs:
39-
- create
40-
- delete
41-
- get
42-
- list
43-
- patch
44-
- update
45-
- watch
46-
- apiGroups:
47-
- cerberus.snappcloud.io
48-
resources:
49-
- webserviceaccessbindings/finalizers
50-
verbs:
51-
- update
52-
- apiGroups:
53-
- cerberus.snappcloud.io
54-
resources:
55-
- webserviceaccessbindings/status
56-
verbs:
57-
- get
58-
- patch
59-
- update
60-
- apiGroups:
61-
- cerberus.snappcloud.io
62-
resources:
63-
- webserviceaccountbindings
64-
verbs:
65-
- get
66-
- list
67-
- watch
68-
- apiGroups:
69-
- cerberus.snappcloud.io
70-
resources:
71-
- webserviceaccountbindings/status
72-
verbs:
73-
- get
74-
- apiGroups:
75-
- cerberus.snappcloud.io
76-
resources:
77-
- webservices
78-
verbs:
79-
- create
80-
- delete
81-
- get
82-
- list
83-
- patch
84-
- update
85-
- watch
86-
- apiGroups:
87-
- cerberus.snappcloud.io
88-
resources:
89-
- webservices/finalizers
90-
verbs:
91-
- update
92-
- apiGroups:
93-
- cerberus.snappcloud.io
94-
resources:
95-
- webservices/status
96-
verbs:
97-
- get
98-
- patch
99-
- update
7+
- apiGroups:
8+
- cerberus.snappcloud.io
9+
resources:
10+
- accesstokens
11+
- webserviceaccessbindings
12+
- webservices
13+
verbs:
14+
- create
15+
- delete
16+
- get
17+
- list
18+
- patch
19+
- update
20+
- watch
21+
- apiGroups:
22+
- cerberus.snappcloud.io
23+
resources:
24+
- accesstokens/finalizers
25+
- webserviceaccessbindings/finalizers
26+
- webservices/finalizers
27+
verbs:
28+
- update
29+
- apiGroups:
30+
- cerberus.snappcloud.io
31+
resources:
32+
- accesstokens/status
33+
- webserviceaccessbindings/status
34+
- webservices/status
35+
verbs:
36+
- get
37+
- patch
38+
- update
39+
- apiGroups:
40+
- cerberus.snappcloud.io
41+
resources:
42+
- webserviceaccountbindings
43+
verbs:
44+
- get
45+
- list
46+
- watch
47+
- apiGroups:
48+
- cerberus.snappcloud.io
49+
resources:
50+
- webserviceaccountbindings/status
51+
verbs:
52+
- get
10053
---
10154
apiVersion: rbac.authorization.k8s.io/v1
10255
kind: Role
10356
metadata:
104-
creationTimestamp: null
10557
name: manager-role
106-
namespace: "'cerberus-operator-system'"
58+
namespace: '''cerberus-operator-system'''
10759
rules:
108-
- apiGroups:
109-
- ""
110-
resources:
111-
- secrets
112-
verbs:
113-
- create
114-
- delete
115-
- get
116-
- list
117-
- patch
118-
- update
119-
- watch
60+
- apiGroups:
61+
- ""
62+
resources:
63+
- secrets
64+
verbs:
65+
- create
66+
- delete
67+
- get
68+
- list
69+
- patch
70+
- update
71+
- watch

controllers/accesstoken_controller.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ func (r *AccessTokenReconciler) Reconcile(ctx context.Context, req ctrl.Request)
5555
return ctrl.Result{}, err
5656
}
5757

58-
5958
// SetupWithManager sets up the controller with the Manager.
6059
func (r *AccessTokenReconciler) SetupWithManager(mgr ctrl.Manager) error {
6160

@@ -74,18 +73,16 @@ func (r *AccessTokenReconciler) SetupWithManager(mgr ctrl.Manager) error {
7473
},
7574
}
7675

77-
7876
if err := ctrl.NewControllerManagedBy(mgr).
79-
For(&cerberusv1alpha1.AccessToken{}).
80-
Watches(&corev1.Secret{}, handler.EnqueueRequestsFromMapFunc(mapSecretMapFunc), builder.WithPredicates(labelPredicate)).
81-
Complete(r); err != nil {
82-
return err
77+
For(&cerberusv1alpha1.AccessToken{}).
78+
Watches(&corev1.Secret{}, handler.EnqueueRequestsFromMapFunc(mapSecretMapFunc), builder.WithPredicates(labelPredicate)).
79+
Complete(r); err != nil {
80+
return err
8381
}
8482

8583
return nil
8684
}
8785

88-
8986
func mapSecretMapFunc(ctx context.Context, a client.Object) []reconcile.Request {
9087
return []reconcile.Request{
9188
{NamespacedName: client.ObjectKey{Name: a.GetName(), Namespace: a.GetNamespace()}},

0 commit comments

Comments
 (0)