Skip to content

Commit

Permalink
Merge pull request #730 from jvanz/create-or-update-function
Browse files Browse the repository at this point in the history
Update controller code to use the controller-runtime helper function to create or update resources
  • Loading branch information
jvanz authored May 7, 2024
2 parents 66fac8e + 5adaba0 commit 75ff9bb
Show file tree
Hide file tree
Showing 15 changed files with 907 additions and 1,362 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ GOLANGCI_LINT_VER := v1.55.2
GOLANGCI_LINT_BIN := golangci-lint
GOLANGCI_LINT := $(BIN_DIR)/$(GOLANGCI_LINT_BIN)

TEST_TIMEOUT := 20m
# Let's use a generous timeout for integration tests because GitHub workers can
# be slow
TEST_TIMEOUT := 30m

all: build

Expand Down
12 changes: 8 additions & 4 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,31 @@ rules:
- mutatingwebhookconfigurations
verbs:
- create
- get
- delete
- list
- patch
- update
- watch
- apiGroups:
- admissionregistration.k8s.io
resources:
- validatingwebhookconfigurations
verbs:
- create
- get
- delete
- list
- patch
- update
- watch
- apiGroups:
- policies.kubewarden.io
resources:
- admissionpolicies
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- policies.kubewarden.io
Expand All @@ -55,9 +56,12 @@ rules:
resources:
- clusteradmissionpolicies
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- policies.kubewarden.io
Expand Down
2 changes: 1 addition & 1 deletion controllers/admissionpolicy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (
//
// We need access to these resources inside of all the namespaces -> a ClusterRole
// is needed
//+kubebuilder:rbac:groups=policies.kubewarden.io,resources=admissionpolicies,verbs=get;list;watch;delete
//+kubebuilder:rbac:groups=policies.kubewarden.io,resources=admissionpolicies,verbs=create;delete;get;list;patch;update;watch
//+kubebuilder:rbac:groups=policies.kubewarden.io,resources=admissionpolicies/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=policies.kubewarden.io,resources=admissionpolicies/finalizers,verbs=update
//
Expand Down
2 changes: 1 addition & 1 deletion controllers/clusteradmissionpolicy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (
//
// We need access to these resources inside of all the namespaces -> a ClusterRole
// is needed
//+kubebuilder:rbac:groups=policies.kubewarden.io,resources=clusteradmissionpolicies,verbs=get;list;watch;delete
//+kubebuilder:rbac:groups=policies.kubewarden.io,resources=clusteradmissionpolicies,verbs=create;delete;get;list;patch;update;watch
//+kubebuilder:rbac:groups=policies.kubewarden.io,resources=clusteradmissionpolicies/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=policies.kubewarden.io,resources=clusteradmissionpolicies/finalizers,verbs=update

Expand Down
Loading

0 comments on commit 75ff9bb

Please sign in to comment.