go-templates Questions
5
Solved
Is there a way to flatten a dictionary with helm? I want to provide environment variables to the application from the chart by flattening a YAML config located in values.yaml. The config can look l...
Lashonlashond asked 17/4, 2020 at 21:19
9
I'd like to allow our developers to pass dynamic arguments to a helm template (Kubernetes job). Currently my arguments in the helm template are somewhat static (apart from certain values) and look ...
Myron asked 3/10, 2018 at 22:32
9
Solved
I have followed this tutorial: http://golang.org/doc/articles/wiki/final.go and have slightly modified it for my needs/wants. The problem is I would like to support HTML in the templates. I realize...
Ney asked 11/8, 2013 at 19:4
2
I want to override values between prod and dev deployments.
The default values look like:
apps:
myapp:
replicaCount: 2
containers:
- name: foo
env:
MODE: "dev"
I can override this ...
Lusitania asked 10/9, 2020 at 16:24
3
Solved
In a Go template, you can retrieve a field like this:
template.Parse("<html><body>{{ .Title }}</body></html>")
template.Execute(w, myObject)
How would you "inline" the cu...
Sponger asked 20/3, 2017 at 4:29
4
Solved
In my template, I would like to include some default meta tags (90% of the time). However, when a specific property is set, I would like to show a different set of text.
I know I can set an anonym...
Middleaged asked 25/9, 2015 at 3:17
2
Solved
I am using Go HTML Templates in Jetbrains Goland. How do I get all 3: HTML formatting, template code completion, and template formatting for templates?
Assuming I installed Go Templates plugin and ...
Performative asked 30/3, 2021 at 20:50
2
Solved
I've started using the Go language, and am now trying to create an HTML page. I am quite new to both coding in Go and HTML.
In the Go program I'm trying to parse a HTML page (div) into a main html...
Phlebotomy asked 18/5, 2018 at 9:48
1
I understand the usage of .Values.varName in Helm chart and which is used to refer the variable from Values.yaml file
I would like to know the difference between $.Values.varName and .Values.varNam...
Steeplebush asked 21/8, 2023 at 4:36
11
Solved
In a Go template, sometimes the way to pass the right data to the right template feels awkward to me. Calling a template with a pipeline parameter looks like calling a function with only one parame...
Preferment asked 16/8, 2013 at 14:51
2
Solved
When I deploy the following I get this error:
{{- if .Values.front.ingress.enabled -}}
{{- $fullName := include "marketplace.fullname" . -}}
{{- $ingressPaths := .Values.front.ingress.paths -}}
ap...
Borries asked 14/1, 2019 at 11:38
4
I am trying to declare that a block of code in a helm template should be present if a variable is true OR does not exist (ie, the default of the var is true). The following works:
{{- if or .Value...
Connacht asked 18/2, 2021 at 17:37
8
Solved
Using Helm templates, I'm trying to generate a list of server names based on a number in values.yaml. The dot for this template is set to the number (its a float64).
{{- define "zkservers" -}}
{{-...
Epicritic asked 6/12, 2017 at 7:12
2
Solved
im currently going through the docs of helm, and there have been at least 3 different uses for the dot (.), is there any specific definition for it? and does it have something in common with the ba...
Restrict asked 19/6, 2020 at 14:17
3
Solved
I'm using Go and package html/template. This is my code in mypage.tmpl:
<div class="col-sm-1">
<i class='fas fa-square companies-color' style="color: {{.Company.Color}}"></i>
&l...
Proficiency asked 5/8, 2019 at 4:19
3
Solved
I have a very long printf call in a Go template. Example:
{{ printf "mongodb://%s:%s@%s/%s?authSource=admin&replicaSet=%s&readPreference=nearest&w=majority" .Values.rocketchat.mongo.us...
Photoplay asked 13/4, 2018 at 12:23
2
I want to run one argo workflow in which a value is surrounded with double braces. Argo tries to resolve it but I don't want argo to resolve it.
Following is a fraction of katib studyjob workflow ...
Phenformin asked 28/5, 2019 at 11:46
6
Solved
I do not see a way to call templates (text or html) with a dynamic name. Example:
This works:
{{template "Blah" .}}
This errors with "unexpected "$BlahVar" in template invocation":
{{$BlahVar ...
Pukka asked 21/12, 2013 at 7:35
7
Solved
When I'm calling a Go template function to output HTML, it displays ZgotmplZ.
Sample code:
http://play.golang.org/p/tfuJa_pFkm
package main
import (
"html/template"
"os"
)
func main() {
fun...
Circuity asked 8/2, 2013 at 3:51
2
Solved
I need a object in client side, so I converted it to JSON using json.marshal and printed it into template. The object is getting printed as escaped JSON string.
I'm expecting it to be var arr=["o1...
Achaea asked 31/1, 2014 at 14:51
3
I am working in Go, and right now I need to print at least 20 options inside a select, so I need to use some kind of loop that goes from 0 to 20 (to get an index).
How can I use a for loop inside ...
Laureenlaurel asked 5/8, 2017 at 20:9
1
Solved
I want to know what's the meaning of $_ in helm template.
I konw helm template is using go sprig template:
helm function_list
But where can I find go template grammar document?
Dobbs asked 1/11, 2022 at 3:33
3
Solved
I send a slice of articles into template. Each articlestruct is like:
type Article struct {
ID uint32 `db:"id" bson:"id,omitempty"`
Content string `db:"content" bson:"content"`
Author string `...
Curiosity asked 25/11, 2016 at 6:28
3
Solved
I am trying to display the contents of a slice on a page. Displaying the templates with static text works. As soon as I try and range over the slice sent to ExTpl(), I get an EOF error.
type Miner...
Exhibitionism asked 27/10, 2017 at 10:27
2
I have below values in values.yaml
pg_hba:
- hostssl all all 0.0.0.0/0 md5
- host all all 0.0.0.0/0 md5
The reqiurement is to check the hostssl line exists , if yes it should go into the if ...
Rubberize asked 13/5, 2020 at 7:16
1 Next >
© 2022 - 2024 — McMap. All rights reserved.