Skip to content

Commit fc7250d

Browse files
Bump kube to 1.0.0 (#296)
* Bump kube to 1.0.0 Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com> * Clippy/fmt fixes Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com> --------- Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
1 parent 29c5e35 commit fc7250d

File tree

6 files changed

+35
-41
lines changed

6 files changed

+35
-41
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ rand = { version = "0.9", features = ["small_rng"] }
3333
actix-web = "4.10.2"
3434
futures = "0.3.28"
3535
tokio = { version = "1.44.2", features = ["macros", "rt-multi-thread", "process"] }
36-
k8s-openapi = { version = "0.24", features = ["latest", "schemars"] }
37-
kube = { version = "0.99.0", features = [
36+
k8s-openapi = { version = "0.25", features = ["latest", "schemars"] }
37+
kube = { version = "1.0.0", features = [
3838
"runtime",
3939
"client",
4040
"derive",
@@ -58,8 +58,8 @@ thiserror = "2.0.11"
5858
anyhow = "1.0.98"
5959
base64 = "0.22.1"
6060
clap = { version = "4.5.38", features = ["derive"] }
61-
cluster-api-rs = "1.9.6"
62-
fleet-api-rs = "0.12.2"
61+
cluster-api-rs = "1.10.0"
62+
fleet-api-rs = "0.12.3-rc.1"
6363
async-broadcast = "0.7.2"
6464
pin-project = "1.1.10"
6565
async-stream = "0.3.6"

src/api/capi_cluster.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,17 +123,15 @@ impl Cluster {
123123
host_network: config.host_network,
124124
agent_env_vars: config.agent_env_vars.clone(),
125125
..Default::default()
126-
}
127-
.into(),
126+
},
128127
false => fleet_api_rs::fleet_cluster::ClusterSpec {
129128
kube_config_secret: Some(format!("{}-kubeconfig", self.name_any())),
130129
agent_namespace: config.agent_install_namespace().into(),
131130
agent_tolerations: config.agent_tolerations().into(),
132131
host_network: config.host_network,
133132
agent_env_vars: config.agent_env_vars.clone(),
134133
..Default::default()
135-
}
136-
.into(),
134+
},
137135
},
138136
#[cfg(not(feature = "agent-initiated"))]
139137
spec: fleet_api_rs::fleet_cluster::ClusterSpec {
@@ -191,8 +189,7 @@ impl Cluster {
191189
metadata: self.into(),
192190
spec: ClusterRegistrationTokenSpec {
193191
ttl: Some("1h".into()),
194-
}
195-
.into(),
192+
},
196193
..Default::default()
197194
}
198195
.into()

src/api/fleet_addon_config.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use k8s_openapi::{
88
use kube::{
99
api::{ObjectMeta, TypeMeta},
1010
core::{ParseExpressionError, Selector},
11-
CELSchema, CustomResource, Resource,
11+
CustomResource, KubeSchema, Resource,
1212
};
1313
use schemars::JsonSchema;
1414
use serde::{ser, Deserialize, Serialize};
@@ -20,13 +20,13 @@ pub const EXPERIMENTAL_OCI_STORAGE: &str = "EXPERIMENTAL_OCI_STORAGE";
2020
pub const EXPERIMENTAL_HELM_OPS: &str = "EXPERIMENTAL_HELM_OPS";
2121

2222
/// This provides a config for fleet addon functionality
23-
#[derive(CustomResource, Deserialize, Serialize, Clone, Default, Debug, CELSchema)]
23+
#[derive(CustomResource, Deserialize, Serialize, Clone, Default, Debug, KubeSchema)]
2424
#[kube(
2525
kind = "FleetAddonConfig",
2626
group = "addons.cluster.x-k8s.io",
2727
version = "v1alpha1",
2828
status = "FleetAddonConfigStatus",
29-
rule = Rule::new("self.metadata.name == 'fleet-addon-config'"),
29+
validation = "self.metadata.name == 'fleet-addon-config'"
3030
)]
3131
#[serde(rename_all = "camelCase")]
3232
pub struct FleetAddonConfigSpec {

src/controllers/cluster.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ use kube::client::scope;
1616
use kube::runtime::watcher::{self, Config};
1717
use kube::{api::ResourceExt, runtime::controller::Action, Resource};
1818
use kube::{Api, Client};
19-
#[cfg(feature = "agent-initiated")]
20-
use rand::distr::{Alphanumeric, SampleString as _};
2119
use serde::Serialize;
2220
use serde_json::Value;
2321
use tracing::info;

src/telemetry.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ async fn init_tracer() -> opentelemetry_sdk::trace::Tracer {
2424
let builder = SdkTracerProvider::builder();
2525
#[cfg(feature = "telemetry")]
2626
let builder = builder.with_batch_exporter(exporter);
27-
builder.build()
28-
.tracer("addon-provider-fleet")
27+
builder.build().tracer("addon-provider-fleet")
2928
}
3029

3130
/// Initialize tracing

0 commit comments

Comments
 (0)