-
I would like to use KCL to build a configuration file where some values depend on the current shell environment. Currently, I work around it by using the override option
kcl run --overrides "_HOME=${HOME}" -- "/path/to/kcl/file" But I worry that I may need a lot of overrides in the future once the config starts to get big. Is there something more straight forward without using override like maybe
kcl run -- "/path/to/kcl/file" |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Hello @ealap . Currently, there is no such built-in function in KCL, but it can be considered to be added in the next major version v0.9.0. |
Beta Was this translation helpful? Give feedback.
-
The env read function: https://www.kcl-lang.io/docs/reference/model/file#read_env |
Beta Was this translation helpful? Give feedback.
-
Hi @Peefy
now nodes:
- kubeadmConfigPatches:
- "kind: ClusterConfiguration\netcd:\n external:\n endpoints: \n - http://localhost:2379\napiServer:\n extraArgs:\n runtime-config: api/all=true\n storage-media-type: application/json\n audit-log-path: /var/log/audit/kube-apiserver-audit.log\n audit-policy-file: /etc/kubernetes/audit-policy/apiserver-audit-policy.yaml\n extraVolumes:\n - name: \"audit-logs\"\n hostPath: /var/log/audit\n mountPath: /var/log/audit\n - name: audit-policy\n hostPath: /etc/kubernetes/audit-policy\n mountPath: /etc/kubernetes/audit-policy" expect nodes:
- kubeadmConfigPatches:
- |
kind: ClusterConfiguration
etcd:
external:
endpoints:
- http://localhost:2379
apiServer:
extraArgs:
runtime-config: api/all=true
storage-media-type: application/json
audit-log-path: /var/log/audit/kube-apiserver-audit.log
audit-policy-file: /etc/kubernetes/audit-policy/apiserver-audit-policy.yaml
extraVolumes:
- name: "audit-logs"
hostPath: /var/log/audit
mountPath: /var/log/audit
- name: audit-policy
hostPath: /etc/kubernetes/audit-policy
mountPath: /etc/kubernetes/audit-policy |
Beta Was this translation helpful? Give feedback.
-
Hello @liangyuanpeng , you need to remove the un-used blank chars that I've mentioned before. |
Beta Was this translation helpful? Give feedback.
Hello @ealap . Currently, there is no such built-in function in KCL, but it can be considered to be added in the next major version v0.9.0.