From 506c374aa3794497ca4b4943a6e723ae4c54cead Mon Sep 17 00:00:00 2001 From: Sheogorath <sheogorath@shivering-isles.com> Date: Sun, 11 Feb 2024 12:01:54 +0100 Subject: [PATCH] fix(longhorn): Invert hotfix condition to handle absent pod Currently when the share-pod simply doesn't exist the hotfix doesn'T trigger correctly and therefore never patches the error state. Instead it errors out with the following message: ``` Error from server (NotFound): pods "share-manager-pvc-36c42839-3899-41fe-bfe3-a6308982d671" not found ``` --- infrastructure/longhorn/hotfix-7183.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure/longhorn/hotfix-7183.yaml b/infrastructure/longhorn/hotfix-7183.yaml index fad6c3d08..ca4055692 100644 --- a/infrastructure/longhorn/hotfix-7183.yaml +++ b/infrastructure/longhorn/hotfix-7183.yaml @@ -24,7 +24,7 @@ spec: - -c - | for i in $(kubectl get lhsm -n longhorn-system --no-headers -o custom-columns=NAME:metadata.name); do - if kubectl get pods --no-headers -n longhorn-system "share-manager-$i" | grep -v Running; then + if ! kubectl get pods --no-headers -n longhorn-system "share-manager-$i" | grep Running; then kubectl patch lhsm -n longhorn-system --type=merge --subresource status --patch 'status: {state: error}' $i fi done -- GitLab