Skip to content

Conversation

@jpbetz
Copy link
Contributor

@jpbetz jpbetz commented Oct 1, 2020

If the managed fields for a complex type has no children fields (e.g. emptyrDir: {}), and the live object has not fields, skip reconciliation with schemas entirely.

Fixes the integration test failure in k8s: https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/93901/pull-kubernetes-integration/1311377692632813568. How I reproduced:

kubectl apply -f hack/testdata/retainKeys/deployment/deployment-before.yaml
kubectl apply -f hack/testdata/retainKeys/deployment/deployment-after.yaml
kubectl get deployment test-deployment-retainkeys -oyaml | grep "emptyDir"

Before this fix, emptyDir: {} would match in the fieldset because reconciliation created a replacement fieldset for the emptyDir that has both a Member and an empty Children list (created as a side effect of calling descendToPath), which prevented it from being properly removed when deployment-after.yaml was applied and the emptyDir was removed entirely and replaced with a hostPath.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 1, 2020
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 1, 2020
@jpbetz
Copy link
Contributor Author

jpbetz commented Oct 1, 2020

@apelisse One last fix and then I think k8s tests should all pass.

@jpbetz jpbetz force-pushed the fix-noop-granular-case branch from 5d26952 to 8443f34 Compare October 1, 2020 02:23
@apelisse
Copy link
Contributor

apelisse commented Oct 1, 2020

shrug
/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 Oct 1, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: apelisse, jpbetz

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 Oct 1, 2020
@k8s-ci-robot k8s-ci-robot merged commit b3cf1e8 into kubernetes-sigs:master Oct 1, 2020
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. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants