Skip to content
Merged
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
25 changes: 25 additions & 0 deletions scripts/verify-argocd-auto-detection.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Check if NAMESPACE is set
if [ -z "$NAMESPACE" ]; then
echo "❌ ERROR: NAMESPACE environment variable is not set."
echo "Please set the NAMESPACE environment variable and try again."
echo "Example: NAMESPACE=argocd ./verify-argocd-auto-detection.sh"
exit 1
fi

echo "Checking Argo CD service labels in namespace '$NAMESPACE'..."
S=$(kubectl get svc -n "$NAMESPACE" -l app.kubernetes.io/component=server,app.kubernetes.io/part-of=argocd -o name 2>/dev/null)
R=$(kubectl get svc -n "$NAMESPACE" -l app.kubernetes.io/component=repo-server,app.kubernetes.io/part-of=argocd -o name 2>/dev/null)
D=$(kubectl get svc -n "$NAMESPACE" -l app.kubernetes.io/component=redis,app.kubernetes.io/part-of=argocd -o name 2>/dev/null)
[ -z "$S" ] && echo "❌ Server: NOT FOUND" || echo "✅ Server: Found"
[ -z "$R" ] && echo "❌ Repo: NOT FOUND" || echo "✅ Repo: Found"
[ -z "$D" ] && echo "❌ Redis: NOT FOUND" || echo "✅ Redis: Found"
if [ -n "$S" ] && [ -n "$R" ] && [ -n "$D" ]; then
echo "✅ SUCCESS: All Argo CD services have proper labels for auto-detection."
else
echo "❌ ISSUE: Missing services in namespace '$NAMESPACE'. Required labels:"
echo "- Server: app.kubernetes.io/component=server,app.kubernetes.io/part-of=argocd"
echo "- Repo: app.kubernetes.io/component=repo-server,app.kubernetes.io/part-of=argocd"
echo "- Redis: app.kubernetes.io/component=redis,app.kubernetes.io/part-of=argocd"
fi