File tree Expand file tree Collapse file tree 4 files changed +14
-11
lines changed
pkg/controller/common/settings Expand file tree Collapse file tree 4 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ require (
77 github.com/Masterminds/sprig/v3 v3.3.0
88 github.com/blang/semver/v4 v4.0.0
99 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
10- github.com/elastic/go-ucfg v0.8.8
10+ github.com/elastic/go-ucfg v0.8.9-0.20250307075119-2a22403faaea
1111 github.com/ghodss/yaml v1.0.0
1212 github.com/gkampitakis/go-snaps v0.5.8
1313 github.com/go-logr/logr v1.4.2
Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZ
4242github.com/docker/docker-credential-helpers v0.8.2 /go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M =
4343github.com/elastic/go-sysinfo v1.15.1 h1:zBmTnFEXxIQ3iwcQuk7MzaUotmKRp3OabbbWM8TdzIQ =
4444github.com/elastic/go-sysinfo v1.15.1 /go.mod h1:jPSuTgXG+dhhh0GKIyI2Cso+w5lPJ5PvVqKlL8LV/Hk =
45- github.com/elastic/go-ucfg v0.8.8 h1:54KIF/2zFKfl0MzsSOCGOsZ3O2bnjFQJ0nDJcLhviyk =
46- github.com/elastic/go-ucfg v0.8.8 /go.mod h1:4E8mPOLSUV9hQ7sgLEJ4bvt0KhMuDJa8joDT2QGAEKA =
45+ github.com/elastic/go-ucfg v0.8.9-0.20250307075119-2a22403faaea h1:SX+ZnuBacMQVu1sNniwUEpi9i3dBaYlbg1WDioQh/ho =
46+ github.com/elastic/go-ucfg v0.8.9-0.20250307075119-2a22403faaea /go.mod h1:4E8mPOLSUV9hQ7sgLEJ4bvt0KhMuDJa8joDT2QGAEKA =
4747github.com/elastic/go-windows v1.0.2 h1:yoLLsAsV5cfg9FLhZ9EXZ2n2sQFKeDYrHenkcivY4vI =
4848github.com/elastic/go-windows v1.0.2 /go.mod h1:bGcDpBzXgYSqM0Gx3DM4+UxFj300SZLixie9u9ixLM8 =
4949github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU =
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ import (
2222type CanonicalConfig ucfg.Config
2323
2424// Options are config options for the YAML file. Currently contains only support for dotted keys.
25- var Options = []ucfg.Option {ucfg .PathSep ("." ), ucfg .AppendValues }
25+ var Options = []ucfg.Option {ucfg .PathSep ("." ), ucfg .AppendValues , ucfg . EscapePath () }
2626
2727// NewCanonicalConfig creates a new empty config.
2828func NewCanonicalConfig () * CanonicalConfig {
Original file line number Diff line number Diff line change @@ -13,16 +13,19 @@ import (
1313
1414func TestCanonicalConfig_Render (t * testing.T ) {
1515 config := MustCanonicalConfig (map [string ]interface {}{
16- "aaa" : "aa a" ,
17- "bbb" : "b bb" ,
18- "aab" : "a a a" ,
19- "key" : map [string ]interface {}{"emptyarray" : []string {}},
20- "withquotes" : "aa\" bb\" aa" ,
21- "zz" : "zzz z z z" ,
16+ "[escaped.key]" : map [string ]interface {}{"[another.escaped.key]" : "value" },
17+ "aaa" : "aa a" ,
18+ "bbb" : "b bb" ,
19+ "aab" : "a a a" ,
20+ "key" : map [string ]interface {}{"emptyarray" : []string {}},
21+ "withquotes" : "aa\" bb\" aa" ,
22+ "zz" : "zzz z z z" ,
2223 })
2324 output , err := config .Render ()
2425 require .NoError (t , err )
25- expected := []byte (`aaa: aa a
26+ expected := []byte (`'[escaped.key]':
27+ '[another.escaped.key]': value
28+ aaa: aa a
2629aab: a a a
2730bbb: b bb
2831key:
You can’t perform that action at this time.
0 commit comments