Skip to content

Commit

Permalink
remove kubectl annotation logic from upgrade patch
Browse files Browse the repository at this point in the history
adds unneccessary complexity. also discussed in SIG CLI meeting to keep annotation around for a while longer

Kubernetes-commit: 0c055eae3c9eaea26574743f0623d6b0e9e3d6b4
  • Loading branch information
Alexander Zielenski authored and k8s-publishing-bot committed Nov 3, 2022
1 parent 3daf180 commit a45874a
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions util/csaupgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ import (
"sigs.k8s.io/structured-merge-diff/v4/fieldpath"
)

const csaAnnotationName = "kubectl.kubernetes.io/last-applied-configuration"

var csaAnnotationFieldSet = fieldpath.NewSet(fieldpath.MakePathOrDie("metadata", "annotations", csaAnnotationName))

// Upgrades the Manager information for fields managed with client-side-apply (CSA)
// Prepares fields owned by `csaManager` for 'Update' operations for use now
Expand Down Expand Up @@ -107,12 +105,8 @@ func UpgradeManagedFields(
entry.Subresource == "")
})

// Wipe out last-applied-configuration annotation if it exists
annotations := accessor.GetAnnotations()
delete(annotations, csaAnnotationName)

// Commit changes to object
accessor.SetAnnotations(annotations)
accessor.SetManagedFields(filteredManagers)

return nil
Expand Down Expand Up @@ -154,10 +148,6 @@ func unionManagerIntoIndex(entries []metav1.ManagedFieldsEntry, targetIndex int,
combinedFieldSet = combinedFieldSet.Union(&csaFieldSet)
}

// Ensure that the resultant fieldset does not include the
// last applied annotation
combinedFieldSet = combinedFieldSet.Difference(csaAnnotationFieldSet)

// Encode the fields back to the serialized format
err = encodeManagedFieldsEntrySet(&entries[targetIndex], *combinedFieldSet)
if err != nil {
Expand Down

0 comments on commit a45874a

Please sign in to comment.