redhat-cop / helm-charts

Helm Charts Repository

Home Page:https://redhat-cop.github.io/helm-charts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bootstrap-project; unable to provide no bindings

garethahealy opened this issue · comments

When using the bootstrap-project, I was hoping I could use a simple values.yml like:

enabled: true
namespaces:
- name: bob

but this outputs:

---
# Source: cluster-bootstrap/charts/bootstrap-project/templates/namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
  name: "bob"
---
# Source: cluster-bootstrap/charts/bootstrap-project/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: dummy-sa
  namespace: "labs-ci-cd"
---
# Source: cluster-bootstrap/charts/bootstrap-project/templates/bindings.yaml
apiVersion: v1
kind: List
metadata:
  annotations:
    # This is what defines this resource as a hook. Without this line, the
    # job is considered part of the release.
    "helm.sh/hook": post-install
items:

I'd of expected it not to create a serviceaccount or list of bindings.

CC @springdo ; re: gchat

@garethahealy - thanks for raising this issue. I can see one way around your dummy-sa appearing and the quick solution is to just set serviceaccounts: {}:

enabled: true
serviceaccounts: {}
namespaces:
- name: bob

But we should probs be questioning if we should have those defaults in there and i would think probs not, but documented in the readme or commented out in the values file for people who read it and not the readme.

As for the other issue with bindings , yeah i see the template is not doing if logic on the bindings. it should probs read {{- if .Values.namespaces }} and something dirty like {{- if .Values.namespaces[0].bindings }} or something along those lines on L2
https://github.com/rht-labs/helm-charts/blob/master/charts/bootstrap-project/templates/bindings.yaml#L2