From 23867e9ddf016f2e2b0c8ea0ebe63fd13b0835de Mon Sep 17 00:00:00 2001 From: Gorka Eguileor Date: Tue, 12 Mar 2024 17:28:09 +0100 Subject: [PATCH] Get NetworkAttachmentDefinition objects The current script tries to get the `NetworkAttachmentDefinition` using the `nad` keyword, but that doesn't exist on the OCP cluster. Using keyword `NetworkAttachmentDefinition` doesn't work either, only using `network-attachment-definition` or `network-attachment-definitions` works. This patch changes to using the plural version that works. --- collection-scripts/gather_ctlplane_resources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collection-scripts/gather_ctlplane_resources b/collection-scripts/gather_ctlplane_resources index 6e7426a..64e9609 100755 --- a/collection-scripts/gather_ctlplane_resources +++ b/collection-scripts/gather_ctlplane_resources @@ -20,7 +20,7 @@ function gather_ctlplane_resources { run_bg /usr/bin/oc -n "${NS}" get all '>' "${NAMESPACE_PATH}/${NS}/all_resources.log" run_bg /usr/bin/oc -n "${NS}" get events '>' "${NAMESPACE_PATH}/${NS}/events.log" run_bg /usr/bin/oc -n "${NS}" get pvc '>' "${NAMESPACE_PATH}/${NS}/pvc.log" - run_bg /usr/bin/oc -n "${NS}" get nad -o yaml '>' "${NAMESPACE_PATH}/${NS}/nad.log" + run_bg /usr/bin/oc -n "${NS}" get network-attachment-definitions -o yaml '>' "${NAMESPACE_PATH}/${NS}/nad.log" # We make a single request to get lines in the form data=$(oc -n "$NS" get pod -o go-template='{{range $indexp,$pod := .items}}{{range $index,$element := $pod.status.containerStatuses}}{{printf "%s %s" $pod.metadata.name $element.name}} {{ if ne $element.lastState.terminated nil }}{{ printf "%s" $element.lastState.terminated }}{{ end }}{{ printf "\n"}}{{end}}{{end}}')