Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
pkg/headlamp: make ingress optional and set default values
Browse files Browse the repository at this point in the history
  • Loading branch information
iaguis committed Sep 30, 2020
1 parent 8083431 commit 1d30f40
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/components/headlamp/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,15 @@ func (c *component) LoadConfig(configBody *hcl.Body, evalContext *hcl.EvalContex
}
}

return gohcl.DecodeBody(*configBody, evalContext, c)
if err := gohcl.DecodeBody(*configBody, evalContext, c); err != nil {
return err
}

if c.Ingress != nil {
c.Ingress.SetDefaults()
}

return nil
}

// RenderManifests renders the Helm chart templates with values provided.
Expand Down
2 changes: 2 additions & 0 deletions pkg/components/headlamp/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ image:
# TODO use v0.1.0 when it's released
tag: l8e
pullPolicy: Always
{{ if .Ingress }}
ingress:
enabled: true
hosts:
Expand All @@ -35,4 +36,5 @@ ingress:
kubernetes.io/ingress.class: {{ .Ingress.Class }}
cert-manager.io/cluster-issuer: {{ .Ingress.CertManagerClusterIssuer }}
contour.heptio.com/websocket-routes: "/"
{{ end }}
`

0 comments on commit 1d30f40

Please sign in to comment.