@@ -39,6 +39,23 @@ if ! command -v yq &> /dev/null; then
3939 exit 1
4040fi
4141
42+ # Check if podman is available and running
43+ if ! command -v podman & > /dev/null; then
44+ echo " ERROR: podman is required but not installed"
45+ echo " Please install podman: https://podman.io/getting-started/installation"
46+ exit 1
47+ fi
48+
49+ # Verify podman is running properly
50+ if ! podman info & > /dev/null; then
51+ echo " ERROR: podman is installed but not responding"
52+ echo " Please ensure the podman service is running"
53+ echo " Try: podman machine start (for macOS/Windows) or check podman service status (for Linux)"
54+ exit 1
55+ fi
56+
57+ echo " ✓ podman is available and running"
58+
4259# Extract clusterGroupName from values-global.yaml using yq
4360CLUSTER_GROUP_NAME=$( yq eval ' .main.clusterGroupName' values-global.yaml)
4461
@@ -132,39 +149,20 @@ echo "starting pattern install on hub cluster"
132149echo " ---------------------"
133150export KUBECONFIG=" $( pwd) /openshift-install-hub/auth/kubeconfig"
134151
135- # Start pattern installation in background
136- ./pattern.sh make install &
137- PATTERN_PID=$!
138- echo " Pattern installation started in background (PID: $PATTERN_PID )"
152+ # Start pattern installation and capture exit code
153+ set +e
154+ ./pattern.sh make install
155+ PATTERN_EXIT_CODE=$?
156+ set -e
139157
140158echo " ---------------------"
141159echo " creating spoke cluster (while pattern installs)"
142160echo " ---------------------"
143- openshift-install create cluster --dir=./openshift-install-spoke --log-level=info &
144- SPOKE_PID=$!
145- echo " Spoke cluster creation started in background (PID: $SPOKE_PID )"
146-
147- # Wait for pattern installation to complete
148- echo " Waiting for pattern installation to complete..."
149- wait $PATTERN_PID
150- PATTERN_EXIT_CODE=$?
151-
152- if [ $PATTERN_EXIT_CODE -ne 0 ]; then
153- echo " ERROR: Pattern installation failed with exit code $PATTERN_EXIT_CODE "
154- else
155- echo " Pattern installation completed successfully!"
156- fi
157-
158- # Wait for spoke cluster to complete
159- echo " Waiting for spoke cluster creation to complete..."
160- wait $SPOKE_PID
161+ set +e
162+ openshift-install create cluster --dir=./openshift-install-spoke --log-level=info
161163SPOKE_EXIT_CODE=$?
164+ set -e
162165
163- if [ $SPOKE_EXIT_CODE -ne 0 ]; then
164- echo " WARNING: Spoke cluster creation failed with exit code $SPOKE_EXIT_CODE "
165- else
166- echo " Spoke cluster creation completed successfully!"
167- fi
168166
169167echo " ---------------------"
170168echo " Verifying ACM deployment on hub cluster"
287285
288286 # Verify the label is set correctly
289287 CLUSTER_LABEL=$( kubectl get managedcluster coco-spoke -o jsonpath=' {.metadata.labels.clusterGroup}' 2> /dev/null)
290- if [ " $CLUSTER_LABEL " == " untrustedSpoke " ]; then
291- echo " ✓ Cluster label 'clusterGroup=untrustedSpoke ' verified"
288+ if [ " $CLUSTER_LABEL " == " untrusted-spoke " ]; then
289+ echo " ✓ Cluster label 'clusterGroup=untrusted-spoke ' verified"
292290 else
293291 echo " WARNING: Cluster label is '$CLUSTER_LABEL ' (expected: untrustedSpoke)"
294292 fi
0 commit comments