Skip to content
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

Environment Variable Interpolation is Order Dependent #90466

Closed
TechnoChimp opened this issue Apr 24, 2020 · 3 comments · Fixed by kubernetes/website#21553
Closed

Environment Variable Interpolation is Order Dependent #90466

TechnoChimp opened this issue Apr 24, 2020 · 3 comments · Fixed by kubernetes/website#21553
Assignees
Labels
kind/documentation Categorizes issue or PR as related to documentation. sig/apps Categorizes an issue or PR as relevant to SIG Apps.

Comments

@TechnoChimp
Copy link

What happened:
Variables are not interpolated when the variable assignment is ordered after the variable use.

What you expected to happen:
I would expect variable interpolation to succeed regardless of the order of the variables.

How to reproduce it (as minimally and precisely as possible):
Define variables for a container spec in the following order:

  • name: var2
    value: $(var1).testString2
  • name: var1
    value: testString1

Check the values of the variables inside the container and this is the result:
var1=testString1
var2='$(var1).testString2'

Anything else we need to know?:
Swapping the variable order resolves the issue.

Environment:

  • Kubernetes version (use kubectl version):
    Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.0", GitCommit:"9e991415386e4cf155a24b1da15becaa390438d8", GitTreeState:"clean", BuildDate:"2020-03-25T14:58:59Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"darwin/amd64"}
    Server Version: version.Info{Major:"1", Minor:"15+", GitVersion:"v1.15.10-eks-bac369", GitCommit:"bac3690554985327ae4d13e42169e8b1c2f37226", GitTreeState:"clean", BuildDate:"2020-02-26T01:12:54Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"}

  • Cloud provider or hardware configuration:
    AWS EKS

  • OS (e.g: cat /etc/os-release):
    NAME="Alpine Linux"
    ID=alpine
    VERSION_ID=3.9.4
    PRETTY_NAME="Alpine Linux v3.9"
    HOME_URL="https://alpinelinux.org/"
    BUG_REPORT_URL="https://bugs.alpinelinux.org/"

  • Kernel (e.g. uname -a):
    Linux netshoot-6df4df959b-mwhkh 4.14.173-137.229.amzn2.x86_64 Unit test coverage in Kubelet is lousy. (~30%) #1 SMP Wed Apr 1 18:06:08 UTC 2020 x86_64 Linux

  • Install tools:

  • Network plugin and version (if this is a network-related bug):

  • Others:

@TechnoChimp TechnoChimp added the kind/bug Categorizes issue or PR as related to a bug. label Apr 24, 2020
@k8s-ci-robot k8s-ci-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Apr 24, 2020
@TechnoChimp
Copy link
Author

/sig apps

@k8s-ci-robot k8s-ci-robot added sig/apps Categorizes an issue or PR as relevant to SIG Apps. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 24, 2020
@liggitt liggitt added the kind/documentation Categorizes issue or PR as related to documentation. label Apr 24, 2020
@liggitt
Copy link
Member

liggitt commented Apr 24, 2020

since envvars can reference each other, and cycles are possible, this matches behavior of defining envvars in a shell, etc. this behavior should be documented.

@wawa0210
Copy link
Contributor

wawa0210 commented Jun 7, 2020

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/documentation Categorizes issue or PR as related to documentation. sig/apps Categorizes an issue or PR as relevant to SIG Apps.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants