MCPcopy
hub / github.com/helm/helm / TestExecHook_WaitOptionsPassedDownstream

Function TestExecHook_WaitOptionsPassedDownstream

pkg/action/hooks_test.go:448–494  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

446}
447
448func TestExecHook_WaitOptionsPassedDownstream(t *testing.T) {
449 is := assert.New(t)
450
451 failer := &kubefake.FailingKubeClient{
452 PrintingKubeClient: kubefake.PrintingKubeClient{Out: io.Discard},
453 }
454
455 configuration := &Configuration{
456 Releases: storage.Init(driver.NewMemory()),
457 KubeClient: failer,
458 Capabilities: common.DefaultCapabilities,
459 }
460
461 rel := &release.Release{
462 Name: "test-release",
463 Namespace: "test",
464 Hooks: []*release.Hook{
465 {
466 Name: "test-hook",
467 Kind: "ConfigMap",
468 Path: "templates/hook.yaml",
469 Manifest: `apiVersion: v1
470kind: ConfigMap
471metadata:
472 name: test-hook
473 namespace: test
474data:
475 foo: bar
476`,
477 Weight: 0,
478 Events: []release.HookEvent{
479 release.HookPreInstall,
480 },
481 },
482 },
483 }
484
485 // Use WithWaitContext as a marker WaitOption that we can track
486 ctx := context.Background()
487 waitOptions := []kube.WaitOption{kube.WithWaitContext(ctx)}
488
489 err := configuration.execHook(rel, release.HookPreInstall, kube.StatusWatcherStrategy, waitOptions, 600, false)
490 is.NoError(err)
491
492 // Verify that WaitOptions were passed to GetWaiter
493 is.NotEmpty(failer.RecordedWaitOptions, "WaitOptions should be passed to GetWaiter")
494}

Callers

nothing calls this directly

Calls 4

execHookMethod · 0.95
InitFunction · 0.92
NewMemoryFunction · 0.92
WithWaitContextFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…