Skip to content

Commit

Permalink
fix: Use correct api to patch deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzalezzfelipe committed Nov 7, 2024
1 parent 90eb6e4 commit e41ccca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/controller.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::bail;
use k8s_openapi::api::{
apps::v1::StatefulSet,
apps::v1::Deployment,
core::v1::{ConfigMap, Service},
networking::v1::Ingress,
};
Expand Down Expand Up @@ -204,8 +204,8 @@ impl K8sContext {
}
}

async fn patch_deployment(&self, crd: &HydraDoomNode) -> anyhow::Result<StatefulSet> {
let api: Api<StatefulSet> = Api::namespaced(self.client.clone(), &crd.namespace().unwrap());
async fn patch_deployment(&self, crd: &HydraDoomNode) -> anyhow::Result<Deployment> {
let api: Api<Deployment> = Api::namespaced(self.client.clone(), &crd.namespace().unwrap());

// Create or patch the deployment
api.patch(
Expand All @@ -221,7 +221,7 @@ impl K8sContext {
}

async fn remove_deployment(&self, crd: &HydraDoomNode) -> anyhow::Result<()> {
let api: Api<StatefulSet> = Api::namespaced(self.client.clone(), &crd.namespace().unwrap());
let api: Api<Deployment> = Api::namespaced(self.client.clone(), &crd.namespace().unwrap());
let dp = DeleteParams::default();

match api.delete(&crd.internal_name(), &dp).await {
Expand Down

0 comments on commit e41ccca

Please sign in to comment.