mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-08-23 22:26:49 +00:00
Fix the issue that ownerref is not set with ignorefields (#794)
Scorecard supply-chain security / Scorecard analysis (push) Failing after 45s
Post / images (amd64) (push) Failing after 5m38s
Post / images (arm64) (push) Failing after 5m35s
Post / image manifest (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Post / coverage (push) Failing after 26m35s
Close stale issues and PRs / stale (push) Successful in 25s
Scorecard supply-chain security / Scorecard analysis (push) Failing after 45s
Post / images (amd64) (push) Failing after 5m38s
Post / images (arm64) (push) Failing after 5m35s
Post / image manifest (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Post / coverage (push) Failing after 26m35s
Close stale issues and PRs / stale (push) Successful in 25s
Signed-off-by: Jian Qiu <jqiu@redhat.com>
This commit is contained in:
@@ -95,12 +95,8 @@ func (c *ServerSideApply) Apply(
|
||||
ctx, required.GetName(), metav1.GetOptions{})
|
||||
switch {
|
||||
case errors.IsNotFound(err):
|
||||
// if object is not found, directly apply without removing ignore fields in the object.
|
||||
obj, createErr := c.client.
|
||||
Resource(gvr).
|
||||
Namespace(required.GetNamespace()).
|
||||
Apply(ctx, required.GetName(), requiredOriginal, metav1.ApplyOptions{FieldManager: fieldManager, Force: force})
|
||||
return obj, createErr
|
||||
// if object is not found, use requiredOriginal to apply so the ignore fields are kept when create
|
||||
required = requiredOriginal
|
||||
case err != nil:
|
||||
return nil, err
|
||||
case len(existing.GetAnnotations()) > 0:
|
||||
|
||||
Reference in New Issue
Block a user