mirror of https://github.com/knative/pkg.git
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:
parent
6eb9fa1546
commit
08a86da47d
|
@ -96,7 +96,7 @@ func (source *Status) ConvertTo(ctx context.Context, sink *Status, predicates ..
|
||||||
sink.ObservedGeneration = source.ObservedGeneration
|
sink.ObservedGeneration = source.ObservedGeneration
|
||||||
if source.Annotations != nil {
|
if source.Annotations != nil {
|
||||||
// This will deep copy the map.
|
// 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))
|
conditions := make(apis.Conditions, 0, len(source.Conditions))
|
||||||
|
|
|
@ -109,7 +109,8 @@ func (s *Status) GetCondition(t apis.ConditionType) *apis.Condition {
|
||||||
func (source *Status) ConvertTo(ctx context.Context, sink *Status) {
|
func (source *Status) ConvertTo(ctx context.Context, sink *Status) {
|
||||||
sink.ObservedGeneration = source.ObservedGeneration
|
sink.ObservedGeneration = source.ObservedGeneration
|
||||||
if source.Annotations != nil {
|
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 {
|
for _, c := range source.Conditions {
|
||||||
switch c.Type {
|
switch c.Type {
|
||||||
|
|
Loading…
Reference in New Issue