-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return a detailed diff from Diff. #618
Conversation
These changes add support for detailed diffs to the Kubernetes provider. The detailed diff is calculated by computing a JSON merge patch between the desired and new state, recursively walking the result, and recording the difference at each leaf property as indicated by the patch. The particular difference that is recorded for a property depends on the old and new values: - If the patched value is nil, the property is recorded as deleted - If the old value is nil, the property is recorded as added - If the types of the old and new values differ, the property is recorded as updated - If both values are maps, the maps are recursively compared on a per-property basis and added to the diff - If both values are arrays, the arrays are recursively compared on a per-element basis and added to the diff - If both values are primitives and the values differ, the property is recorded as updated - Otherwise, no diff is recorded. If a difference is present at a path and the path matches one of the patterns in the database of force-new properties, the diff is amended to indicate that the resource needs to be replaced due to the change in this property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall. Would be nice to see a screenshot of the new diff output in the CLI.
Co-Authored-By: Levi Blackstone <levi@pulumi.com>
Co-Authored-By: Levi Blackstone <levi@pulumi.com>
Co-Authored-By: Levi Blackstone <levi@pulumi.com>
Looks like the Istio test failed. @lblackstone can you help me interpret the output? It looks like the failure is unrelated, but I'm not sure. |
@pgavlin Yeah, it looks like a couple of the Pods failed to start for some reason, so it's probably a flake. I restarted the job. |
These changes add support for detailed diffs to the Kubernetes provider.
The detailed diff is calculated by computing a JSON merge patch between
the desired and new state, recursively walking the result, and recording
the difference at each leaf property as indicated by the patch.
The particular difference that is recorded for a property depends on the
old and new values:
as updated
per-property basis and added to the diff
per-element basis and added to the diff
recorded as updated
If a difference is present at a path and the path matches one of the
patterns in the database of force-new properties, the diff is amended to
indicate that the resource needs to be replaced due to the change in
this property.