client
client copied to clipboard
Improve "kn service apply" to use a strategic patch strategy for perfoming the 3-way merge
Feature request
As described in https://github.com/knative/client/pull/964#issuecomment-707184807 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.
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
.
/remove-lifecycle stale
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
.
/remove-lifecycle stale