Closed mishindm closed 1 month ago
A basic implementation (obviously without necessary checks) but working for us:
if err != nil {
if errors.IsNotFound(err) && action.GetSubresource() == "" {
switch action.GetPatchType() {
case types.ApplyPatchType:
body := map[string]interface{}{}
err := json.Unmarshal(action.GetPatch(), &body)
if err != nil {
return true, nil, err
}
objcopy := &unstructured.Unstructured{
Object: body,
}
err = tracker.Create(gvr, objcopy, ns)
if err != nil {
return true, nil, err
}
obj, err = tracker.Get(gvr, ns, action.GetName())
return true, obj, err
}
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/reopen
/remove-lifecycle rotten
Please send feedback to sig-contributor-experience at kubernetes/community.
/close not-planned
@k8s-triage-robot: Closing this issue, marking it as "Not Planned".
We have the error after Get returning "object not found" error https://github.com/kubernetes/client-go/blob/fb8b7346aacefea5ee2ab2e234afc4451c90c435/testing/fixture.go#L146
However k8s will create a new object if the patch type == ApplyPatchType