MCPcopy
hub / github.com/helm/helm / Init

Method Init

pkg/storage/driver/mock_test.go:103–116  ·  view source on GitHub ↗

Init initializes the MockConfigMapsInterface with the set of releases.

(t *testing.T, releases ...*rspb.Release)

Source from the content-addressed store, hash-verified

101
102// Init initializes the MockConfigMapsInterface with the set of releases.
103func (mock *MockConfigMapsInterface) Init(t *testing.T, releases ...*rspb.Release) {
104 t.Helper()
105 mock.objects = map[string]*v1.ConfigMap{}
106
107 for _, rls := range releases {
108 objkey := testKey(rls.Name, rls.Version)
109
110 cfgmap, err := newConfigMapsObject(objkey, rls, nil)
111 if err != nil {
112 t.Fatalf("Failed to create configmap: %s", err)
113 }
114 mock.objects[objkey] = cfgmap
115 }
116}
117
118// Get returns the ConfigMap by name.
119func (mock *MockConfigMapsInterface) Get(_ context.Context, name string, _ metav1.GetOptions) (*v1.ConfigMap, error) {

Callers 1

newTestFixtureCfgMapsFunction · 0.95

Calls 4

newConfigMapsObjectFunction · 0.85
HelperMethod · 0.80
FatalfMethod · 0.80
testKeyFunction · 0.70

Tested by

no test coverage detected