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

Upgrade kustomize-in-kubectl to v4.1.2 #101120

Merged
merged 1 commit into from Apr 15, 2021

Conversation

monopole
Copy link
Contributor

@monopole monopole commented Apr 14, 2021

What type of PR is this?

/kind bug
/sig cli
/priority important-soon

What this PR does / why we need it:

This upgrades kustomize to depend on kustomize v4.1.2.
It mitigates a concern that a user might download and use a
maliciously crafted remote configuration.

Special notes for your reviewer:

This is a go.mod change to upgrade the kustomize
dependency from v4.0.5 to v4.1.2.

Does this PR introduce a user-facing change?

Yes with respect to kubectl v1.21, no with respect to earlier versions
of kubectl. kustomize was last upgraded on 8 March 2021 (#98946).

If a user has a kustomization.yaml file with values defined for the
helmChartInflationGenerator field, and the user runs

kubectl kustomize {target}

the user will be asked to also specify the --enable-helm flag to
allow processing to continue. Previously the --enable-helm flag
did not exist. This is to increase awareness that helm template...
will be run as a subprocess to inflate a template.

Further, the helmBin subfield of helmChartInflationGenerator field
will be ignored. If the helm command is anything other than simply
helm (on the user's PATH), then the user must specify it via the
--helm-command flag.

The helmChartInflationGenerator was not read at all in kubectl
versions preceding v1.21.

Upgrades functionality of `kubectl kustomize` as described at
https://github.com/kubernetes-sigs/kustomize/releases/tag/kustomize%2Fv4.1.2

How was this PR made?

./hack/pin-dependency.sh sigs.k8s.io/kustomize/kyaml v0.10.17
./hack/pin-dependency.sh sigs.k8s.io/kustomize/cmd/config v0.9.10
./hack/pin-dependency.sh sigs.k8s.io/kustomize/api v0.8.8
./hack/pin-dependency.sh sigs.k8s.io/kustomize/kustomize/v4 v4.1.2

./hack/update-vendor.sh
./hack/update-internal-modules.sh 
./hack/lint-dependencies.sh 

rm ./_output/local/bin/linux/amd64/kubectl
make kubectl
./_output/local/bin/linux/amd64/kubectl help kustomize | grep enable-helm
      --enable-helm=false: Enable use of the Helm chart inflator generator.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. sig/cli Categorizes an issue or PR as relevant to SIG CLI. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. area/apiserver area/cloudprovider area/code-generation area/dependency Issues or PRs related to dependency changes area/kubectl labels Apr 14, 2021
@k8s-ci-robot k8s-ci-robot requested review from adtac, caesarxuchao and a team April 14, 2021 17:56
@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. labels Apr 14, 2021
@monopole
Copy link
Contributor Author

/test pull-kubernetes-unit

@KnVerey
Copy link
Contributor

KnVerey commented Apr 14, 2021

/test pull-kubernetes-e2e-kind-ipv6
/test pull-kubernetes-integration

@monopole monopole changed the title Upgrade kustomize-in-kubectl to v4.1.0 Upgrade kustomize-in-kubectl to v4.1.1 Apr 15, 2021
@KnVerey
Copy link
Contributor

KnVerey commented Apr 15, 2021

/triage accepted
/lgtm

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Apr 15, 2021
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 15, 2021
go.mod Outdated Show resolved Hide resolved
@@ -39,6 +41,8 @@ type Transformers interface {
// short circuiting on recursive types.
func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, config *Config) (err error) {
overwrite := config.Overwrite
overwriteWithEmptySrc := config.overwriteWithEmptyValue
config.overwriteWithEmptyValue = false
Copy link
Member

Choose a reason for hiding this comment

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

this change looks buggy... opened darccio/mergo#187

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rolled back to mergo v0.3.5, so no change in k8s mergo deps for now.

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 15, 2021
@monopole monopole changed the title Upgrade kustomize-in-kubectl to v4.1.1 Upgrade kustomize-in-kubectl to v4.1.2 Apr 15, 2021
@liggitt
Copy link
Member

liggitt commented Apr 15, 2021

/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 Apr 15, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, monopole

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 Apr 15, 2021
@monopole
Copy link
Contributor Author

/test pull-kubernetes-e2e-kind-ipv6

@k8s-ci-robot k8s-ci-robot merged commit 743ceb7 into kubernetes:master Apr 15, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.22 milestone Apr 15, 2021
k8s-ci-robot added a commit that referenced this pull request Apr 19, 2021
…120-upstream-release-1.21

Automated cherry pick of #101120: Upgrade kustomize-in-kubectl to v4.1.2
@pickfire
Copy link

pickfire commented Jun 1, 2021

Isn't this breaking changes such that --enable-helm is required now but previously it wasn't require? Shouldn't it require a new version to do these sort of breaking changes? Also, the error message was very confusing.

Error: accumulating resources: accumulation err='accumulating resources from '../../base': '/mnt/overlays/dev/base' must resolve to a file': recursed accumulation of path '/mnt/overlays/dev/base': accumulating resources: accumulation err='accumulating resources from '../../../resources/nats': '/mnt/resources/nats' must resolve to a file': recursed accumulation of path '/mnt/resources/nats': trouble configuring builtin HelmChartInflationGenerator with config: `
name: stan
releaseName: semut-stan
repo: https://nats-io.github.io/k8s/helm/charts/
valuesFile: values.yaml
version: 0.8.0
`: must specify --enable-helm

Also, apply was broken in 1.21.1, it cannot specify --enable-helm but it requires --enable-helm?

wadey added a commit to slackhq/nebula that referenced this pull request Nov 3, 2021
It looks like there is a bad bug in newer versions:

- darccio/mergo#187
- kubernetes/kubernetes#101120 (review)
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. area/apiserver area/cloudprovider area/code-generation area/dependency Issues or PRs related to dependency changes area/kubectl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants