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

Revert documentation of Kustomize bug as a feature #35522

Merged
merged 1 commit into from
Aug 12, 2022

Conversation

KnVerey
Copy link
Contributor

@KnVerey KnVerey commented Jul 28, 2022

This reverts commit b9da040 / PR #30348. That PR documented a bug in Kustomize as though it were a feature, and unfortunately nobody from the Kustomize team saw the PR.

The bug in question dates back to the origins of Kustomize, when some of the original code was copied out of kubectl, and this undesirable behaviour (for kustomize, not kubectl) went unnoticed in the adaptation. That explains why the code (written for kubectl) had comments that made it seem like the behaviour was intentional.

This behaviour is a clear violation of one of Kustomize's core principles, as documented in our Eschewed Features list:

image

Since this behaviour has been around unnoticed by us for so long, our plan is to to deprecate it and remove it with a major version bump rather than treating it like a bug fix: kubernetes-sigs/kustomize#4730. However, we would like to get the docs for it removed ASAP, as it is absolutely not something we want to encourage users to do.

cc @natasha41575

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 28, 2022
@k8s-ci-robot k8s-ci-robot added language/en Issues or PRs related to English language sig/docs Categorizes an issue or PR as relevant to SIG Docs. labels Jul 28, 2022
@natasha41575
Copy link

/lgtm

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

LGTM label has been added.

Git tree hash: 9fecd9756d6b3a6e207e374c957af4c749b50454

@netlify
Copy link

netlify bot commented Jul 28, 2022

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 39fb094
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/62eac7b06899ee000854c0a9
😎 Deploy Preview https://deploy-preview-35522--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Contributor

@divya-mohan0209 divya-mohan0209 left a comment

Choose a reason for hiding this comment

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

Thank you @KnVerey for this PR!

IMO instead of actually removing the whole section before deprecation/removal, it would be more appropriate to actually state that this is not a recommended approach & it will be deprecated/removed soon with an ETA. Maybe we could even add a caution admonition instead of a note. I know this is the way we typically treat features. However, given that there'll be a warning displayed if this method is followed in the future and there may be a few folks following this currently that might be a better approach. WDYT?

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 29, 2022
```

{{< note >}}
Each variable in the `.env` file becomes a separate key in the ConfigMap that you generate. This is different from the previous example which embeds a file named `.properties` (and all its entries) as the value for a single key.
{{< /note >}}

{{< caution >}}
Versions 4.x and older of Kustomize have a bug that loads values from the environment when they are omitted from an env file. This behaviour should not be relied on and will be removed in version 5 of Kustomize.
Copy link
Contributor

Choose a reason for hiding this comment

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

We should document what Kubernetes (and hence kubectl) release this corresponds to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's kinda impossible to say, since we don't have a specific timeline for v5 yet and it will depend on what upstream release is in progress when we do cut it. Should I be more vague instead, i.e. "a future release of Kustomize"?

Copy link
Contributor

Choose a reason for hiding this comment

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

We avoid statements about the future, unless we can be specific and can commit to the details we're providing.

How about:

The Kustomize tool makes special use of .env files that is different from how most tooling treats this
file.
Typically, a .env file provides default settings for environment variables that you can override, by
setting the actual environment variable. However, Kustomize has a different interpretation. With
Kustomize (and kubectl kustomize), a .env file specifies a set of inputs that you should not
attempt to override by setting the same value in the process environment.

However, there is a bug in kubectl kustomize that occurs when you omit an expected value from an env file.
If you have a .env file that does not specify a value, and you do set the environment variable of the
same name, then the kubectl tool loads that missing value. The authors of Kustomize see this behavior
as a bug.

Copy link
Contributor

Choose a reason for hiding this comment

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

How about, instead, rewriting the page so that the input filename is not .env (because this filename is associated with a convention that is the opposite of the behavior that Kustomize wants to recommend).

It's unfortunate that the field listing those filenames is envs (and not, eg, parameterPaths or inputs). Perhaps a different change to Kustomize or kubectl would also switch to a new preferred field and deprecate envs?

@sftim
Copy link
Contributor

sftim commented Jul 29, 2022

/sig cli

@k8s-ci-robot k8s-ci-robot added the sig/cli Categorizes an issue or PR as relevant to SIG CLI. label Jul 29, 2022
@sftim
Copy link
Contributor

sftim commented Jul 29, 2022

In terms of timing: we could target v1.25 docs with this change, and then put something into the v1.25 release notes to explain that the previous behavior is now seen as a bug.

It's not a deprecation, exactly, but it's pretty similar in terms of how we'd handle it.

@sftim
Copy link
Contributor

sftim commented Jul 29, 2022

/hold

Pending discussion about target branch, and also about the overall approach.
@KnVerey I recommend you also open an issue and link this PR to that issue.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 29, 2022
@natasha41575
Copy link

natasha41575 commented Jul 29, 2022

I'm a little bit confused why reverting the docs change is controversial. It was merged without knowledge or approval by the kustomize maintainers and had it been brought to our attention, we would have fixed the bug a long time ago. I don't think it makes sense to continue documenting a bug that is specifically against kustomize's philosophy that we never intended to be used and don't want users to rely on. I'd really prefer that we stick to @KnVerey's original proposal of removing it from the docs entirely because it shouldn't have been put up there to begin with.

Re: which version of kubernetes/kubectl this change will go in, kustomize release is completely independent of kubernetes and kubectl. It doesn't make sense to guarantee a particular kustomize fix will go into any particular kubernetes release; we have no way of predicting it because we are on our own release schedule and can't time it like that.

@sftim
Copy link
Contributor

sftim commented Jul 31, 2022

I'm a little bit confused why reverting the docs change is controversial. It was merged without knowledge or approval by the kustomize maintainers and had it been brought to our attention, we would have fixed the bug a long time ago. I don't think it makes sense to continue documenting a bug that is specifically against kustomize's philosophy that we never intended to be used and don't want users to rely on. I'd really prefer that we stick to @KnVerey's original proposal of removing it from the docs entirely because it shouldn't have been put up there to begin with.

I have read the proposed changes @natasha41575, and I do have concerns still.

This is not a plain revert. If the PR were a pure reversion, I think it'd be more straightforward to review. With that in mind, @KnVerey, you could open a new PR, omitting changes from b4d5224, and link that PR to the issue (yes, you really should open an issue - if we're reverting an accepted change, then as maintainers for the website we would like an issue logged that tracks the motivation for that revert).

Some of the damage is done. I get that. We need to undo that as much as we can, but we also need to accept that people will be accustomed to the now-considered-buggy behavior that has been present for many minor releases, and it's important that we communicate this updated thinking effectively.

I do recommend shifting much of the discussion to that new issue, rather than this PR. Issue discussions are the right place for “how should we fix this” discussions in the large, whereas PR discussions are better for reviews that look like “watch out, the code changes that are proposed here don't quite do what the description says they should”

@sftim
Copy link
Contributor

sftim commented Aug 2, 2022

@KnVerey / other kustomize folks: would you be willing to open that issue to track the work and allow discussion of a way forward that works for different stakeholders?

@KnVerey
Copy link
Contributor Author

KnVerey commented Aug 3, 2022

Would you be willing to open that issue to track the work and allow discussion of a way forward that works for different stakeholders?

#35669

This is not a plain revert. If the PR were a pure reversion, I think it'd be more straightforward to review.

This was a straight revert. I added the second commit at the request of the docs team: #35522 (review). I am more than happy to go back to a straight revert.

@sftim
Copy link
Contributor

sftim commented Aug 3, 2022

Thanks for the issue. Let's make this a plain revert for now, and then move the issue forward.

@KnVerey
Copy link
Contributor Author

KnVerey commented Aug 3, 2022

Straight revert restored. PTAL @sftim

@sftim
Copy link
Contributor

sftim commented Aug 12, 2022

/lgtm
/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 12, 2022
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 12, 2022
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 3e31a3db315d90259f7d7eb7e8679ba21905e7bc

@natalisucks
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: natalisucks

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 Aug 12, 2022
@k8s-ci-robot k8s-ci-robot merged commit 5494f97 into kubernetes:main Aug 12, 2022
@KnVerey KnVerey deleted the revert-30348 branch August 12, 2022 16:05
@joebowbeer
Copy link
Contributor

Fixes #35669 ?

@sftim
Copy link
Contributor

sftim commented Aug 14, 2022

This PR was not a full fix for #35669, in as much as we still need to explain the shipped behavior to end users and #35669 serve s to track that need.

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. language/en Issues or PRs related to English language lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants