openshift / kube-compare

A Kubectl plugin to allow to compare a known valid reference configuration and a set of specific cluster configuration CRs.
Apache License 2.0
8 stars 8 forks source link

Custom go template function throwing an error #31

Open pixelsoccupied opened 2 weeks ago

pixelsoccupied commented 2 weeks ago
error: template: odfNS.yaml:10:16: executing "storage/odf-external/odfNS.yaml" at <{{template "hello"}}>: template "hello" not defined
{{define "hello"}}
    hello: world
{{end}}
apiVersion: v1
kind: Namespace
metadata:
  name: openshift-storage
  annotations:
    workload.openshift.io/allowed: management
    {{ template "hello" }}
  labels:
    openshift.io/cluster-monitoring: "true"

It should render instead of the error

apiVersion: v1
kind: Namespace
metadata:
  name: openshift-storage
  annotations:
    workload.openshift.io/allowed: management
    hello: world
  labels:
    openshift.io/cluster-monitoring: "true"
pixelsoccupied commented 2 weeks ago

/kind bug