Skip to content

Commit 7baa9f2

Browse files
committed
ci-operator/templates/openshift: Remove Terraform-state-based SSH gathers
Like 970ec02 (ci-operator/step-registry/ipi/deprovision/artifacts/bootstrap: Drop gather, 2019-12-10, #6336), except for the templates instead of the step registry.
1 parent 66e8fdd commit 7baa9f2

9 files changed

+0
-299
lines changed

ci-operator/templates/openshift/endurance/endurance-install.yaml

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -190,43 +190,6 @@ objects:
190190
echo "Gathering artifacts ..."
191191
mkdir -p /tmp/artifacts/pods /tmp/artifacts/nodes /tmp/artifacts/metrics /tmp/artifacts/bootstrap /tmp/artifacts/network
192192
193-
194-
if [ -f /tmp/artifacts/installer/terraform.tfstate ]
195-
then
196-
# we don't have jq, so the python equivalent of
197-
# jq '.modules[].resources."aws_instance.bootstrap".primary.attributes."public_ip" | select(.)'
198-
bootstrap_ip=$(python -c \
199-
'import sys, json; d=reduce(lambda x,y: dict(x.items() + y.items()), map(lambda x: x["resources"], json.load(sys.stdin)["modules"])); k="aws_instance.bootstrap"; print d[k]["primary"]["attributes"]["public_ip"] if k in d else ""' \
200-
< /tmp/artifacts/installer/terraform.tfstate
201-
)
202-
203-
if [ -n "${bootstrap_ip}" ]
204-
then
205-
for service in bootkube openshift kubelet crio
206-
do
207-
queue "/tmp/artifacts/bootstrap/${service}.service" curl \
208-
--insecure \
209-
--silent \
210-
--connect-timeout 5 \
211-
--retry 3 \
212-
--cert /tmp/artifacts/installer/tls/journal-gatewayd.crt \
213-
--key /tmp/artifacts/installer/tls/journal-gatewayd.key \
214-
--url "https://${bootstrap_ip}:19531/entries?_SYSTEMD_UNIT=${service}.service"
215-
done
216-
if ! whoami &> /dev/null; then
217-
if [ -w /etc/passwd ]; then
218-
echo "${USER_NAME:-default}:x:$(id -u):0:${USER_NAME:-default} user:${HOME}:/sbin/nologin" >> /etc/passwd
219-
fi
220-
fi
221-
eval $(ssh-agent)
222-
ssh-add /etc/openshift-installer/ssh-privatekey
223-
ssh -A -o PreferredAuthentications=publickey -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null core@${bootstrap_ip} /bin/bash -x /usr/local/bin/installer-gather.sh
224-
scp -o PreferredAuthentications=publickey -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null core@${bootstrap_ip}:log-bundle.tar.gz /tmp/artifacts/installer/bootstrap-logs.tar.gz
225-
fi
226-
else
227-
echo "No terraform statefile found. Skipping collection of bootstrap logs."
228-
fi
229-
230193
oc --insecure-skip-tls-verify --request-timeout=5s get nodes -o jsonpath --template '{range .items[*]}{.metadata.name}{"\n"}{end}' > /tmp/nodes
231194
oc --insecure-skip-tls-verify --request-timeout=5s get pods --all-namespaces --template '{{ range .items }}{{ $name := .metadata.name }}{{ $ns := .metadata.namespace }}{{ range .spec.containers }}-n {{ $ns }} {{ $name }} -c {{ .name }}{{ "\n" }}{{ end }}{{ range .spec.initContainers }}-n {{ $ns }} {{ $name }} -c {{ .name }}{{ "\n" }}{{ end }}{{ end }}' > /tmp/containers
232195
oc --insecure-skip-tls-verify --request-timeout=5s get pods -l openshift.io/component=api --all-namespaces --template '{{ range .items }}-n {{ .metadata.namespace }} {{ .metadata.name }}{{ "\n" }}{{ end }}' > /tmp/pods-api

ci-operator/templates/openshift/installer/cluster-launch-installer-custom-test-image.yaml

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -686,43 +686,6 @@ objects:
686686
echo "Gathering artifacts ..."
687687
mkdir -p /tmp/artifacts/pods /tmp/artifacts/nodes /tmp/artifacts/metrics /tmp/artifacts/bootstrap /tmp/artifacts/network
688688
689-
690-
if [ -f /tmp/artifacts/installer/terraform.tfstate ]
691-
then
692-
# we don't have jq, so the python equivalent of
693-
# jq '.modules[].resources."aws_instance.bootstrap".primary.attributes."public_ip" | select(.)'
694-
bootstrap_ip=$(python -c \
695-
'import sys, json; d=reduce(lambda x,y: dict(x.items() + y.items()), map(lambda x: x["resources"], json.load(sys.stdin)["modules"])); k="aws_instance.bootstrap"; print d[k]["primary"]["attributes"]["public_ip"] if k in d else ""' \
696-
< /tmp/artifacts/installer/terraform.tfstate
697-
)
698-
699-
if [ -n "${bootstrap_ip}" ]
700-
then
701-
for service in bootkube openshift kubelet crio
702-
do
703-
queue "/tmp/artifacts/bootstrap/${service}.service" curl \
704-
--insecure \
705-
--silent \
706-
--connect-timeout 5 \
707-
--retry 3 \
708-
--cert /tmp/artifacts/installer/tls/journal-gatewayd.crt \
709-
--key /tmp/artifacts/installer/tls/journal-gatewayd.key \
710-
--url "https://${bootstrap_ip}:19531/entries?_SYSTEMD_UNIT=${service}.service"
711-
done
712-
if ! whoami &> /dev/null; then
713-
if [ -w /etc/passwd ]; then
714-
echo "${USER_NAME:-default}:x:$(id -u):0:${USER_NAME:-default} user:${HOME}:/sbin/nologin" >> /etc/passwd
715-
fi
716-
fi
717-
eval $(ssh-agent)
718-
ssh-add /etc/openshift-installer/ssh-privatekey
719-
ssh -A -o PreferredAuthentications=publickey -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null core@${bootstrap_ip} /bin/bash -x /usr/local/bin/installer-gather.sh
720-
scp -o PreferredAuthentications=publickey -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null core@${bootstrap_ip}:log-bundle.tar.gz /tmp/artifacts/installer/bootstrap-logs.tar.gz
721-
fi
722-
else
723-
echo "No terraform statefile found. Skipping collection of bootstrap logs."
724-
fi
725-
726689
oc --insecure-skip-tls-verify --request-timeout=5s get nodes -o jsonpath --template '{range .items[*]}{.metadata.name}{"\n"}{end}' > /tmp/nodes
727690
oc --insecure-skip-tls-verify --request-timeout=5s get pods --all-namespaces --template '{{ range .items }}{{ $name := .metadata.name }}{{ $ns := .metadata.namespace }}{{ range .spec.containers }}-n {{ $ns }} {{ $name }} -c {{ .name }}{{ "\n" }}{{ end }}{{ range .spec.initContainers }}-n {{ $ns }} {{ $name }} -c {{ .name }}{{ "\n" }}{{ end }}{{ end }}' > /tmp/containers
728691
oc --insecure-skip-tls-verify --request-timeout=5s get pods -l openshift.io/component=api --all-namespaces --template '{{ range .items }}-n {{ .metadata.namespace }} {{ .metadata.name }}{{ "\n" }}{{ end }}' > /tmp/pods-api

ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -799,43 +799,6 @@ objects:
799799
echo "Gathering artifacts ..."
800800
mkdir -p /tmp/artifacts/pods /tmp/artifacts/nodes /tmp/artifacts/metrics /tmp/artifacts/bootstrap /tmp/artifacts/network
801801
802-
803-
if [ -f /tmp/artifacts/installer/terraform.tfstate ]
804-
then
805-
# we don't have jq, so the python equivalent of
806-
# jq '.modules[].resources."aws_instance.bootstrap".primary.attributes."public_ip" | select(.)'
807-
bootstrap_ip=$(python -c \
808-
'import sys, json; d=reduce(lambda x,y: dict(x.items() + y.items()), map(lambda x: x["resources"], json.load(sys.stdin)["modules"])); k="aws_instance.bootstrap"; print d[k]["primary"]["attributes"]["public_ip"] if k in d else ""' \
809-
< /tmp/artifacts/installer/terraform.tfstate
810-
)
811-
812-
if [ -n "${bootstrap_ip}" ]
813-
then
814-
for service in bootkube openshift kubelet crio
815-
do
816-
queue "/tmp/artifacts/bootstrap/${service}.service" curl \
817-
--insecure \
818-
--silent \
819-
--connect-timeout 5 \
820-
--retry 3 \
821-
--cert /tmp/artifacts/installer/tls/journal-gatewayd.crt \
822-
--key /tmp/artifacts/installer/tls/journal-gatewayd.key \
823-
--url "https://${bootstrap_ip}:19531/entries?_SYSTEMD_UNIT=${service}.service"
824-
done
825-
if ! whoami &> /dev/null; then
826-
if [ -w /etc/passwd ]; then
827-
echo "${USER_NAME:-default}:x:$(id -u):0:${USER_NAME:-default} user:${HOME}:/sbin/nologin" >> /etc/passwd
828-
fi
829-
fi
830-
eval $(ssh-agent)
831-
ssh-add /etc/openshift-installer/ssh-privatekey
832-
ssh -A -o PreferredAuthentications=publickey -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null core@${bootstrap_ip} /bin/bash -x /usr/local/bin/installer-gather.sh
833-
scp -o PreferredAuthentications=publickey -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null core@${bootstrap_ip}:log-bundle.tar.gz /tmp/artifacts/installer/bootstrap-logs.tar.gz
834-
fi
835-
else
836-
echo "No terraform statefile found. Skipping collection of bootstrap logs."
837-
fi
838-
839802
oc --insecure-skip-tls-verify --request-timeout=5s get nodes -o jsonpath --template '{range .items[*]}{.metadata.name}{"\n"}{end}' > /tmp/nodes
840803
oc --insecure-skip-tls-verify --request-timeout=5s get nodes -o jsonpath --template '{range .items[*]}{.spec.providerID}{"\n"}{end}' | sed 's|.*/||' > /tmp/node-provider-IDs
841804
oc --insecure-skip-tls-verify --request-timeout=5s get pods --all-namespaces --template '{{ range .items }}{{ $name := .metadata.name }}{{ $ns := .metadata.namespace }}{{ range .spec.containers }}-n {{ $ns }} {{ $name }} -c {{ .name }}{{ "\n" }}{{ end }}{{ range .spec.initContainers }}-n {{ $ns }} {{ $name }} -c {{ .name }}{{ "\n" }}{{ end }}{{ end }}' > /tmp/containers

ci-operator/templates/openshift/installer/cluster-launch-installer-metal-e2e.yaml

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -543,38 +543,6 @@ objects:
543543
echo "Gathering artifacts ..."
544544
mkdir -p /tmp/artifacts/pods /tmp/artifacts/nodes /tmp/artifacts/metrics /tmp/artifacts/bootstrap /tmp/artifacts/network
545545
546-
547-
if [ -f /tmp/artifacts/terraform/terraform.tfstate ]
548-
then
549-
bootstrap_ip=$(terraform output -state /tmp/artifacts/terraform/terraform.tfstate -json | jq -r '.bootstrap_ip.value')
550-
551-
if [ -n "${bootstrap_ip}" ]
552-
then
553-
for service in bootkube openshift kubelet crio
554-
do
555-
queue "/tmp/artifacts/bootstrap/${service}.service" curl \
556-
--insecure \
557-
--silent \
558-
--connect-timeout 5 \
559-
--retry 3 \
560-
--cert /tmp/artifacts/installer/tls/journal-gatewayd.crt \
561-
--key /tmp/artifacts/installer/tls/journal-gatewayd.key \
562-
--url "https://${bootstrap_ip}:19531/entries?_SYSTEMD_UNIT=${service}.service"
563-
done
564-
if ! whoami &> /dev/null; then
565-
if [ -w /etc/passwd ]; then
566-
echo "${USER_NAME:-default}:x:$(id -u):0:${USER_NAME:-default} user:${HOME}:/sbin/nologin" >> /etc/passwd
567-
fi
568-
fi
569-
eval $(ssh-agent)
570-
ssh-add /etc/openshift-installer/ssh-privatekey
571-
ssh -A -o PreferredAuthentications=publickey -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null core@${bootstrap_ip} /bin/bash -x /usr/local/bin/installer-gather.sh
572-
scp -o PreferredAuthentications=publickey -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null core@${bootstrap_ip}:log-bundle.tar.gz /tmp/artifacts/installer/bootstrap-logs.tar.gz
573-
fi
574-
else
575-
echo "No terraform statefile found. Skipping collection of bootstrap logs."
576-
fi
577-
578546
oc --insecure-skip-tls-verify --request-timeout=5s get nodes -o jsonpath --template '{range .items[*]}{.metadata.name}{"\n"}{end}' > /tmp/nodes
579547
oc --insecure-skip-tls-verify --request-timeout=5s get pods --all-namespaces --template '{{ range .items }}{{ $name := .metadata.name }}{{ $ns := .metadata.namespace }}{{ range .spec.containers }}-n {{ $ns }} {{ $name }} -c {{ .name }}{{ "\n" }}{{ end }}{{ range .spec.initContainers }}-n {{ $ns }} {{ $name }} -c {{ .name }}{{ "\n" }}{{ end }}{{ end }}' > /tmp/containers
580548
oc --insecure-skip-tls-verify --request-timeout=5s get pods -l openshift.io/component=api --all-namespaces --template '{{ range .items }}-n {{ .metadata.namespace }} {{ .metadata.name }}{{ "\n" }}{{ end }}' > /tmp/pods-api

ci-operator/templates/openshift/installer/cluster-launch-installer-ovirt-e2e.yaml

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -478,35 +478,6 @@ objects:
478478
echo "Gathering artifacts ..."
479479
mkdir -p /tmp/artifacts/pods /tmp/artifacts/nodes /tmp/artifacts/metrics /tmp/artifacts/bootstrap /tmp/artifacts/network
480480
481-
482-
if [ -f /tmp/artifacts/installer/terraform.tfstate ]
483-
then
484-
if [ -n "${bootstrap_ip}" ]
485-
then
486-
for service in bootkube openshift kubelet crio
487-
do
488-
queue "/tmp/artifacts/bootstrap/${service}.service" curl \
489-
--insecure \
490-
--silent \
491-
--connect-timeout 5 \
492-
--retry 3 \
493-
--cert /tmp/artifacts/installer/tls/journal-gatewayd.crt \
494-
--key /tmp/artifacts/installer/tls/journal-gatewayd.key \
495-
--url "https://${bootstrap_ip}:19531/entries?_SYSTEMD_UNIT=${service}.service"
496-
done
497-
if ! whoami &> /dev/null; then
498-
if [ -w /etc/passwd ]; then
499-
echo "${USER_NAME:-default}:x:$(id -u):0:${USER_NAME:-default} user:${HOME}:/sbin/nologin" >> /etc/passwd
500-
fi
501-
fi
502-
eval $(ssh-agent)
503-
ssh-add /etc/openshift-installer/ssh-privatekey
504-
ssh -A -o PreferredAuthentications=publickey -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null core@${bootstrap_ip} /bin/bash -x /usr/local/bin/installer-gather.sh
505-
scp -o PreferredAuthentications=publickey -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null core@${bootstrap_ip}:log-bundle.tar.gz /tmp/artifacts/installer/bootstrap-logs.tar.gz
506-
fi
507-
else
508-
echo "No terraform statefile found. Skipping collection of bootstrap logs."
509-
fi
510481
# WORKAROUND https://github.com/openshift/installer/issues/1467
511482
# We need this to be able to collect logs
512483
oc --insecure-skip-tls-verify --request-timeout=5s get csr -o name | xargs oc --insecure-skip-tls-verify --request-timeout=5s adm certificate approve

ci-operator/templates/openshift/installer/cluster-launch-installer-src.yaml

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -612,42 +612,6 @@ objects:
612612
echo "Gathering artifacts ..."
613613
mkdir -p /tmp/artifacts/pods /tmp/artifacts/nodes /tmp/artifacts/metrics /tmp/artifacts/bootstrap /tmp/artifacts/network
614614
615-
if [ -f /tmp/artifacts/installer/terraform.tfstate ]
616-
then
617-
# we don't have jq, so the python equivalent of
618-
# jq '.modules[].resources."aws_instance.bootstrap".primary.attributes."public_ip" | select(.)'
619-
bootstrap_ip=$(python -c \
620-
'import sys, json; d=reduce(lambda x,y: dict(x.items() + y.items()), map(lambda x: x["resources"], json.load(sys.stdin)["modules"])); k="aws_instance.bootstrap"; print d[k]["primary"]["attributes"]["public_ip"] if k in d else ""' \
621-
< /tmp/artifacts/installer/terraform.tfstate
622-
)
623-
624-
if [ -n "${bootstrap_ip}" ]
625-
then
626-
for service in bootkube openshift kubelet crio
627-
do
628-
queue "/tmp/artifacts/bootstrap/${service}.service" curl \
629-
--insecure \
630-
--silent \
631-
--connect-timeout 5 \
632-
--retry 3 \
633-
--cert /tmp/artifacts/installer/tls/journal-gatewayd.crt \
634-
--key /tmp/artifacts/installer/tls/journal-gatewayd.key \
635-
--url "https://${bootstrap_ip}:19531/entries?_SYSTEMD_UNIT=${service}.service"
636-
done
637-
if ! whoami &> /dev/null; then
638-
if [ -w /etc/passwd ]; then
639-
echo "${USER_NAME:-default}:x:$(id -u):0:${USER_NAME:-default} user:${HOME}:/sbin/nologin" >> /etc/passwd
640-
fi
641-
fi
642-
eval $(ssh-agent)
643-
ssh-add /etc/openshift-installer/ssh-privatekey
644-
ssh -A -o PreferredAuthentications=publickey -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null core@${bootstrap_ip} /bin/bash -x /usr/local/bin/installer-gather.sh
645-
scp -o PreferredAuthentications=publickey -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null core@${bootstrap_ip}:log-bundle.tar.gz /tmp/artifacts/installer/bootstrap-logs.tar.gz
646-
fi
647-
else
648-
echo "No terraform statefile found. Skipping collection of bootstrap logs."
649-
fi
650-
651615
oc --insecure-skip-tls-verify --request-timeout=5s get nodes -o jsonpath --template '{range .items[*]}{.metadata.name}{"\n"}{end}' > /tmp/nodes
652616
oc --insecure-skip-tls-verify --request-timeout=5s get pods --all-namespaces --template '{{ range .items }}{{ $name := .metadata.name }}{{ $ns := .metadata.namespace }}{{ range .spec.containers }}-n {{ $ns }} {{ $name }} -c {{ .name }}{{ "\n" }}{{ end }}{{ range .spec.initContainers }}-n {{ $ns }} {{ $name }} -c {{ .name }}{{ "\n" }}{{ end }}{{ end }}' > /tmp/containers
653617
oc --insecure-skip-tls-verify --request-timeout=5s get pods -l openshift.io/component=api --all-namespaces --template '{{ range .items }}-n {{ .metadata.namespace }} {{ .metadata.name }}{{ "\n" }}{{ end }}' > /tmp/pods-api

ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e.yaml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,33 +1896,6 @@ objects:
18961896
mv /tmp/artifacts/installer/openshift_install_state_updated.json /tmp/artifacts/installer/.openshift_install_state.json
18971897
fi
18981898
1899-
if [ -f /tmp/artifacts/installer/terraform.tfstate ]
1900-
then
1901-
# we don't have jq, so the python equivalent of
1902-
# jq '.modules[].resources."aws_instance.bootstrap".primary.attributes."public_ip" | select(.)'
1903-
bootstrap_ip=$(python -c \
1904-
'import sys, json; d=reduce(lambda x,y: dict(x.items() + y.items()), map(lambda x: x["resources"], json.load(sys.stdin)["modules"])); k="aws_instance.bootstrap"; print d[k]["primary"]["attributes"]["public_ip"] if k in d else ""' \
1905-
< /tmp/artifacts/installer/terraform.tfstate
1906-
)
1907-
1908-
if [ -n "${bootstrap_ip}" ]
1909-
then
1910-
for service in bootkube openshift kubelet crio
1911-
do
1912-
queue "/tmp/artifacts/bootstrap/${service}.service" curl \
1913-
--insecure \
1914-
--silent \
1915-
--connect-timeout 5 \
1916-
--retry 3 \
1917-
--cert /tmp/artifacts/installer/tls/journal-gatewayd.crt \
1918-
--key /tmp/artifacts/installer/tls/journal-gatewayd.key \
1919-
--url "https://${bootstrap_ip}:19531/entries?_SYSTEMD_UNIT=${service}.service"
1920-
done
1921-
fi
1922-
else
1923-
echo "No terraform statefile found. Skipping collection of bootstrap logs."
1924-
fi
1925-
19261899
# collect logs from the proxy
19271900
if [ -f "/tmp/artifacts/installer/proxyip" ]
19281901
then

0 commit comments

Comments
 (0)