【发布时间】:2021-05-05 20:17:39
【问题描述】:
我正在尝试使用 kubectl --dry-run 生成 yaml 输出。
当我运行它时
$ kubectl create configmap my-config-map -o yaml --dry-run=client | kubectl annotate -f- --dry-run=client -o yaml --local this-is-my-target-directory='{{ template "This.is.long.path.for.some.value" . }}'
我得到以下输出,其中注释被分成 2 行。
apiVersion: v1
kind: ConfigMap
metadata:
annotations:
this-is-my-target-directory: '{{ template "This.is.long.path.for.some.value" .
}}'
creationTimestamp: null
name: my-config-map
我想要的输出是注释应该在一行中。如下所示
apiVersion: v1
kind: ConfigMap
metadata:
annotations:
this-is-my-target-directory: '{{ template "This.is.long.path.for.some.value" . }}'
creationTimestamp: null
name: my-config-map
如果我减小字符串的大小,则它变为 1 行。我在文档中的任何地方都找不到有关行长的任何信息。谁能指导我如何解决这个问题?
【问题讨论】:
标签: kubernetes yaml output kubectl configmap