Skip to content

Commit cd1aead

Browse files
Merge pull request #71 from CleverCloud/devel/fdubois/styles/crd
Change prefix to retrieve kubernetes name
2 parents fa35f6d + 2b9d905 commit cd1aead

File tree

8 files changed

+12
-7
lines changed

8 files changed

+12
-7
lines changed

src/svc/clevercloud/ext.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ pub trait AddonExt: Into<CreateOpts> + Clone + Debug + Sync + Send {
2828

2929
fn name(&self) -> String;
3030

31+
#[cfg_attr(feature = "trace", tracing::instrument)]
32+
fn prefix() -> String {
33+
"kubernetes::".to_string()
34+
}
35+
3136
#[cfg_attr(feature = "trace", tracing::instrument)]
3237
async fn get(&self, client: &clevercloud::Client) -> Result<Option<Addon>, Self::Error> {
3338
if let Some(id) = &self.id() {

src/svc/crd/config_provider.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ impl AddonExt for ConfigProvider {
106106

107107
#[cfg_attr(feature = "trace", tracing::instrument)]
108108
fn name(&self) -> String {
109-
"kubernetes_".to_string()
109+
Self::prefix()
110110
+ &self
111111
.uid()
112112
.expect("expect all resources in kubernetes to have an identifier")

src/svc/crd/elasticsearch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl AddonExt for ElasticSearch {
146146

147147
#[cfg_attr(feature = "trace", tracing::instrument)]
148148
fn name(&self) -> String {
149-
"kubernetes_".to_string()
149+
Self::prefix()
150150
+ &self
151151
.uid()
152152
.expect("expect all resources in kubernetes to have an identifier")

src/svc/crd/mongodb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl AddonExt for MongoDb {
130130

131131
#[cfg_attr(feature = "trace", tracing::instrument)]
132132
fn name(&self) -> String {
133-
"kubernetes_".to_string()
133+
Self::prefix()
134134
+ &self
135135
.uid()
136136
.expect("expect all resources in kubernetes to have an identifier")

src/svc/crd/mysql.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl AddonExt for MySql {
130130

131131
#[cfg_attr(feature = "trace", tracing::instrument)]
132132
fn name(&self) -> String {
133-
"kubernetes_".to_string()
133+
Self::prefix()
134134
+ &self
135135
.uid()
136136
.expect("expect all resources in kubernetes to have an identifier")

src/svc/crd/postgresql.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl AddonExt for PostgreSql {
130130

131131
#[cfg_attr(feature = "trace", tracing::instrument)]
132132
fn name(&self) -> String {
133-
"kubernetes_".to_string()
133+
Self::prefix()
134134
+ &self
135135
.uid()
136136
.expect("expect all resources in kubernetes to have an identifier")

src/svc/crd/pulsar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl AddonExt for Pulsar {
113113

114114
#[cfg_attr(feature = "trace", tracing::instrument)]
115115
fn name(&self) -> String {
116-
"kubernetes_".to_string()
116+
Self::prefix()
117117
+ &self
118118
.uid()
119119
.expect("expect all resources in kubernetes to have an identifier")

src/svc/crd/redis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl AddonExt for Redis {
130130

131131
#[cfg_attr(feature = "trace", tracing::instrument)]
132132
fn name(&self) -> String {
133-
"kubernetes_".to_string()
133+
Self::prefix()
134134
+ &self
135135
.uid()
136136
.expect("expect all resources in kubernetes to have an identifier")

0 commit comments

Comments
 (0)