Skip to content

Commit a95f1e0

Browse files
committed
Fix cinder_csi_enabled and manila_csi_enabled type
Signed-off-by: ricolin <[email protected]>
1 parent b397a12 commit a95f1e0

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/addons/cinder_csi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ impl ClusterAddon for Addon {
200200
Self { cluster }
201201
}
202202

203-
fn enabled(&self) -> bool {
204-
self.cluster.labels.cinder_csi_enabled
203+
fn enabled(&self) -> Result<bool, std::str::ParseBoolError> {
204+
self.cluster.labels.cinder_csi_enabled.parse::<bool>()
205205
}
206206

207207
fn secret_name(&self) -> Result<String, ClusterError> {

src/addons/manila_csi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ impl ClusterAddon for Addon {
128128
Self { cluster }
129129
}
130130

131-
fn enabled(&self) -> bool {
132-
self.cluster.labels.manila_csi_enabled
131+
fn enabled(&self) -> Result<bool, std::str::ParseBoolError> {
132+
self.cluster.labels.manila_csi_enabled.parse::<bool>()
133133
}
134134

135135
fn secret_name(&self) -> Result<String, ClusterError> {

src/magnum.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ pub struct ClusterLabels {
3737
pub cilium_ipv4pool: String,
3838

3939
/// Enable the use of the Cinder CSI driver for the cluster.
40-
#[builder(default = true)]
41-
#[pyo3(default = true)]
42-
pub cinder_csi_enabled: bool,
40+
#[builder(default = "true".to_owned())]
41+
#[pyo3(default = "true".to_owned())]
42+
pub cinder_csi_enabled: String,
4343

4444
/// The tag of the Cinder CSI container image to use for the cluster.
4545
#[builder(default="v1.32.0".to_owned())]
4646
#[pyo3(default="v1.32.0".to_owned())]
4747
pub cinder_csi_plugin_tag: String,
4848

4949
/// Enable the use of the Manila CSI driver for the cluster.
50-
#[builder(default = true)]
51-
#[pyo3(default = true)]
52-
pub manila_csi_enabled: bool,
50+
#[builder(default = "true".to_owned())]
51+
#[pyo3(default = "true".to_owned())]
52+
pub manila_csi_enabled: String,
5353

5454
/// The tag of the Manila CSI container image to use for the cluster.
5555
#[builder(default="v1.32.0".to_owned())]

0 commit comments

Comments
 (0)