Skip to content

Commit

Permalink
Fix comment
Browse files Browse the repository at this point in the history
Signed-off-by: Somtochi Onyekwere <[email protected]>
  • Loading branch information
somtochiama committed Jan 19, 2022
1 parent 80c5a5b commit 092ffc0
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions ssa/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func patchRemoveFieldsManagers(object *unstructured.Unstructured, managers []Fil
}

// patchReplaceFieldsManagers returns a jsonPatch array for replacing the managers with matching prefix and operation type
// with another manager name and an apply operation.
// with the specified manager name and an apply operation.
func patchReplaceFieldsManagers(object *unstructured.Unstructured, managers []FiledManager, name string) []jsonPatch {
objEntries := object.GetManagedFields()

Expand All @@ -112,14 +112,10 @@ func patchReplaceFieldsManagers(object *unstructured.Unstructured, managers []Fi
entries = append(entries, entry)
}

if len(entries) == len(objEntries) && !renamed {
if !renamed {
return nil
}

if len(entries) == 0 {
entries = append(entries, metav1.ManagedFieldsEntry{})
}

return append(patches, newPatchReplace("/metadata/managedFields", entries))
}

Expand Down

0 comments on commit 092ffc0

Please sign in to comment.