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

Improve "kn service apply" to use a strategic patch strategy for perfoming the 3-way merge #1073

Open
Tracked by #1579
rhuss opened this issue Oct 26, 2020 · 4 comments
Labels
kind/enhancement kind/feature New feature or request size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Issues which should be fixed (post-triage)

Comments

@rhuss
Copy link
Contributor

rhuss commented Oct 26, 2020

Feature request

As described in #964 (comment) the way we are performing the 3way merge for a kn service apply is limited and can be improved.

Use case

Instead of doing a jsonmergepatch.CreateThreeWayJSONMergePatch, ideally a strategicpatch.CreateThreeWayMergePatch should be used but this fails because of lack of support for CRDs like the Knative Service.

// Compute a three way strategic merge patch to send to server.
lookupPatchMeta, err := strategicpatch.NewPatchMetaFromStruct(servingv1.Service{})
if err != nil {
	return false, err
}
patch, _ = strategicpatch.CreateThreeWayMergePatch(uOriginalService, uModifiedService, uCurrentService, lookupPatchMeta, false)

Also, an "overwrite" mode should be configurable to allow a forced overwrite in case of a conflict.

It is not clear now, whether the Kubernetes provided utility methods can be used or whether we need to implement our own merge algorithm (based on the knowledge of the supported CRD) instead.

@rhuss rhuss added the kind/feature New feature or request label Oct 26, 2020
@github-actions
Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 25, 2021
@navidshaikh
Copy link
Collaborator

/remove-lifecycle stale

@knative-prow-robot knative-prow-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 25, 2021
@github-actions
Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 26, 2021
@rhuss
Copy link
Contributor Author

rhuss commented Apr 26, 2021

/remove-lifecycle stale

@knative-prow-robot knative-prow-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 26, 2021
@rhuss rhuss added the triage/accepted Issues which should be fixed (post-triage) label Jul 9, 2021
@rhuss rhuss added this to Backlog in Roadmap Jul 9, 2021
@rhuss rhuss added kind/enhancement size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 4, 2022
@rhuss rhuss removed this from In Progress in Roadmap Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement kind/feature New feature or request size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Issues which should be fixed (post-triage)
Projects
Status: Backlog
Development

No branches or pull requests

3 participants