Skip to content

Commit 764188c

Browse files
Update clevercloud-sdk dependency
* Bump clevercloud-sdk to 0.10.0 Signed-off-by: Florentin Dubois <florentin.dubois@clever-cloud.com>
1 parent b40cad8 commit 764188c

File tree

9 files changed

+48
-44
lines changed

9 files changed

+48
-44
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ keywords = ["kubernetes", "operator", "clevercloud", "openshift"]
1515
[dependencies]
1616
async-trait = "^0.1.53"
1717
chrono = "^0.4.19"
18-
clevercloud-sdk = { version = "^0.9.0", features = ["jsonschemas"] }
18+
clevercloud-sdk = { version = "^0.10.0", features = ["jsonschemas"] }
1919
config = "^0.13.0"
2020
futures = "^0.3.21"
2121
hostname = "^0.3.1"

src/svc/clevercloud/ext.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::{collections::BTreeMap, fmt::Debug};
88
use async_trait::async_trait;
99
use clevercloud_sdk::{
1010
oauth10a::ClientError,
11-
v2::addon::{self, Addon, CreateAddonOpts, Error},
11+
v2::addon::{self, Addon, CreateOpts, Error},
1212
};
1313
use hyper::StatusCode;
1414
use slog_scope::{debug, trace};
@@ -19,7 +19,7 @@ use crate::svc::clevercloud;
1919
// AddonExt trait
2020

2121
#[async_trait]
22-
pub trait AddonExt: Into<CreateAddonOpts> + Clone + Debug + Sync + Send {
22+
pub trait AddonExt: Into<CreateOpts> + Clone + Debug + Sync + Send {
2323
type Error: From<Error> + Sync + Send;
2424

2525
fn id(&self) -> Option<String>;

src/svc/crd/config_provider.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use async_trait::async_trait;
1212
use clevercloud_sdk::{
1313
v2::{
1414
self,
15-
addon::{AddonOpts, CreateAddonOpts},
15+
addon::{self, CreateOpts},
1616
},
1717
v4::addon_provider::{
1818
config_provider::addon::environment::{self, Variable},
@@ -74,15 +74,15 @@ pub struct Status {
7474
// MySql implementation
7575

7676
#[allow(clippy::from_over_into)]
77-
impl Into<CreateAddonOpts> for ConfigProvider {
77+
impl Into<CreateOpts> for ConfigProvider {
7878
#[cfg_attr(feature = "trace", tracing::instrument)]
79-
fn into(self) -> CreateAddonOpts {
80-
CreateAddonOpts {
79+
fn into(self) -> CreateOpts {
80+
CreateOpts {
8181
name: AddonExt::name(&self),
8282
region: "par".to_owned(), // config provider is only available in the "par" datacenter
8383
provider_id: AddonProviderId::ConfigProvider.to_string(),
8484
plan: plan::CONFIG_PROVIDER.to_owned(),
85-
options: AddonOpts::default(),
85+
options: addon::Opts::default(),
8686
}
8787
}
8888
}

src/svc/crd/mongodb.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use async_trait::async_trait;
1111
use clevercloud_sdk::{
1212
v2::{
1313
self,
14-
addon::{AddonOpts, CreateAddonOpts},
14+
addon::{self, CreateOpts},
1515
},
1616
v4::{
1717
self,
@@ -52,17 +52,18 @@ pub struct Opts {
5252
}
5353

5454
#[allow(clippy::from_over_into)]
55-
impl Into<AddonOpts> for Opts {
56-
fn into(self) -> AddonOpts {
57-
AddonOpts {
55+
impl Into<addon::Opts> for Opts {
56+
fn into(self) -> addon::Opts {
57+
addon::Opts {
5858
version: Some(self.version.to_string()),
5959
encryption: Some(self.encryption.to_string()),
60+
..Default::default()
6061
}
6162
}
6263
}
6364

6465
// -----------------------------------------------------------------------------
65-
// MongoDbSpec structure
66+
// Spec structure
6667

6768
#[derive(CustomResource, JsonSchema, Serialize, Deserialize, PartialEq, Clone, Debug)]
6869
#[kube(group = "api.clever-cloud.com")]
@@ -97,10 +98,10 @@ pub struct Status {
9798
// MongoDb implementation
9899

99100
#[allow(clippy::from_over_into)]
100-
impl Into<CreateAddonOpts> for MongoDb {
101+
impl Into<CreateOpts> for MongoDb {
101102
#[cfg_attr(feature = "trace", tracing::instrument)]
102-
fn into(self) -> CreateAddonOpts {
103-
CreateAddonOpts {
103+
fn into(self) -> CreateOpts {
104+
CreateOpts {
104105
name: AddonExt::name(&self),
105106
region: self.spec.instance.region.to_owned(),
106107
provider_id: AddonProviderId::MongoDb.to_string(),

src/svc/crd/mysql.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use async_trait::async_trait;
1111
use clevercloud_sdk::{
1212
v2::{
1313
self,
14-
addon::{AddonOpts, CreateAddonOpts},
14+
addon::{self, CreateOpts},
1515
},
1616
v4::{
1717
self,
@@ -52,11 +52,12 @@ pub struct Opts {
5252
}
5353

5454
#[allow(clippy::from_over_into)]
55-
impl Into<AddonOpts> for Opts {
56-
fn into(self) -> AddonOpts {
57-
AddonOpts {
55+
impl Into<addon::Opts> for Opts {
56+
fn into(self) -> addon::Opts {
57+
addon::Opts {
5858
version: Some(self.version.to_string()),
5959
encryption: Some(self.encryption.to_string()),
60+
..Default::default()
6061
}
6162
}
6263
}
@@ -97,10 +98,10 @@ pub struct Status {
9798
// MySql implementation
9899

99100
#[allow(clippy::from_over_into)]
100-
impl Into<CreateAddonOpts> for MySql {
101+
impl Into<CreateOpts> for MySql {
101102
#[cfg_attr(feature = "trace", tracing::instrument)]
102-
fn into(self) -> CreateAddonOpts {
103-
CreateAddonOpts {
103+
fn into(self) -> CreateOpts {
104+
CreateOpts {
104105
name: AddonExt::name(&self),
105106
region: self.spec.instance.region.to_owned(),
106107
provider_id: AddonProviderId::MySql.to_string(),

src/svc/crd/postgresql.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use async_trait::async_trait;
1111
use clevercloud_sdk::{
1212
v2::{
1313
self,
14-
addon::{AddonOpts, CreateAddonOpts},
14+
addon::{self, CreateOpts},
1515
},
1616
v4::{
1717
self,
@@ -52,11 +52,12 @@ pub struct Opts {
5252
}
5353

5454
#[allow(clippy::from_over_into)]
55-
impl Into<AddonOpts> for Opts {
56-
fn into(self) -> AddonOpts {
57-
AddonOpts {
55+
impl Into<addon::Opts> for Opts {
56+
fn into(self) -> addon::Opts {
57+
addon::Opts {
5858
version: Some(self.version.to_string()),
5959
encryption: Some(self.encryption.to_string()),
60+
..Default::default()
6061
}
6162
}
6263
}
@@ -97,10 +98,10 @@ pub struct Status {
9798
// PostgreSql implementation
9899

99100
#[allow(clippy::from_over_into)]
100-
impl Into<CreateAddonOpts> for PostgreSql {
101+
impl Into<CreateOpts> for PostgreSql {
101102
#[cfg_attr(feature = "trace", tracing::instrument)]
102-
fn into(self) -> CreateAddonOpts {
103-
CreateAddonOpts {
103+
fn into(self) -> CreateOpts {
104+
CreateOpts {
104105
name: AddonExt::name(&self),
105106
region: self.spec.instance.region.to_owned(),
106107
provider_id: AddonProviderId::PostgreSql.to_string(),

src/svc/crd/pulsar.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use async_trait::async_trait;
1111
use clevercloud_sdk::{
1212
v2::{
1313
self,
14-
addon::{AddonOpts, CreateAddonOpts},
14+
addon::{self, CreateOpts},
1515
},
1616
v4::{self, addon_provider::AddonProviderId},
1717
};
@@ -81,15 +81,15 @@ pub struct Status {
8181
// Pulsar implementation
8282

8383
#[allow(clippy::from_over_into)]
84-
impl Into<CreateAddonOpts> for Pulsar {
84+
impl Into<CreateOpts> for Pulsar {
8585
#[cfg_attr(feature = "trace", tracing::instrument)]
86-
fn into(self) -> CreateAddonOpts {
87-
CreateAddonOpts {
86+
fn into(self) -> CreateOpts {
87+
CreateOpts {
8888
name: AddonExt::name(&self),
8989
region: self.spec.instance.region.to_owned(),
9090
provider_id: AddonProviderId::Pulsar.to_string(),
9191
plan: ADDON_BETA_PLAN.to_string(),
92-
options: AddonOpts::default(),
92+
options: addon::Opts::default(),
9393
}
9494
}
9595
}

src/svc/crd/redis.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use async_trait::async_trait;
1111
use clevercloud_sdk::{
1212
v2::{
1313
self,
14-
addon::{AddonOpts, CreateAddonOpts},
14+
addon::{self, CreateOpts},
1515
},
1616
v4::{
1717
self,
@@ -52,11 +52,12 @@ pub struct Opts {
5252
}
5353

5454
#[allow(clippy::from_over_into)]
55-
impl Into<AddonOpts> for Opts {
56-
fn into(self) -> AddonOpts {
57-
AddonOpts {
55+
impl Into<addon::Opts> for Opts {
56+
fn into(self) -> addon::Opts {
57+
addon::Opts {
5858
version: Some(self.version.to_string()),
5959
encryption: Some(self.encryption.to_string()),
60+
..Default::default()
6061
}
6162
}
6263
}
@@ -97,10 +98,10 @@ pub struct Status {
9798
// Redis implementation
9899

99100
#[allow(clippy::from_over_into)]
100-
impl Into<CreateAddonOpts> for Redis {
101+
impl Into<CreateOpts> for Redis {
101102
#[cfg_attr(feature = "trace", tracing::instrument)]
102-
fn into(self) -> CreateAddonOpts {
103-
CreateAddonOpts {
103+
fn into(self) -> CreateOpts {
104+
CreateOpts {
104105
name: AddonExt::name(&self),
105106
region: self.spec.instance.region.to_owned(),
106107
provider_id: AddonProviderId::Redis.to_string(),

0 commit comments

Comments
 (0)