pub async fn delete(svc: &str, reg: &Region, conf: &Config) -> Result<()> {
    let s = ShipKube::new_within(&svc, &reg.namespace).await?;
    match s.get().await {
        // audit all events if it's possible to deserialize current crd
        Ok(mfk) => {
            let info = UpgradeInfo::new(&mfk.spec);
            // We notify before we start, because this is potentially a "panic" type notification.
            webhooks::delete_event(&UpgradeState::Started, &info, &reg, &conf).await;
            match s.delete().await {
                Ok(_) => {
                    // NB: we say completed when the api is "done"
                    // This might still trigger finalizers ATM...
                    webhooks::delete_event(&UpgradeState::Completed, &info, &reg, &conf).await;
                    Ok(())
                }
                Err(e) => {
                    webhooks::delete_event(&UpgradeState::Failed, &info, &reg, &conf).await;
                    Err(e)
                }
            }
        }
        // otherwise, just fire and forget...
        Err(e) => {
            warn!("Unable to notify about service deletion: {}", e);
            // The following Result is more important
            s.delete()
                .await
                .chain_err(|| ErrorKind::KubectlApiFailure("delete".into(), svc.into()))
        }
    }
}
/// Uninstall a service
///
/// Not meant to be called if the manifest is still installed in the region
/// shipcat::cluster module is responsible for calling this,
/// when (and only when) a service disappears from disk.
Uninstall a service
Not meant to be called if the manifest is still installed in the region
shipcat::cluster module is responsible for calling this,
when (and only when) a service disappears from disk.
Uninstall a service Not meant to be called if the manifest is still installed in the region shipcat :: cluster module is responsible for calling this when ( and only when ) a service disappears from disk .
pub async fn delete(svc: &str, reg: &Region, conf: &Config) -> Result<()> {
    let s = ShipKube::new_within(&svc, &reg.namespace).await?;
    match s.get().await {
        // audit all events if it's possible to deserialize current crd
        Ok(mfk) => {
            let info = UpgradeInfo::new(&mfk.spec);
            // We notify before we start, because this is potentially a "panic" type notification.
            webhooks::delete_event(&UpgradeState::Started, &info, &reg, &conf).await;
            match s.delete().await {
                Ok(_) => {
                    // NB: we say completed when the api is "done"
                    // This might still trigger finalizers ATM...
                    webhooks::delete_event(&UpgradeState::Completed, &info, &reg, &conf).await;
                    Ok(())
                }
                Err(e) => {
                    webhooks::delete_event(&UpgradeState::Failed, &info, &reg, &conf).await;
                    Err(e)
                }
            }
        }
        // otherwise, just fire and forget...
        Err(e) => {
            warn!("Unable to notify about service deletion: {}", e);
            // The following Result is more important
            s.delete()
                .await
                .chain_err(|| ErrorKind::KubectlApiFailure("delete".into(), svc.into()))
        }
    }
}
pub async fn delete ( svc : & str , reg : & Region , conf : & Config ) -> Result < ( ) > { let s = ShipKube :: new_within ( & svc , & reg . namespace ) . await ? ; match s . get ( ) . await { // audit all events if it's possible to deserialize current crd Ok ( mfk ) => { let info = UpgradeInfo :: new ( & mfk . spec ) ; // We notify before we start, because this is potentially a "panic" type notification. webhooks :: delete_event ( & UpgradeState :: Started , & info , & reg , & conf ) . await ; match s . delete ( ) . await { Ok ( _ ) => { // NB: we say completed when the api is "done" // This might still trigger finalizers ATM... webhooks :: delete_event ( & UpgradeState :: Completed , & info , & reg , & conf ) . await ; Ok ( ( ) ) } Err ( e ) => { webhooks :: delete_event ( & UpgradeState :: Failed , & info , & reg , & conf ) . await ; Err ( e ) } } } // otherwise, just fire and forget... Err ( e ) => { warn ! ( " " e ) ; // The following Result is more important s . delete ( ) . await . chain_err ( | | ErrorKind :: KubectlApiFailure ( " " . into ( ) , svc . into ( ) ) ) } } }
Uninstall a service
Not meant to be called if the manifest is still installed in the region
shipcat::cluster module is responsible for calling this,
when (and only when) a service disappears from disk.
Uninstall a service Not meant to be called if the manifest is still installed in the region shipcat :: cluster module is responsible for calling this when ( and only when ) a service disappears from disk .
svc
&str
reg
&Region
conf
&Config
svc
&str
reg
&Region
conf
&Config