Skip to content

Commit

Permalink
Expose bridge connection feature flag to match backoff parameters
Browse files Browse the repository at this point in the history
Signed-off-by: James Rhodes <[email protected]>
  • Loading branch information
jarhodes314 committed Jun 7, 2024
1 parent ee2edd4 commit e236d50
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
18 changes: 0 additions & 18 deletions crates/common/tedge_config/src/tedge_config_cli/tedge_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,6 @@ define_tedge_config! {
/// if this is set to "c8y", then messages published to `c8y/s/us` will be
/// forwarded by to Cumulocity on the `s/us` topic
#[tedge_config(example = "c8y", default(function = "c8y_topic_prefix"))]
#[doku(skip)] // Hide the configuration in `tedge config list --doc`
topic_prefix: TopicPrefix,
},

Expand Down Expand Up @@ -661,7 +660,6 @@ define_tedge_config! {

bridge: {
#[tedge_config(default(value = false))]
#[doku(skip)] // Hide the configuration in `tedge config list --doc`
built_in: bool,

reconnect_policy: {
Expand Down Expand Up @@ -868,22 +866,6 @@ fn c8y_topic_prefix() -> TopicPrefix {
TopicPrefix::try_new("c8y").unwrap()
}

impl ReadableKey {
// This is designed to be a simple way of controlling whether values appear in the output of
// `tedge config list`. Ideally this would be integrated into [define_tedge_config], see
// https://github.com/thin-edge/thin-edge.io/issues/2767 for more detail on that.
// Currently this accompanies `#[doku(skip)]` on the relevant configurations, which hides
// them in `tedge config list --doc`. The configurations are hidden to avoid unfinished
// features from being discovered.
pub fn is_printable_value(self, value: &str) -> bool {
match self {
Self::MqttBridgeBuiltIn => value != "false",
Self::C8yBridgeTopicPrefix => value != "c8y",
_ => true,
}
}
}

#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, Deserialize, serde::Serialize)]
#[serde(try_from = "Cow<'_, str>", into = "Arc<str>")]
/// A valid MQTT topic prefix, used to customise the c8y/ topic prefix
Expand Down
3 changes: 1 addition & 2 deletions crates/core/tedge/src/cli/config/commands/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ fn print_config_list(config: &TEdgeConfig, all: bool) -> Result<(), ConfigError>
let mut keys_without_values = Vec::new();
for config_key in ReadableKey::iter() {
match config.read_string(config_key).ok() {
Some(value) if config_key.is_printable_value(&value) => {
Some(value) => {
println!("{}={}", config_key, value);
}
Some(_) => {}
None => {
keys_without_values.push(config_key);
}
Expand Down

0 comments on commit e236d50

Please sign in to comment.