MCPcopy
hub / github.com/helm/helm / TestSecretUpdate

Function TestSecretUpdate

pkg/storage/driver/secrets_test.go:199–227  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

197}
198
199func TestSecretUpdate(t *testing.T) {
200 vers := 1
201 name := "smug-pigeon"
202 namespace := "default"
203 key := testKey(name, vers)
204 rel := releaseStub(name, vers, namespace, common.StatusDeployed)
205
206 secrets := newTestFixtureSecrets(t, []*rspb.Release{rel}...)
207
208 // modify release status code
209 rel.Info.Status = common.StatusSuperseded
210
211 // perform the update
212 if err := secrets.Update(key, rel); err != nil {
213 t.Fatalf("Failed to update release: %s", err)
214 }
215
216 // fetch the updated release
217 goti, err := secrets.Get(key)
218 if err != nil {
219 t.Fatalf("Failed to get release with key %q: %s", key, err)
220 }
221 got := convertReleaserToV1(t, goti)
222
223 // check release has actually been updated by comparing modified fields
224 if rel.Info.Status != got.Info.Status {
225 t.Errorf("Expected status %s, got status %s", rel.Info.Status.String(), got.Info.Status.String())
226 }
227}
228
229func TestSecretDelete(t *testing.T) {
230 vers := 1

Callers

nothing calls this directly

Calls 8

newTestFixtureSecretsFunction · 0.85
convertReleaserToV1Function · 0.85
FatalfMethod · 0.80
testKeyFunction · 0.70
releaseStubFunction · 0.70
UpdateMethod · 0.65
GetMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…