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

feat: support environment variables interpolation #21098

Conversation

AhmedGrati
Copy link
Contributor

Resolves #21057.

Does this PR introduce a user-facing change?

Adding support to environment variables interpolation in the Kube manifests.

Copy link
Contributor

openshift-ci bot commented Dec 28, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: AhmedGrati
Once this PR has been reviewed and has the lgtm label, please assign jwhonce for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@AhmedGrati AhmedGrati force-pushed the feat-support-env-variables-interpolation branch from e01bfdc to 17a7127 Compare December 28, 2023 20:39
@rhatdan
Copy link
Member

rhatdan commented Dec 30, 2023

Looks like your tests are failing. I am fine with this, but it does make the YAML file incompatible with Kubernetes, correct?

@AhmedGrati
Copy link
Contributor Author

AhmedGrati commented Jan 2, 2024

@rhatdan considering the following Kubernetes yaml:

apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: "2021-08-05T17:55:51Z"
  labels:
    app: foobar
  name: echo_pod
spec:
  containers:
  - command:
    - /bin/sh
    - -c
    - 'echo paren$(FOO) brace${FOO} dollardollarparen$$(FOO) interp$(FOO)olate'
    env:
    - name: PATH
      value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    - name: TERM
      value: xterm
    - name: container
      value: podman
    - name: FOO
      value: BAR

The expected behavior is that we should not interpolate and change the command section. So I'm not sure about this PR and if there's any alternative to mitigate this kind of issues. (BTW this is the failing test).

@rhatdan
Copy link
Member

rhatdan commented Jan 2, 2024

@ygalblum PTAL

@ygalblum
Copy link
Contributor

ygalblum commented Jan 2, 2024

Deciding where to interpolate and where not to will (and has) become as issue. Since K8S doesn't support this, I don't think Podman should.
I've looked at the linked issue (#21057 (comment)) and while there is an oc command that handles it, it is not the create or apply but instead a different command, process, whose output is piped into the former.
So, I think we should close this PR without merging and the issue as won't fix

@rhatdan rhatdan closed this Jan 2, 2024
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Apr 2, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

podman kube play should be able to read the bash variables
4 participants