Skip to content

Commit

Permalink
refactor: remove DaemonSet update and patch permission
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSpiritXIII committed Aug 23, 2024
1 parent 35aa555 commit a1bac79
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
2 changes: 1 addition & 1 deletion charts/operator/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ rules:
- daemonsets
apiGroups: ["apps"]
resourceNames: ["collector"]
verbs: ["get", "list", "watch", "patch", "update"]
verbs: ["get", "list", "watch"]
- resources:
- deployments
apiGroups: ["apps"]
Expand Down
2 changes: 1 addition & 1 deletion manifests/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ rules:
- daemonsets
apiGroups: ["apps"]
resourceNames: ["collector"]
verbs: ["get", "list", "watch", "patch", "update"]
verbs: ["get", "list", "watch"]
- resources:
- deployments
apiGroups: ["apps"]
Expand Down
13 changes: 1 addition & 12 deletions pkg/operator/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,18 +229,7 @@ func (r *collectionReconciler) ensureCollectorDaemonSet(ctx context.Context) err
logger.Error(err, "collector DaemonSet does not exist")
return nil
}
if err != nil {
return err
}

setContainerExtraArgs(ds.Spec.Template.Spec.Containers, CollectorPrometheusContainerName, "")

// Support not having UPDATE permission. We will remove it in the future.
// See: https://github.com/GoogleCloudPlatform/prometheus-engine/pull/1079
if err := r.client.Update(ctx, &ds); !apierrors.IsForbidden(err) {
return err
}
return nil
return err
}

func gzipData(data []byte) ([]byte, error) {
Expand Down

0 comments on commit a1bac79

Please sign in to comment.