Skip to content

Commit

Permalink
Merge pull request #90033 from apelisse/automated-cherry-pick-of-#892…
Browse files Browse the repository at this point in the history
…32-upstream-release-1.16

Automated cherry pick of #89232: Use discovery to test apply all status

Kubernetes-commit: 244a7b8c808aae62822b9f1a5481d0cfaed9b18e
  • Loading branch information
k8s-publishing-bot committed May 9, 2020
2 parents 17ad11f + 0e4c0b7 commit 9402b49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/apis/meta/v1/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@ func ResetObjectMetaForStatus(meta, existingMeta Object) {
meta.SetAnnotations(existingMeta.GetAnnotations())
meta.SetFinalizers(existingMeta.GetFinalizers())
meta.SetOwnerReferences(existingMeta.GetOwnerReferences())
meta.SetManagedFields(existingMeta.GetManagedFields())
// managedFields must be preserved since it's been modified to
// track changed fields in the status update.
//meta.SetManagedFields(existingMeta.GetManagedFields())
}

// MarshalJSON implements json.Marshaler
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/meta/v1/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ func TestResetObjectMetaForStatus(t *testing.T) {
existingMeta.SetCreationTimestamp(Time{})
existingMeta.SetDeletionTimestamp(nil)
existingMeta.SetDeletionGracePeriodSeconds(nil)
existingMeta.SetManagedFields(nil)

if !reflect.DeepEqual(meta, existingMeta) {
t.Error(diff.ObjectDiff(meta, existingMeta))
Expand Down

0 comments on commit 9402b49

Please sign in to comment.