MCPcopy
hub / github.com/helm/helm / TestUpgradeInstallWithLabels

Function TestUpgradeInstallWithLabels

pkg/cmd/upgrade_test.go:474–504  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

472}
473
474func TestUpgradeInstallWithLabels(t *testing.T) {
475 releaseName := "funny-bunny-labels"
476 _, _, chartPath := prepareMockRelease(t, releaseName)
477
478 defer resetEnv()()
479
480 store := storageFixture()
481
482 expectedLabels := map[string]string{
483 "key1": "val1",
484 "key2": "val2",
485 }
486 cmd := fmt.Sprintf("upgrade %s --install --labels key1=val1,key2=val2 '%s'", releaseName, chartPath)
487 _, _, err := executeActionCommandC(store, cmd)
488 if err != nil {
489 t.Errorf("unexpected error, got '%v'", err)
490 }
491
492 updatedReli, err := store.Get(releaseName, 1)
493 if err != nil {
494 t.Errorf("unexpected error, got '%v'", err)
495 }
496 updatedRel, err := releaserToV1Release(updatedReli)
497 if err != nil {
498 t.Errorf("unexpected error, got '%v'", err)
499 }
500
501 if !reflect.DeepEqual(updatedRel.Labels, expectedLabels) {
502 t.Errorf("Expected {%v}, got {%v}", expectedLabels, updatedRel.Labels)
503 }
504}
505
506func prepareMockReleaseWithSecret(t *testing.T, releaseName string) (func(n string, v int, ch *chart.Chart) *release.Release, *chart.Chart, string) {
507 t.Helper()

Callers

nothing calls this directly

Calls 6

prepareMockReleaseFunction · 0.85
storageFixtureFunction · 0.85
executeActionCommandCFunction · 0.85
resetEnvFunction · 0.70
releaserToV1ReleaseFunction · 0.70
GetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…