Skip to content
Snippets Groups Projects
Verified Commit 506c374a authored by Sheogorath's avatar Sheogorath :european_castle:
Browse files

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
```
parent b743dcf5
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment