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

Role created when .Values.rbac.create == false #532

Closed
stgrace opened this issue Sep 27, 2023 · 3 comments · Fixed by #533
Closed

Role created when .Values.rbac.create == false #532

stgrace opened this issue Sep 27, 2023 · 3 comments · Fixed by #533
Assignees
Labels
bug Something isn't working

Comments

@stgrace
Copy link

stgrace commented Sep 27, 2023

A clear and concise description of what the bug is.

Expected Behavior

Expected roles not to be created when setting rbac.create to false

Actual Behavior

Roles are created.

Steps to Reproduce the Problem

  1. helm install --set rbac.create=false keda kedacore/keda --namespace keda --create-namespace

See https://github.com/kedacore/charts/blob/main/keda/templates/manager/role.yaml

{{- if or (and .Values.certificates.autoGenerated (not .Values.certificates.certManager.enabled)) (.Values.permissions.operator.restrict.secret) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  {{- with .Values.additionalAnnotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
  labels:
    app.kubernetes.io/name: {{ .Values.operator.name }}
    {{- include "keda.labels" . | indent 4 }}
  name: {{ .Values.operator.name }}
  namespace: {{ .Release.Namespace }}
rules:
- apiGroups:
  - ""
  resources:
  - secrets
  verbs:
  {{- if and .Values.certificates.autoGenerated (not .Values.certificates.certManager.enabled) }}
  - create
  - delete
  - patch
  - update
  {{- end }}
  - watch
  - get
  - list
{{- end -}}

Willing to create a PR for this

@stgrace stgrace added the bug Something isn't working label Sep 27, 2023
@tomkerkhove
Copy link
Member

@JorTurFer It looks like related to cert manager; any thoughts on why this is not respected?

Oversight or just to make sure they are always there?

@JorTurFer
Copy link
Member

JorTurFer commented Sep 28, 2023

We shouldn't add the role if rbac.create = false

@JorTurFer
Copy link
Member

let me open a PR quickly to fix it for incoming release, give me a sec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants