diff --git a/crates/fluvio-sc/src/k8/migration.rs b/crates/fluvio-sc/src/k8/migration.rs deleted file mode 100644 index aa4005f119..0000000000 --- a/crates/fluvio-sc/src/k8/migration.rs +++ /dev/null @@ -1,47 +0,0 @@ -use k8_client::meta_client::MetadataClient; -use fluvio_controlplane_metadata::smartmodule::{SmartModuleSpec, SmartModuleV1Wrapper}; -use k8_metadata_client::SharedClient; -use k8_types::InputK8Obj; -use tracing::{debug, info}; - -/// Migrate SmartModule V1 to V2 - -pub(crate) struct SmartModuleMigrationController(SharedClient); - -impl SmartModuleMigrationController -where - C: MetadataClient, -{ - /// migrate code - pub(crate) async fn migrate( - client: SharedClient, - ns: &str, - ) -> Result<(), C::MetadataClientError> { - let controller = Self(client); - controller.migrate_crd(ns).await - } - - async fn migrate_crd(&self, ns: &str) -> Result<(), C::MetadataClientError> { - let old_smartmodules = self.0.retrieve_items::(ns).await?; - info!( - old_smartmodule = old_smartmodules.items.len(), - "SmartModule V1 found" - ); - for old_sm in old_smartmodules.items { - let old_spec_wrapper = old_sm.spec; - let old_metadata = old_sm.metadata; - if let Some(old_spec) = old_spec_wrapper.inner { - info!("migrating v1 smartmodule: {}", old_metadata.name); - let new_spec: SmartModuleSpec = old_spec.into(); - // debug!("new spec: {:#?}", new_spec); - let input = InputK8Obj::new(new_spec, old_metadata.clone().into()); - - let _smartmodulev2 = self.0.create_item(input).await?; - } else { - debug!(%old_metadata.name, "no v1 smartmodule, skipping"); - } - } - - Ok(()) - } -} diff --git a/crates/fluvio-sc/src/k8/mod.rs b/crates/fluvio-sc/src/k8/mod.rs index 2431a553b4..5a630c5662 100644 --- a/crates/fluvio-sc/src/k8/mod.rs +++ b/crates/fluvio-sc/src/k8/mod.rs @@ -7,7 +7,6 @@ pub(crate) mod controllers; mod objects; -pub(crate) mod migration; #[cfg(test)] mod fixture; diff --git a/crates/fluvio-sc/src/start.rs b/crates/fluvio-sc/src/start.rs index 5296a5e627..ec841103e5 100644 --- a/crates/fluvio-sc/src/start.rs +++ b/crates/fluvio-sc/src/start.rs @@ -33,16 +33,6 @@ pub fn main_loop(opt: ScOpt) { #[cfg(feature = "k8")] let namespace = sc_config.namespace.clone(); - #[cfg(feature = "k8")] - if let Err(err) = crate::k8::migration::SmartModuleMigrationController::migrate( - k8_client.clone(), - &namespace, - ) - .await - { - tracing::error!("migration failed: {:#?}", err); - } - info!("starting main loop"); #[cfg(feature = "k8")]