Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Ignore order when comparing lists #31

Merged
merged 1 commit into from
Apr 28, 2017
Merged

Ignore order when comparing lists #31

merged 1 commit into from
Apr 28, 2017

Conversation

awh
Copy link
Contributor

@awh awh commented Apr 28, 2017

When patching an existing resource with kubectl apply, the ordering of certain lists (such as the containers in a deployment template) is not guaranteed to be preserved; this can result in spurious differences being detected as lists were compared strictly in order.

A consequence of this patch is that differences in lists are now reported at the element level e.g.

.spec.template.spec.containers: 'element [3]' missing

When patching an existing resource with `kubectl apply`, the ordering of
certain lists (such as the containers in a deployment template) is not
guaranteed to be preserved; this can result in spurious differences
being detected as lists were compared strictly in order.
del have[j]
break
else:
yield missing_item(path, "element [%d]" % i)

This comment was marked as abuse.

This comment was marked as abuse.

Copy link
Contributor

@jml jml left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants