Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/53726-gitops-template-duplicate-fleet-check
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixed the duplicate fleet name check in the GitOps `gitops.sh` that `fleetctl new` generates: it never stopped the run, because `set -e` ignores a command starting with `!`. This applies the same fix #53469 made to Fleet's own GitOps action.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ fi
if compgen -G "$FLEET_GITOPS_DIR"/fleets/*.yml > /dev/null; then
# Validate that every fleet has a unique name.
# This is a limited check that assumes all per-fleet .yml files contain the phrase: `name: <fleet_name>`
! perl -nle 'print $1 if /^name:\s*(.+)$/' "$FLEET_GITOPS_DIR"/fleets/*.yml | sort | uniq -d | grep . -cq
if [ -n "$(perl -nle 'print $1 if /^name:\s*(.+)$/' "$FLEET_GITOPS_DIR"/fleets/*.yml | sort | uniq -d)" ]; then
echo "Error: duplicate fleet names found" >&2
exit 1
fi
fi

args=()
Expand Down
Loading