Skip to content

Commit

Permalink
works where stringvalue makes sense but not replicacount
Browse files Browse the repository at this point in the history
  • Loading branch information
shanalily committed Feb 2, 2022
1 parent 5fd2221 commit 0c05a1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion kyaml/yaml/fns.go
Expand Up @@ -638,7 +638,7 @@ type FieldSetter struct {

func (s FieldSetter) Filter(rn *RNode) (*RNode, error) {
if s.StringValue != "" && s.Value == nil {
s.Value = NewScalarRNode(s.StringValue)
s.Value = NewStringRNode(s.StringValue)
}

if s.Name == "" {
Expand Down
3 changes: 3 additions & 0 deletions kyaml/yaml/rnode.go
Expand Up @@ -110,6 +110,9 @@ func NewScalarRNode(value string) *RNode {
func NewStringRNode(value string) *RNode {
n := yaml.Node{Kind: yaml.ScalarNode}
n.SetString(value)
if IsValueNonString(n.Value) {
n.Style = yaml.DoubleQuotedStyle
}
return NewRNode(&n)
}

Expand Down

0 comments on commit 0c05a1b

Please sign in to comment.