-
-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System path added to requiredEnv if env starts with slash #481
Comments
@strainovic please show your helmfile. So I will check what happened. |
helm create test Content of
export TEST_PATH='/aaa'
helmfile template ---
# Source: test/templates/ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: test
labels:
helm.sh/chart: test-0.1.0
app.kubernetes.io/name: test
app.kubernetes.io/instance: test
app.kubernetes.io/version: "1.16.0"
app.kubernetes.io/managed-by: Helm
spec:
rules:
- host: "chart-example.local"
http:
paths:
- path: C:/Program Files/Git/aaa
pathType: ImplementationSpecific
backend:
service:
name: test
port:
number: 80 As you can see, path has value of I ran this from the GitBash shell. |
try:
|
It still does not work :( releases:
- name: test
chart: ./test
values:
- ingress:
enabled: true
hosts:
- host: chart-example.local
paths:
- path: {{ requiredEnv "TEST_PATH" | quote }}
pathType: ImplementationSpecific # Source: test/templates/ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: test
labels:
helm.sh/chart: test-0.1.0
app.kubernetes.io/name: test
app.kubernetes.io/instance: test
app.kubernetes.io/version: "1.16.0"
app.kubernetes.io/managed-by: Helm
spec:
rules:
- host: "chart-example.local"
http:
paths:
- path: C:/Program Files/Git/aaa
pathType: ImplementationSpecific
backend:
service:
name: test
port:
number: 80 |
@strainovic I will try to see this. Thanks for your feedback. |
@strainovic if use |
- path: {{ env "TEST_PATH" | quote }} export TEST_PATH='/aaa'
echo ${TEST_PATH}
/aaa
helmfile template | grep '\- path: '
Building dependency release=test, chart=test
Templating release=test, chart=test
- path: C:/Program Files/Git/aaa |
I tested it on Ubuntu on Windows WSL and it works fine with the same helm/helmfile versions. helm version
version.BuildInfo{Version:"v3.10.1", GitCommit:"9f88ccb6aee40b9a0535fcc7efea6055e1ef72c9", GitTreeState:"clean", GoVersion:"go1.18.7"} helmfile version
Helmfile version 0.146.0 helmfile template | grep '\- path: '
Building dependency release=test, chart=test
Templating release=test, chart=test
- path: /aaa |
@strainovic https://github.com/git-for-windows/build-extra/blob/main/ReleaseNotes.md#known-issues If you specify command-line options starting with a slash, POSIX-to-Windows path conversion will kick in converting e.g. "/usr/bin/bash.exe" to "C:\Program Files\Git\usr\bin\bash.exe". When that is not desired -- e.g. "--upload-pack=/opt/git/bin/git-upload-pack" or "-L/regex/" -- you need to set the environment variable MSYS_NO_PATHCONV temporarily, like so:
MSYS_NO_PATHCONV=1 git blame -L/pathconv/ msys2_path_conv.cc
Alternatively, you can double the first slash to avoid POSIX-to-Windows path conversion, e.g. "//usr/bin/bash.exe". |
@strainovic I don't have git bash. Please try to test this. And give feedback. Thanks very much. |
Yes, it works! :) export MSYS_NO_PATHCONV=1 helmfile template | grep '\- path: '
Building dependency release=test, chart=test
Templating release=test, chart=test
- path: /aaa Maybe this one should be documented somewhere? Thanks! |
@strainovic could you post a PR? Thanks very much. |
Yes, no problem. Can you please tell me where it would be the most appropriate to document? Thanks :) |
https://github.com/helmfile/helmfile/blob/main/docs/templating_funcs.md#requiredenv |
@strainovic Thanks very much. |
Operating system
Windows 10
Helmfile Version
0.146.0
Helm Version
3.10.1
Bug description
When we set env variable TEST='/path' and refer to it with "{{ requiredEnv
TEST
}}", within git bash, output in the rendered manifest will getC:/Program Files/Git/path
. If we remove the slash, the manifest will getpath
.Any explanation for this?
Thanks
Example helmfile.yaml
not relevant
Error message you've seen (if any)
none
Steps to reproduce
Working Helmfile Version
unknown
Relevant discussion
No response
The text was updated successfully, but these errors were encountered: