(comp *appsv1.Component, m map[string]string, tp string, key string)
| 115 | } |
| 116 | |
| 117 | func 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. |
| 129 | func GetCompDefByName(ctx context.Context, cli client.Reader, compDefName string) (*appsv1.ComponentDefinition, error) { |
no test coverage detected
searching dependent graphs…