@@ -37,6 +37,14 @@ if ! whoami &> /dev/null; then
37
37
fi
38
38
fi
39
39
40
+ # if curl is ever updated we can use this instead
41
+ # curl -o /dev/null -s -k -w "\n%{certs}\n" "https://api-int.${NAMESPACE}-${UNIQUE_HASH}.vmc-ci.devcluster.openshift.com:6443"
42
+
43
+
44
+
45
+ curl -kv " https://api-int.${NAMESPACE} -${UNIQUE_HASH} .vmc-ci.devcluster.openshift.com:6443" > ${ARTIFACT_DIR} /cluster-cert.txt
46
+
47
+
40
48
function collect_sosreport {
41
49
ADDRESS=$1
42
50
echo " $( date -u --rfc-3339=seconds) - executing sos report at $ADDRESS "
@@ -67,7 +75,7 @@ function collect_sosreport_from_unprovisioned_machines {
67
75
for MACHINE in ${MACHINES} ; do
68
76
echo " $( date -u --rfc-3339=seconds) - checking if machine $MACHINE lacks a nodeRef"
69
77
NODEREF=$( oc get machines.machine.openshift.io -n openshift-machine-api $MACHINE -o=jsonpath=' {.status.nodeRef}' )
70
-
78
+
71
79
if [ -z " $NODEREF " ]; then
72
80
echo " $( date -u --rfc-3339=seconds) - attempting to collect sos report"
73
81
ADDRESS=$( oc get machines.machine.openshift.io -n openshift-machine-api $MACHINE -o=jsonpath=' {.status.addresses[0].address}' )
@@ -170,7 +178,7 @@ function collect_diagnostic_data {
170
178
VCENTER_COUNT=$( jq ' .vcenters | length' " $SHARED_DIR " /platform.json)
171
179
v_idx=0
172
180
173
-
181
+
174
182
while [[ $v_idx -lt $VCENTER_COUNT ]]; do
175
183
VCENTER=$( jq -c -r ' .vcenters[' ${v_idx} ' ]' " $SHARED_DIR " /platform.json)
176
184
GOVC_URL=$( echo $VCENTER | jq -r ' .server' )
@@ -183,7 +191,7 @@ function collect_diagnostic_data {
183
191
184
192
IFS=$' \n ' read -d ' ' -r -a all_hosts <<< " $(govc find . -type h -runtime.powerState poweredOn)"
185
193
IFS=$' \n ' read -d ' ' -r -a PORTGROUPS <<< " $(jq -r -c --arg vcenter " ${GOVC_URL} " '[.failureDomains[] | select(.server == $vcenter ) | .topology.networks[]] | unique | .[]' < " $SHARED_DIR " /platform.json)"
186
-
194
+
187
195
if [ -z ${PORTGROUPS:- } ]; then
188
196
echo " ${GOVC_URL} ; port groups in failure domain: ${# PORTGROUPS[@]} "
189
197
v_idx=$(( v_idx+ 1 )) ;
@@ -197,17 +205,17 @@ function collect_diagnostic_data {
197
205
198
206
IFS=$' \n ' read -d ' ' -r -a networks <<< " $(govc find -type=n -i=true -name ${PORTGROUP})"
199
207
200
- if [ -z ${networks:- } ]; then
208
+ if [ -z ${networks:- } ]; then
201
209
echo " No networks found associated with port group ${PORTGROUP} : $( govc find -type=n -i=true -name ${PORTGROUP} ) "
202
210
v_idx=$(( v_idx+ 1 )) ;
203
211
continue
204
212
fi
205
-
213
+
206
214
echo " ${GOVC_URL} ; ${PORTGROUP} ; found networks: ${# networks[@]} "
207
215
208
216
for network in " ${networks[@]} " ; do
209
217
IFS=$' \n ' read -d ' ' -r -a vms <<< " $(govc find . -type m -runtime.powerState poweredOn -network $network)"
210
- if [ -z ${vms:- } ]; then
218
+ if [ -z ${vms:- } ]; then
211
219
echo " No VMs found associated with network ${network} $( govc find . -type m -runtime.powerState poweredOn -network $network ) "
212
220
continue
213
221
fi
@@ -251,16 +259,16 @@ function collect_diagnostic_data {
251
259
done
252
260
done
253
261
done
254
-
262
+
255
263
if [ -n " ${vms:- } " ]; then
256
264
target_hw_version=$( govc vm.info -json=true " ${vms[0]} " | jq -r .VirtualMachines[0].Config.Version)
257
- echo " {\" hw_version\" : \" ${target_hw_version} \" , \" cloud\" : \" ${cloud_where_run} \" }" > " ${ARTIFACT_DIR} /runtime-config.json"
265
+ echo " {\" hw_version\" : \" ${target_hw_version} \" , \" cloud\" : \" ${cloud_where_run} \" }" > " ${ARTIFACT_DIR} /runtime-config.json"
258
266
fi
259
267
260
268
if [ -n " ${JSON_DATA:- } " ]; then
261
269
echo ${JSON_DATA} > " ${vcenter_state} /metric-files.json"
262
- fi
263
-
270
+ fi
271
+
264
272
v_idx=$(( v_idx+ 1 )) ;
265
273
done
266
274
@@ -314,7 +322,7 @@ function embed_topology_data() {
314
322
POD=$( jq --compact-output -r .spec.podName < " ${NETWORK} " )
315
323
DATACENTER=$( jq --compact-output -r .spec.datacenterName < " ${NETWORK} " )
316
324
CIDR=$( jq --compact-output -r .spec.machineNetworkCidr < " ${NETWORK} " )
317
- GATEWAY=$( jq --compact-output -r .spec.gateway < " ${NETWORK} " )
325
+ GATEWAY=$( jq --compact-output -r .spec.gateway < " ${NETWORK} " )
318
326
319
327
echo " Network: ${NAME} <br>" >> " ${RESULT_HTML} "
320
328
echo " - VLAN: ${VLAN} <br>" >> " ${RESULT_HTML} "
@@ -363,7 +371,7 @@ function embed_vm_data() {
363
371
echo " <script type='application/json' id='${VM} -screenshot'>" >> ${RESULT_HTML}
364
372
SCREENSHOT_BASE64=$( jq -r --arg VM " ${VM} " ' .vms[] | select(.name == $VM) | .screenshot' ${vcenter_state} /metric-files.json)
365
373
echo $SCREENSHOT_BASE64 >> ${RESULT_HTML}
366
- echo " </script>" >> ${RESULT_HTML}
374
+ echo " </script>" >> ${RESULT_HTML}
367
375
done
368
376
}
369
377
446
454
447
455
embed_topology_data
448
456
449
- cat >> " ${RESULT_HTML} " << EOF
457
+ cat >> " ${RESULT_HTML} " << EOF
450
458
</data>
451
459
<data id="vm-data">
452
460
<div id="vm-data-content">
0 commit comments