MCPcopy Index your code
hub / github.com/helm/helm / pathValue

Method pathValue

pkg/chart/common/values.go:151–171  ·  view source on GitHub ↗
(path []string)

Source from the content-addressed store, hash-verified

149}
150
151func (v Values) pathValue(path []string) (any, error) {
152 if len(path) == 1 {
153 // if exists must be root key not table
154 if _, ok := v[path[0]]; ok && !istable(v[path[0]]) {
155 return v[path[0]], nil
156 }
157 return nil, ErrNoValue{path[0]}
158 }
159
160 key, path := path[len(path)-1], path[:len(path)-1]
161 // get our table for table path
162 t, err := v.Table(joinPath(path...))
163 if err != nil {
164 return nil, ErrNoValue{key}
165 }
166 // check table for key and ensure value is not a table
167 if k, ok := t[key]; ok && !istable(k) {
168 return k, nil
169 }
170 return nil, ErrNoValue{key}
171}
172
173func parsePath(key string) []string { return strings.Split(key, ".") }
174

Callers 1

PathValueMethod · 0.95

Calls 3

TableMethod · 0.95
joinPathFunction · 0.85
istableFunction · 0.70

Tested by

no test coverage detected