Skip to content

lost the indentation when use multi lines #337

@yxxhero

Description

@yxxhero
releases:
- name: foo
  chart: ./raw
  values:
  - templates:
    - |
      apiVersion: v1
      kind: ConfigMap
      metadata:
        name: "abc"
        namespace: "abc"
      data:
        foo: FOO

go code:

func (hs *HelmState) UnmarshalYAML(b []byte) error {
	decodeVerify := yaml.NewDecoder(b, true)
	helmStateInfo := make(map[string]interface{})
	if err := decodeVerify(&helmStateInfo); err != nil {
		return err
	}
	isStrict, err := policy.Checker(helmStateInfo)
	if err != nil {
		if isStrict {
			return err
		}
		fmt.Fprintf(os.Stderr, "Warning: %v\n", err)
	}
	decodeState := yaml.NewDecoder(b, true)

	return decodeState((*helmStateAlias)(hs))
}

b []byte:

releases:
- name: foo
  chart: ./raw
  values:
  - templates:
    - |
      apiVersion: v1
      kind: ConfigMap
      metadata:
      name: "abc"
      namespace: "abc"
      data:
      foo: FOO

Lost the indentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdecoder

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions