Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 34 additions & 55 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ orion-xds = { path = "orion-xds" }
abort-on-drop = "0.2"
bounded-integer = "0.5.8"
bytes = "1"
compact_str = { version = "0.8.0", features = ["serde"] }
smol_str = { version = "0.3.2", features = ["serde"] }
exponential-backoff = "1.2.0"
futures = "0.3"
http = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion orion-configuration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ base64 = "0.22.1"
base64-serde = "0.7.0"
bounded-integer = { version = "0.5.8", features = ["serde", "types"] }
bytes.workspace = true
smol_str.workspace = true
clap = { version = "4.5.46", features = ["derive"] }
compact_str.workspace = true
exponential-backoff.workspace = true
http.workspace = true
http-serde-ext = "1.0.2"
Expand Down
14 changes: 7 additions & 7 deletions orion-configuration/src/config/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use std::time::Duration;
use crate::config::{
cluster::Cluster, common::is_default, core::Address, listener::Listener, metrics::StatsSink, secret::Secret,
};
use compact_str::CompactString;
use serde::{Deserialize, Serialize};
use smol_str::SmolStr;

#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)]
pub struct Bootstrap {
Expand All @@ -40,15 +40,15 @@ pub struct Bootstrap {
}

impl Bootstrap {
pub fn get_ads_configs(&self) -> &[CompactString] {
pub fn get_ads_configs(&self) -> &[SmolStr] {
self.dynamic_resources.as_ref().map(|dr| dr.grpc_cluster_specifiers.as_slice()).unwrap_or_default()
}
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Default)]
pub struct Node {
pub id: CompactString,
pub cluster_id: CompactString,
pub id: SmolStr,
pub cluster_id: SmolStr,
}

impl Node {
Expand All @@ -65,7 +65,7 @@ impl Node {

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct DynamicResources {
pub grpc_cluster_specifiers: Vec<CompactString>,
pub grpc_cluster_specifiers: Vec<SmolStr>,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
Expand All @@ -88,7 +88,6 @@ mod envoy_conversions {
#![allow(deprecated)]
use super::{Admin, Bootstrap, DynamicResources, Node, StaticResources};
use crate::config::{common::*, grpc::Duration, metrics::StatsSink};
use compact_str::CompactString;
use orion_data_plane_api::envoy_data_plane_api::envoy::config::{
bootstrap::v3::{
bootstrap::{DynamicResources as EnvoyDynamicResources, StaticResources as EnvoyStaticResources},
Expand All @@ -101,6 +100,7 @@ mod envoy_conversions {
},
metrics::v3::stats_sink::ConfigType,
};
use smol_str::SmolStr;

impl Bootstrap {
pub fn deserialize_from_envoy<R: std::io::Read>(rdr: R) -> Result<Self, GenericError> {
Expand Down Expand Up @@ -310,7 +310,7 @@ mod envoy_conversions {
)
.with_node("target_specifier")?;
let cluster_name = required!(cluster_name).with_node("target_specifier")?;
cluster_specifiers.push(CompactString::from(cluster_name))
cluster_specifiers.push(SmolStr::from(cluster_name))
},
EnvoyGrpcTargetSpecifier::GoogleGrpc(_) => {
return Err(GenericError::unsupported_variant("GoogleGrpc"))
Expand Down
Loading
Loading