2.6.3.2.7. indent function
indent
功能会返回经过 padded 的 data string
。查看该功能的以下语法:
func indent (spaces int, data string) (padded-data string)
使用功能时,输入带有特定空格数的数据字符串。查看以下使用 indent
功能的配置策略示例:
apiVersion: policy.open-cluster-management.io/v1 kind: ConfigurationPolicy metadata: name: demo-fromsecret namespace: test spec: namespaceSelector: exclude: - kube-* include: - default object-templates: - complianceType: musthave objectDefinition: ... data: Ca-cert: | {{ ( index ( lookup "v1" "Secret" "default" "mycert-tls" ).data "ca.pem" ) | base64dec | indent 4 }}