-
Notifications
You must be signed in to change notification settings - Fork 54
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
refactor: add support to define_tedge_config
for (optionally) multi-value fields
#3126
refactor: add support to define_tedge_config
for (optionally) multi-value fields
#3126
Conversation
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Robot Results
|
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Co-authored-by: Didier Wenzek <didier.wenzek@free.fr>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
c683980
to
64ddb22
Compare
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
d32d6b1
to
3936b7d
Compare
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.
Approved. Thank you for this tour de force.
Despite its underneath complexity, tedge config is simple to use both by end users and developers (despite or thanks to this complexity?). However, we reached a point where things are really complicated and I would be very careful about adding additional features.
new_parents.push(PathItem::Dynamic(*span)); | ||
} | ||
} else { | ||
// This key has diverged from the currrent key's parents, so empty the list |
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 key has diverged from the currrent key's parents, so empty the list | |
// This key has diverged from the current key's parents, so empty the list |
#[error("Unexpected profile {1} for the non multi-profile property {0}")] | ||
#[error( | ||
"You are trying to access a profile `{1}` of {0}, but profiles are not enabled for {0}" | ||
)] |
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.
I have a preference for the former error message.
Proposed changes
In order to add support multiple Cumulocity connections, we need the data model defined for
tedge.toml
to support multiple cloud connections. This PR adds support indefine_tedge_config!
for a#[tedge_config(multi)]
attribute, which allows the field to store either the underlying struct directly or a hashmap of strings to structs (which provides us with multiple named configurations for a single key).More concretely, this will allow
tedge_config
to support configurations like:while still also supporting as it does currently:
This PR doesn't make any changes to the existing
tedge_config
definitions and therefore doesn't change the behaviour of thin-edge, hence the refactoring classification.Still TODO:
tedge config list
logicmatch
blocks to_
Types of changes
Paste Link to the issue
Checklist
cargo fmt
as mentioned in CODING_GUIDELINEScargo clippy
as mentioned in CODING_GUIDELINESFurther comments