Skip to content

Commit

Permalink
Merge pull request spidernet-io#3884 from spidernet-io/robot/cherrypi…
Browse files Browse the repository at this point in the history
…ck/pr3880/release-v1.0

rbac: remove permissions for patch/update nodes and webhook resources
  • Loading branch information
weizhoublue authored Aug 15, 2024
2 parents f7aef62 + d6e3656 commit ac18f55
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
13 changes: 8 additions & 5 deletions charts/spiderpool/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ rules:
- configmaps
- endpoints
- namespaces
- nodes
- pods
- pods/status
verbs:
Expand All @@ -33,18 +32,22 @@ rules:
- patch
- update
- watch
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
- apiGroups:
- admissionregistration.k8s.io
resources:
- mutatingwebhookconfigurations
- validatingwebhookconfigurations
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apiextensions.k8s.io
Expand Down
5 changes: 3 additions & 2 deletions pkg/k8s/apis/spiderpool.spidernet.io/v2beta1/rbac.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
// +kubebuilder:rbac:groups="resource.k8s.io",resources=resourceclaims;resourceclaims/status;podschedulingcontexts/status;resourceclaimtemplates;resourceclasses;podschedulingcontexts,verbs=get;list;patch;watch;update
// +kubebuilder:rbac:groups="networking.k8s.io",resources=servicecidrs,verbs=get;list;watch
// +kubebuilder:rbac:groups="batch",resources=jobs;cronjobs,verbs=get;list;watch;update
// +kubebuilder:rbac:groups="",resources=nodes;namespaces;endpoints;pods;pods/status;configmaps,verbs=get;list;watch;update;patch;delete;deletecollection
// +kubebuilder:rbac:groups="",resources=nodes,verbs=get;list;watch
// +kubebuilder:rbac:groups="",resources=namespaces;endpoints;pods;pods/status;configmaps,verbs=get;list;watch;update;patch;delete;deletecollection
// +kubebuilder:rbac:groups=k8s.cni.cncf.io,resources=network-attachment-definitions,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=kubevirt.io,resources=virtualmachines;virtualmachineinstances,verbs=get;list
// +kubebuilder:rbac:groups=admissionregistration.k8s.io,resources=mutatingwebhookconfigurations;validatingwebhookconfigurations,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=admissionregistration.k8s.io,resources=mutatingwebhookconfigurations;validatingwebhookconfigurations,verbs=get;list;watch
// +kubebuilder:rbac:groups=apiextensions.k8s.io,resources=customresourcedefinitions,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=apps.kruise.io,resources=clonesets;statefulsets,verbs=get;list;watch
// +kubebuilder:rbac:groups=crd.projectcalico.org,resources=ippools,verbs=get;list;watch
Expand Down
2 changes: 1 addition & 1 deletion pkg/multuscniconfig/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func ParsePodNetworkObjectName(podnetwork string) (string, string, string, error
for i := range allItems {
matched := compile.MatchString(allItems[i])
if !matched && len([]rune(allItems[i])) > 0 {
return "", "", "", fmt.Errorf(fmt.Sprintf("parsePodNetworkObjectName: Failed to parse: one or more items did not match comma-delimited format (must consist of lower case alphanumeric characters). Must start and end with an alphanumeric character), mismatch @ '%v'", allItems[i]))
return "", "", "", fmt.Errorf("parsePodNetworkObjectName: Failed to parse: one or more items did not match comma-delimited format (must consist of lower case alphanumeric characters). Must start and end with an alphanumeric character), mismatch @ '%v'", allItems[i])
}
}

Expand Down

0 comments on commit ac18f55

Please sign in to comment.