Skip to content

Commit

Permalink
fix: istio package no longer assumes pepr deployments exist (#1232)
Browse files Browse the repository at this point in the history
## Description
Istio package will check to see if the pepr deployments exists before
attempting to restart them

## Related Issue

Fixes #
#1231 

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Steps to Validate
Run `uds run dev-setup` and verify it succeeds

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor
Guide](https://github.com/defenseunicorns/uds-template-capability/blob/main/CONTRIBUTING.md)
followed
  • Loading branch information
sgettys authored Jan 27, 2025
1 parent e003924 commit ab11592
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/istio/common/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,19 @@ components:
cmd: "./zarf tools kubectl label namespace pepr-system istio-injection=enabled --overwrite"
- description: "Cycle Pepr to ensure enrollment in Istio"
cmd: |
# Check if Istio is enabled. The pepr-system namespace should exist because that is added when istio is configured
if ! ./zarf tools kubectl get pods -n pepr-system -o jsonpath="{range .items[*]}{.metadata.name}:{range .spec.initContainers[*]}{.name} {end}{range .spec.containers[*]}{.name} {end}{'\n'}{end}" | grep -q 'istio-proxy'; then
./zarf tools kubectl rollout restart -n pepr-system deploy/pepr-uds-core-watcher
./zarf tools kubectl rollout restart -n pepr-system deploy/pepr-uds-core
# Check if the "pepr-uds-core-watcher" deployment exists before restarting
if ./zarf tools kubectl get deploy -n pepr-system pepr-uds-core-watcher > /dev/null 2>&1; then
./zarf tools kubectl rollout restart -n pepr-system deploy/pepr-uds-core-watcher
else
echo "Deployment 'pepr-uds-core-watcher' does not exist. Skipping restart."
fi
# Check if the "pepr-uds-core" deployment exists before restarting
if ./zarf tools kubectl get deploy -n pepr-system pepr-uds-core > /dev/null 2>&1; then
./zarf tools kubectl rollout restart -n pepr-system deploy/pepr-uds-core
else
echo "Deployment 'pepr-uds-core' does not exist. Skipping restart."
fi
fi

0 comments on commit ab11592

Please sign in to comment.