_subjects.tpl 830 B

1234567891011121314151617
  1. {{/* Returns Subjects for rbac */}}
  2. {{/* Call this template:
  3. {{ include "ix.v1.common.lib.rbac.subjects" (dict "rootCtx" $ "objectData" $objectData) }}
  4. rootCtx: The root context of the chart.
  5. objectData: The object data to be used to render the RBAC.
  6. */}}
  7. {{/* Parses service accounts, and checks if RBAC have selected any of them */}}
  8. {{- define "ix.v1.common.lib.rbac.subjects" -}}
  9. {{- $rootCtx := .rootCtx -}}
  10. {{- $objectData := .objectData -}}
  11. {{- range $objectData.subjects }}
  12. - kind: {{ tpl (required "RBAC - Expected non-empty <rbac.subjects.kind>" .kind) $rootCtx | quote }}
  13. name: {{ tpl (required "RBAC - Expected non-empty <rbac.subjects.name>" .name) $rootCtx | quote }}
  14. apiGroup: {{ tpl (required "RBAC - Expected non-empty <rbac.subjects.apiGroup>" .apiGroup) $rootCtx | quote }}
  15. {{- end -}}
  16. {{- end -}}