Skip to content

Commit

Permalink
Merge pull request #888 from pmsl/bugfix/craned-rbac
Browse files Browse the repository at this point in the history
change update workload to update workload status
  • Loading branch information
mfanjie authored Jan 18, 2024
2 parents 6d7758e + 8380d7f commit 5c18026
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 10 additions & 1 deletion deploy/craned/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,16 @@ rules:
- get
- list
- watch
- update
- apiGroups:
- apps
resources:
- daemonsets/status
- deployments/status
- deployments/scale
- statefulsets/status
- statefulsets/scale
verbs:
- update
- apiGroups:
- autoscaling
resources:
Expand Down
3 changes: 2 additions & 1 deletion pkg/controller/recommendation/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ func (c *RecommendationController) UpdateRecommendation(ctx context.Context, rec

if needUpdate {
unstructed.SetAnnotations(annotation)
err = c.Client.Update(ctx, unstructed)
//Convergence craned permissions
err = c.Client.Status().Update(ctx, unstructed)
if err != nil {
return false, fmt.Errorf("update target annotation failed: %v. ", err)
}
Expand Down

0 comments on commit 5c18026

Please sign in to comment.