Skip to content

Conversation

@seans3
Copy link
Contributor

@seans3 seans3 commented Oct 19, 2020

  • Implements server-side apply
  • Adds --server-side to kpt live apply to turn on the server-side apply
  • Adds --force-conflicts bool for overwriting applied fields if field manage conflict.
  • Adds --field-manager string flag to dynamically determine the applied fields "owner".
  • Adds a server-side apply e2e test
  • Also Manually tested with all three flags.
$ kapply apply --server-side ~/testdata/testdata-namespace-1
namespace/test-namespace serversideapplied
pod/pod-a serversideapplied
pod/pod-b serversideapplied
pod/pod-c serversideapplied
4 resource(s) applied. 0 created, 0 unchanged, 0 configured, 4 serverside applied
0 resource(s) pruned, 0 skipped

$ kubectl get po -n test-namespace
NAME    READY   STATUS    RESTARTS   AGE
pod-a   1/1     Running   0          11s
pod-b   1/1     Running   0          11s
pod-c   1/1     Running   0          11s

$ kubectl get cm -n test-namespace
NAME                 DATA   AGE
inventory-40650014   4      11s

$ kapply apply --server-side ~/testdata/testdata-namespace-2
pod/pod-b serversideapplied
pod/pod-c serversideapplied
pod/pod-d serversideapplied
3 resource(s) applied. 0 created, 0 unchanged, 0 configured, 3 serverside applied
pod/pod-a pruned
namespace/test-namespace prune skipped
1 resource(s) pruned, 1 skipped

$ kubectl get po -n test-namespace
NAME    READY   STATUS    RESTARTS   AGE
pod-b   1/1     Running   0          29s
pod-c   1/1     Running   0          29s
pod-d   1/1     Running   0          14s

$ kubectl get cm -n test-namespace
NAME                 DATA   AGE
inventory-40650014   3      29s

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 19, 2020
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 19, 2020
Copy link
Member

@mortent mortent left a comment

Choose a reason for hiding this comment

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

This looks good so far. For force-conflicts I think we should just use the same approach as kubectl unless we have a good reason to do something different.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 21, 2020
@seans3 seans3 force-pushed the server-side-apply branch from 1d17700 to 9353764 Compare October 24, 2020 01:19
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 24, 2020
@seans3 seans3 force-pushed the server-side-apply branch 2 times, most recently from d150767 to c6e5b23 Compare October 24, 2020 02:18
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 24, 2020
@seans3 seans3 force-pushed the server-side-apply branch 2 times, most recently from aa92e37 to dd031b9 Compare October 24, 2020 03:25
@seans3 seans3 force-pushed the server-side-apply branch from dd031b9 to 9928537 Compare October 24, 2020 05:55
@seans3
Copy link
Contributor Author

seans3 commented Oct 26, 2020

/assign @mortent

Copy link
Member

@mortent mortent left a comment

Choose a reason for hiding this comment

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

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mortent, seans3

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

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/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.

3 participants