User variadic version and remove nil (#1361)

* User variadic version and remove nil

Update duck/status to use new version of UnionMaps

* comment
This commit is contained in:
Victor Agababov 2020-05-28 12:03:00 -07:00 committed by GitHub
parent 6eb9fa1546
commit 08a86da47d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -96,7 +96,7 @@ func (source *Status) ConvertTo(ctx context.Context, sink *Status, predicates ..
sink.ObservedGeneration = source.ObservedGeneration
if source.Annotations != nil {
// This will deep copy the map.
sink.Annotations = kmeta.UnionMaps(source.Annotations, nil)
sink.Annotations = kmeta.UnionMaps(source.Annotations)
}
conditions := make(apis.Conditions, 0, len(source.Conditions))

View File

@ -109,7 +109,8 @@ func (s *Status) GetCondition(t apis.ConditionType) *apis.Condition {
func (source *Status) ConvertTo(ctx context.Context, sink *Status) {
sink.ObservedGeneration = source.ObservedGeneration
if source.Annotations != nil {
sink.Annotations = kmeta.UnionMaps(source.Annotations, nil)
// This will deep copy the map.
sink.Annotations = kmeta.UnionMaps(source.Annotations)
}
for _, c := range source.Conditions {
switch c.Type {