Skip to content

Commit

Permalink
fix(ci): use if condition to check rollout status (#24)
Browse files Browse the repository at this point in the history
Signed-off-by: Sunil Shivanand <sunil.shivanand@statnett.no>
  • Loading branch information
padlar committed Jan 10, 2023
1 parent 9e49411 commit 8f8f173
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,11 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default | kubectl apply --server-side -f -
for w in statefulset/trivy deployment/image-scanner-controller-manager; do \
kubectl rollout status $$w -n $(K8S_NAMESPACE) --timeout=2m \
|| (kubectl logs -n $(K8S_NAMESPACE) $$w --tail -1; kubectl get events -n $(K8S_NAMESPACE); false); \
if ! kubectl rollout status $$w -n $(K8S_NAMESPACE) --timeout=2m; then \
kubectl get events -n $(K8S_NAMESPACE); \
kubectl logs -n $(K8S_NAMESPACE) $$w --tail -1; \
exit 1; \
fi \
done

.PHONY: undeploy
Expand Down

0 comments on commit 8f8f173

Please sign in to comment.