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

Replaces kubectl field managers with the resource manager owner in ssa apply #223

Merged
merged 1 commit into from
Jan 20, 2022

Conversation

somtochiama
Copy link
Member

Signed-off-by: Somtochi Onyekwere [email protected]

ssa/patch.go Outdated
@@ -91,6 +91,38 @@ func patchRemoveFieldsManagers(object *unstructured.Unstructured, managers []Fil
return append(patches, newPatchReplace("/metadata/managedFields", entries))
}

// patchReplaceFieldsManagers returns a jsonPatch array for replacing the managers with matching prefix and operation type
// with another manager name and an apply operation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// with another manager name and an apply operation.
// with the specified manager name and an apply operation.

ssa/patch.go Outdated
entries = append(entries, entry)
}

if len(entries) == len(objEntries) && !renamed {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if len(entries) == len(objEntries) && !renamed {
if !renamed {

ssa/patch.go Outdated
return nil
}

if len(entries) == 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete this condition, it was needed for remove but not here.

@stefanprodan
Copy link
Member

@somtochiama can you please rebase and squash your commits.

Signed-off-by: Somtochi Onyekwere <[email protected]>
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @somtochiama

@stefanprodan stefanprodan added the area/server-side-apply SSA related issues and pull requests label Jan 20, 2022
@stefanprodan stefanprodan merged commit 6083da5 into fluxcd:main Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/server-side-apply SSA related issues and pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants