Skip to content

Support empty rules defined in the values.yaml

Romuald Atchadé requested to merge support-empty-rule into main

What does this MR do?

Set default RBAC Rules when values.rules is left empty in the values.yaml

Why was this MR needed?

When removing a deprecated values from the values.yaml in the MR !393 (merged), a section of the code covering when empty rules are provided was removed.

With this MR, this part was re-added.

What's the best way to test this MR?

values.yaml
image:
  registry: registry.gitlab.com
  image: gitlab-org/gitlab-runner
  # tag: ubuntu-bleeding
useTini: false
imagePullPolicy: IfNotPresent
replicas: 1
gitlabUrl: https://gitlab.com/
runnerToken: "REDACTED"
unregisterRunners: true

useJobNamespace: true
terminationGracePeriodSeconds: 0
concurrent: 1
checkInterval: 1
logLevel: "debug"
sessionServer:
  enabled: false
  annotations: {}
  timeout: 1800
  internalPort: 8093
  externalPort: 9000
  # publicIP: ""
  # loadBalancerSourceRanges:
  #   - 1.2.3.4/32

## For RBAC support:
rbac:
  create: true
  rules: []
  clusterWideAccess: false
  serviceAccountName: ""
  serviceAccountAnnotations: {}
  podSecurityPolicy:
    enabled: false
    resourceNames:
    - gitlab-runner
metrics:
  enabled: true
  portName: metrics
  port: 9252
  serviceMonitor:
    enabled: false
service:
  enabled: false
  type: ClusterIP
runners:
  config: |
    [[runners]]
      [runners.kubernetes]
        image = "alpine"
        [[runners.kubernetes.services]]
          name = "alpine:latest"
          alias = "alpine-service"
          command = ["sleep 900s"]
          entrypoint = ["/bin/sh", "-c"]
  cache: {}
  builds: {}
  services: {}
  helpers: {}
securityContext:
  allowPrivilegeEscalation: false
  readOnlyRootFilesystem: false
  runAsNonRoot: false
podSecurityContext:
  runAsUser: 100
  fsGroup: 65533
resources:
  requests:
    memory: 128Mi
    cpu: 100m
affinity: {}
nodeSelector: {}
tolerations: []
hostAliases: []
podAnnotations: {}
podLabels: {}
hpa: {}
secrets: []
configMaps: {}
volumeMounts: []
volumes: []

The job should runner without problem

What are the relevant issue numbers?

close #458 (closed)

Merge request reports