MCPcopy Create free account
hub / github.com/devspace-sh/devspace / Get

Function Get

pkg/devspace/config/versions/versions.go:85–104  ·  view source on GitHub ↗

Get parses only the key from the config

(data map[string]interface{}, keys ...string)

Source from the content-addressed store, hash-verified

83
84// Get parses only the key from the config
85func Get(data map[string]interface{}, keys ...string) (map[string]interface{}, error) {
86 retMap := map[string]interface{}{}
87 err := util.Convert(data, &retMap)
88 if err != nil {
89 return nil, err
90 }
91
92 retConfig := map[string]interface{}{
93 "version": retMap["version"],
94 "name": retMap["name"],
95 }
96 for _, key := range keys {
97 keyData, ok := retMap[key]
98 if ok {
99 retConfig[key] = keyData
100 }
101 }
102
103 return retConfig, nil
104}
105
106// ParseVariables parses only the variables from the config
107func ParseVariables(data map[string]interface{}, log log.Logger) (map[string]*latest.Variable, error) {

Callers 6

ParseMethod · 0.92
ParseMethod · 0.92
ResolveImportsFunction · 0.92
ParseVariablesFunction · 0.85
getProfilesFunction · 0.85
getActivatedProfilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected