MCPcopy
hub / github.com/apecloud/kubeblocks / getCompValueFromMap

Function getCompValueFromMap

pkg/controller/component/component.go:117–126  ·  view source on GitHub ↗
(comp *appsv1.Component, m map[string]string, tp string, key string)

Source from the content-addressed store, hash-verified

115}
116
117func getCompValueFromMap(comp *appsv1.Component, m map[string]string, tp string, key string) (string, error) {
118 if m == nil {
119 return "", fmt.Errorf("required %s %s is not provided, component: %s", tp, key, comp.GetName())
120 }
121 val, ok := m[key]
122 if !ok {
123 return "", fmt.Errorf("required %s %s is not provided, component: %s", tp, key, comp.GetName())
124 }
125 return val, nil
126}
127
128// GetCompDefByName gets the component definition by component definition name.
129func GetCompDefByName(ctx context.Context, cli client.Reader, compDefName string) (*appsv1.ComponentDefinition, error) {

Callers 2

getCompAnnotationValueFunction · 0.85
getCompLabelValueFunction · 0.85

Calls 1

GetNameMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…