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

Added the behavior of double dollar signs in env, command and args #101916

Conversation

MartinKanters
Copy link
Contributor

@MartinKanters MartinKanters commented May 11, 2021

What type of PR is this?

/kind documentation

What this PR does / why we need it:

The documentation currently mentions that only the $(VAR) syntax can be escaped with $$(VAR). It's very confusing that every $$ will be reduced to one $. To me, this is a bug, which I delivered a fix for. While still open, it was softly declined since this is the current behavior for 5 years already, so we cannot break it for those users (which is fair). The final thing what we can do it to at least document it correctly.

Which issue(s) this PR fixes:

Fixes #101137

Special notes for your reviewer:

This bug was found and reported first in Tekton Pipelines issue 3871.
Please read the comments on the issue and original PR for more background.

Also, I'm not sure if this docs directly affect the reference documentation somehow. Please let me know if I need to change something else.

Release notes

Corrected the documentation for escaping dollar signs in a container's env, command and args property.

@k8s-ci-robot k8s-ci-robot added kind/documentation Categorizes issue or PR as related to documentation. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 11, 2021
@k8s-ci-robot
Copy link
Contributor

@MartinKanters: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label May 11, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @MartinKanters. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels May 11, 2021
@k8s-ci-robot k8s-ci-robot added sig/apps Categorizes an issue or PR as relevant to SIG Apps. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 11, 2021
@sftim
Copy link
Contributor

sftim commented May 11, 2021

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 11, 2021
Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a guide somewhere about the commands you need to run to generate related code, and then commit that (2 commits in total).

It's not all in one page and when I need to do this I often have to go hunting for the exact runes to use. If you have a working Golang development environment locally, make generated_files should do what you need.

@MartinKanters
Copy link
Contributor Author

MartinKanters commented May 11, 2021

There's a guide somewhere about the commands you need to run to generate related code, and then commit that (2 commits in total).

It's not all in one page and when I need to do this I often have to go hunting for the exact runes to use. If you have a working Golang development environment locally, make generated_files should do what you need.

Alright thanks! That's only after this PR gets approved and merged, I'm guessing?

@fejta-bot
Copy link

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

@sftim
Copy link
Contributor

sftim commented May 12, 2021

Replying to #101916 (comment)

You need to add that second commit to this PR before it'll pass tests, and it won't get “LGTM” review until tests are green.
If you'd like help adding that second commit, reply and I hope someone'll make time to offer advice.

@sftim
Copy link
Contributor

sftim commented May 12, 2021

Please also see #101916 (comment)

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels May 12, 2021
@MartinKanters
Copy link
Contributor Author

I just noticed I changed the file at pkg/apis/core/types.go instead of staging/src/k8s.io/api/core/v1/types.go. I need to fix that and will then generate the docs.

@MartinKanters
Copy link
Contributor Author

/retest

Copy link
Member

@thockin thockin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super minor nits but the repeat several times :)

@@ -1828,10 +1828,10 @@ type EnvVar struct {
// Optional: Defaults to ""; variable references $(VAR_NAME) are expanded
// using the previous defined environment variables in the container and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while we are editing - s/previous/previously/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find, I've took it with my doc changes

// exists or not.
// the reference in the input string will be unchanged. Double $$ are
// reduced to a single $, which allows for escaping the $(VAR_NAME)
// syntax: i.e. $$(VAR_NAME). Escaped references will never be expanded,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that makes it more clear indeed. I've processed it.

@thockin thockin self-assigned this May 18, 2021
Copy link
Member

@thockin thockin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 18, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MartinKanters, thockin

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

The pull request process is described 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 18, 2021
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

1 similar comment
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@MartinKanters
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit 1d0e5ac into kubernetes:master May 19, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.22 milestone May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/documentation Categorizes issue or PR as related to documentation. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/apps Categorizes an issue or PR as relevant to SIG Apps. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Double dollar signs in a container's args or env section are incorrectly treated as escape characters
5 participants