What does "|-" mean in a kubernetes config file

8/16/2019

For example, in the following secret file(example taken from here):

apiVersion: v1
kind: Secret
metadata:
  name: mysecret
type: Opaque
stringData:
  config.yaml: |-
    apiUrl: "https://my.api.com/api/v1"
    username: {{username}}
    password: {{password}}

What does |- mean?

-- Caner
kubernetes

1 Answer

8/16/2019

That is Block Chomping Indicator from yaml spec.
Reference : https://yaml.org/spec/1.2/spec.html#id2794534

|-
"strip": remove the line feed, remove the trailing blank lines from the block.

-- Nagesh Salunke
Source: StackOverflow