pub async fn pod_status(client: APIClient, pod: &Pod, phase: &str, ns: &str) {
    let status = serde_json::json!(
        {
            "metadata": {
                "resourceVersion": "",
            },
            "status": {
                "phase": phase
            }
        }
    );

    let meta = pod.metadata.as_ref();
    let data = serde_json::to_vec(&status).expect("Should always serialize");
    let name = meta.and_then(|m| m.name.as_deref()).unwrap_or_default();
    let api: Api<Pod> = Api::namespaced(client, ns);
    match api.patch_status(&name, &PatchParams::default(), data).await {
        Ok(o) => {
            info!("Pod status for {} set to {}", name, phase);
            debug!(
                "Pod status returned: {}",
                serde_json::to_string_pretty(&o.status).unwrap()
            )
        }
        Err(e) => error!("Pod status update failed for {}: {}", name, e),
    }
}
/// Patch the pod status to update the phase.
Patch the pod status to update the phase.
Patch the pod status to update the phase .
pub async fn pod_status(client: APIClient, pod: &Pod, phase: &str, ns: &str) {
    let status = serde_json::json!(
        {
            "metadata": {
                "resourceVersion": "",
            },
            "status": {
                "phase": phase
            }
        }
    );
    let meta = pod.metadata.as_ref();
    let data = serde_json::to_vec(&status).expect("Should always serialize");
    let name = meta.and_then(|m| m.name.as_deref()).unwrap_or_default();
    let api: Api<Pod> = Api::namespaced(client, ns);
    match api.patch_status(&name, &PatchParams::default(), data).await {
        Ok(o) => {
            info!("Pod status for {} set to {}", name, phase);
            debug!(
                "Pod status returned: {}",
                serde_json::to_string_pretty(&o.status).unwrap()
            )
        }
        Err(e) => error!("Pod status update failed for {}: {}", name, e),
    }
}
pub async fn pod_status ( client : APIClient , pod : & Pod , phase : & str , ns : & str ) { let status = serde_json :: json ! ( { " " { " " " " } " " { " " phase } } ) ; let meta = pod . metadata . as_ref ( ) ; let data = serde_json :: to_vec ( & status ) . expect ( " " ) ; let name = meta . and_then ( | m | m . name . as_deref ( ) ) . unwrap_or_default ( ) ; let api : Api < Pod > = Api :: namespaced ( client , ns ) ; match api . patch_status ( & name , & PatchParams :: default ( ) , data ) . await { Ok ( o ) => { info ! ( " " name phase ) ; debug ! ( " " serde_json to_string_pretty ( o status ) unwrap ( ) ) } Err ( e ) => error ! ( " " name e ) , } }
Patch the pod status to update the phase.
Patch the pod status to update the phase .
client
APIClient
pod
&Pod
phase
&str
ns
&str
client
APIClient
pod
&Pod
phase
&str
ns
&str