MCPcopy
hub / github.com/helm/helm / TestRenderWithDNS

Function TestRenderWithDNS

pkg/engine/engine_test.go:221–255  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

219}
220
221func TestRenderWithDNS(t *testing.T) {
222 c := &chart.Chart{
223 Metadata: &chart.Metadata{
224 Name: "moby",
225 Version: "1.2.3",
226 },
227 Templates: []*common.File{
228 {Name: "templates/test1", ModTime: time.Now(), Data: []byte("{{getHostByName \"helm.sh\"}}")},
229 },
230 Values: map[string]any{},
231 }
232
233 vals := map[string]any{
234 "Values": map[string]any{},
235 }
236
237 v, err := util.CoalesceValues(c, vals)
238 if err != nil {
239 t.Fatalf("Failed to coalesce values: %s", err)
240 }
241
242 var e Engine
243 e.EnableDNS = true
244 out, err := e.Render(c, v)
245 if err != nil {
246 t.Errorf("Failed to render templates: %s", err)
247 }
248
249 for _, val := range c.Templates {
250 fp := path.Join("moby", val.Name)
251 if out[fp] == "" {
252 t.Errorf("Expected IP address, got %q", out[fp])
253 }
254 }
255}
256
257type kindProps struct {
258 shouldErr error

Callers

nothing calls this directly

Calls 4

RenderMethod · 0.95
CoalesceValuesFunction · 0.92
NowMethod · 0.80
FatalfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…