-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: support targeting the root of an object where source is a subtree; tests #36
Conversation
@@ -185,26 +185,124 @@ fn apply_mappings( | |||
debug!(%dbg, "before"); | |||
|
|||
debug!(?subtree, ?mapping.to_field_path, "to field path"); | |||
if mapping.to_field_path.starts_with("metadata.") { |
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.
this block is preserved, just moved down to the last match pattern
Mapping { | ||
from_field_path: Some(_), | ||
to_field_path: None, | ||
} => { |
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.
this block is the bulk of the change to be reviewed, and the supporting functions it calls
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.
thanks for the tests!
fixes #34
this PR also improves the tests by adding controller test cases for all the types of ResourceSyncs that we use this project for, including this new type that is now supported.
previously, only the
from_field_path
field of theMapping
was optional, so you could copy an entire resource into a target subtree but you couldn't copy a source subtree into the root of a target resource.in a previous PR i thought i was implementing this by allowing an empty string as the mapping's target path, however there were two things wrong with that:
this is a dependency for https://github.com/influxdata/tubernetes/issues/752