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

Switch namespace and patch transformers to kyaml. #2668

Merged
merged 1 commit into from
Jul 5, 2020

Conversation

monopole
Copy link
Contributor

@monopole monopole commented Jun 30, 2020

This PR is a big (hopefully penultimate) step towards closing #2506 (breaking dependence on apimachinery), which in turn blocks #1500.

This PR is intended to be the only difference between v3.7.0 and v3.8.0.

v3.8.0 has no new features, and no change in the API (compared to v3.7.0), but the output will change. The output may order fields within objects differently. This should have no impact on cluster behavior, and no impact on object-to-object comparisons, but it may cause (text-based) YAML comparison tests to fail.

In v3.8.0, the transformations still (technically) depend on apimachinery, but by default won't use apimachinery code paths - they'll use kyaml instead. That's what can change field order.

If v3.8.0 causes problems for you, switch back to v3.7.0 for now, but please adjust the ordering in your tests. kyaml, not apimachinery, is the intended backing library for yaml manipulation going forward.

There's no global flag to switch back to the old behavior. A global flag could have been introduced, but it would have been impractical. If the flag's default had been to use the old apimachinery code, nobody would have tried the new flag, thus nobody would have tried the new kyaml code. And switching flags in CD scripts is as annoying or more annoying than simply switching back to the 3.7.0 binary.

For those interested, a transformer in the 3.8.0 framework can use the old apimachinery code by using an explicit config containing the line

YAMLSupport = false

This option will, however, go away in the next release. If v3.8.0 works as intended, we can start The Big Delete of apimachinery, and switch from ResMap to []*Rnode, and greatly simplify the code base. Also, this will allow a new version of kustomize to be reintroduced to kubectl.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 30, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 30, 2020
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 30, 2020
@monopole monopole mentioned this pull request Jun 30, 2020
@monopole
Copy link
Contributor Author

/hold

I don't want this submitted accidentally (see top comment). But it's ready for review.

@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 Jun 30, 2020
@monopole monopole force-pushed the doesItWork branch 3 times, most recently from 53dc4ec to 851759f Compare July 4, 2020 23:00
@monopole monopole removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 5, 2020
@monopole monopole merged commit def0022 into kubernetes-sigs:master Jul 5, 2020
@monopole monopole deleted the doesItWork branch July 17, 2020 13:49
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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants