Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing kubebuilder generation #993

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ generate-manifests-external: vendor controller-gen ## Generate ClusterRole and C

.PHONY: generate-manifests-api
generate-manifests-api: controller-gen ## Generate ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd paths="./api/v1alpha1/..." \
$(CONTROLLER_GEN) rbac:roleName=manager-role crd paths="./api/v1alpha1/..." paths="./internal/controllers/..." \
output:crd:artifacts:config=./config/crd/bases \
output:rbac:dir=./config/rbac \

Expand Down
64 changes: 37 additions & 27 deletions charts/rancher-turtles/templates/rancher-turtles-components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3366,19 +3366,8 @@ rules:
resources:
- configmaps
- events
- secrets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- namespaces
- secrets
verbs:
- create
- delete
Expand All @@ -3393,7 +3382,6 @@ rules:
- clusters
- clusters/status
verbs:
- create
- get
- list
- patch
Expand All @@ -3409,6 +3397,7 @@ rules:
- update
- apiGroups:
- infrastructure.cluster.x-k8s.io
- operator.cluster.x-k8s.io
resources:
- '*'
verbs:
Expand All @@ -3423,31 +3412,43 @@ rules:
- management.cattle.io
resources:
- clusterregistrationtokens
- clusterregistrationtokens/status
- clusters
- clusters/status
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- create
- apiGroups:
- management.cattle.io
resources:
- clusterregistrationtokens/status
- settings
verbs:
- get
- list
- watch
- apiGroups:
- provisioning.cattle.io
resources:
- clusters
- clusters/status
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- provisioning.cattle.io
- turtles-capi.cattle.io
resources:
- clusters
- clusters/status
- capiproviders
verbs:
- create
- delete
Expand All @@ -3459,28 +3460,37 @@ rules:
- apiGroups:
- turtles-capi.cattle.io
resources:
- capiproviders
- capiproviders/finalizers
verbs:
- update
- apiGroups:
- turtles-capi.cattle.io
resources:
- capiproviders/status
verbs:
- get
- patch
- update
- apiGroups:
- turtles-capi.cattle.io
resources:
- clusterctlconfigs
- clusterctlconfigs/status
verbs:
- get
- list
- watch
- patch
- update
- watch
- apiGroups:
- operator.cluster.x-k8s.io
- turtles-capi.cattle.io
resources:
- '*'
- clusterctlconfigs/finalizers
verbs:
- create
- get
- list
- watch
- patch
- update
- create
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
Expand Down
64 changes: 37 additions & 27 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,8 @@ rules:
resources:
- configmaps
- events
- secrets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- namespaces
- secrets
verbs:
- create
- delete
Expand All @@ -36,7 +25,6 @@ rules:
- clusters
- clusters/status
verbs:
- create
- get
- list
- patch
Expand All @@ -52,6 +40,7 @@ rules:
- update
- apiGroups:
- infrastructure.cluster.x-k8s.io
- operator.cluster.x-k8s.io
resources:
- '*'
verbs:
Expand All @@ -66,31 +55,43 @@ rules:
- management.cattle.io
resources:
- clusterregistrationtokens
- clusterregistrationtokens/status
- clusters
- clusters/status
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- create
- apiGroups:
- management.cattle.io
resources:
- clusterregistrationtokens/status
- settings
verbs:
- get
- list
- watch
- apiGroups:
- provisioning.cattle.io
resources:
- clusters
- clusters/status
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- provisioning.cattle.io
- turtles-capi.cattle.io
resources:
- clusters
- clusters/status
- capiproviders
verbs:
- create
- delete
Expand All @@ -102,25 +103,34 @@ rules:
- apiGroups:
- turtles-capi.cattle.io
resources:
- capiproviders
- capiproviders/finalizers
verbs:
- update
- apiGroups:
- turtles-capi.cattle.io
resources:
- capiproviders/status
verbs:
- get
- patch
- update
- apiGroups:
- turtles-capi.cattle.io
resources:
- clusterctlconfigs
- clusterctlconfigs/status
verbs:
- get
- list
- watch
- patch
- update
- watch
- apiGroups:
- operator.cluster.x-k8s.io
- turtles-capi.cattle.io
resources:
- '*'
- clusterctlconfigs/finalizers
verbs:
- create
- get
- list
- watch
- patch
- update
- create
- watch
6 changes: 4 additions & 2 deletions internal/controllers/import_controller_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,10 @@ func (r *CAPIImportManagementV3Reconciler) SetupWithManager(ctx context.Context,
// +kubebuilder:rbac:groups=coordination.k8s.io,resources=leases,verbs=get;create;update
// +kubebuilder:rbac:groups=cluster.x-k8s.io,resources=clusters;clusters/status,verbs=get;list;watch;update;patch
// +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=*,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=management.cattle.io,resources=clusters;clusters/status,verbs=get;list;watch;create;update;delete;deletecollection;patch
// +kubebuilder:rbac:groups=management.cattle.io,resources=clusters;clusterregistrationtokens;clusterregistrationtokens/status,verbs=get;list;watch
// +kubebuilder:rbac:groups=management.cattle.io,resources=clusters;clusters/status;clusterregistrationtokens,verbs=get;list;watch;create;update;delete;deletecollection;patch
// +kubebuilder:rbac:groups=management.cattle.io,resources=clusterregistrationtokens/status;settings,verbs=get;list;watch
//
//nolint:lll

// Reconcile reconciles a CAPI cluster, creating a Rancher cluster if needed and applying the import manifests.
func (r *CAPIImportManagementV3Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
Expand Down
Loading