diff --git a/examples/ignition/install-reboot.yaml b/examples/ignition/install-reboot.yaml index 89d43fab..88ada5df 100644 --- a/examples/ignition/install-reboot.yaml +++ b/examples/ignition/install-reboot.yaml @@ -20,7 +20,7 @@ storage: contents: inline: | #!/bin/bash -ex - curl "{{.ignition_endpoint}}?{{.request.raw_query}}&os=installed" -o ignition.json + curl --fail "{{.ignition_endpoint}}?{{.request.raw_query}}&os=installed" -o ignition.json coreos-install -d /dev/sda -C {{.coreos_channel}} -V {{.coreos_version}} -i ignition.json {{if index . "baseurl"}}-b {{.baseurl}}{{end}} udevadm settle systemctl reboot diff --git a/examples/ignition/install-shutdown.yaml b/examples/ignition/install-shutdown.yaml index 12bdffcc..c08149d8 100644 --- a/examples/ignition/install-shutdown.yaml +++ b/examples/ignition/install-shutdown.yaml @@ -20,7 +20,7 @@ storage: contents: inline: | #!/bin/bash -ex - curl "{{.ignition_endpoint}}?{{.request.raw_query}}&os=installed" -o ignition.json + curl --fail "{{.ignition_endpoint}}?{{.request.raw_query}}&os=installed" -o ignition.json coreos-install -d /dev/sda -C {{.coreos_channel}} -V {{.coreos_version}} -i ignition.json {{if index . "baseurl"}}-b {{.baseurl}}{{end}} udevadm settle systemctl poweroff diff --git a/examples/ignition/k8s-controller.yaml b/examples/ignition/k8s-controller.yaml index d25f7114..f4bc387c 100644 --- a/examples/ignition/k8s-controller.yaml +++ b/examples/ignition/k8s-controller.yaml @@ -44,7 +44,7 @@ systemd: After=network-online.target [Service] ExecStartPre=/usr/bin/mkdir -p /etc/kubernetes/ssl - ExecStart=/usr/bin/bash -c "[ -f /etc/kubernetes/ssl/%i ] || curl {{.k8s_cert_endpoint}}/tls/%i -o /etc/kubernetes/ssl/%i" + ExecStart=/usr/bin/bash -c "[ -f /etc/kubernetes/ssl/%i ] || curl --fail {{.k8s_cert_endpoint}}/tls/%i -o /etc/kubernetes/ssl/%i" - name: k8s-assets.target contents: | [Unit] @@ -712,7 +712,7 @@ storage: IFS=',' read -ra ES <<< "{{.k8s_etcd_endpoints}}" for ETCD in "${ES[@]}"; do echo "Trying: $ETCD" - if [ -n "$(curl --silent "$ETCD/v2/machines")" ]; then + if [ -n "$(curl --fail --silent "$ETCD/v2/machines")" ]; then local ACTIVE_ETCD=$ETCD break fi @@ -722,7 +722,7 @@ storage: break fi done - RES=$(curl --silent -X PUT -d "value={\"Network\":\"{{.k8s_pod_network}}\",\"Backend\":{\"Type\":\"vxlan\"}}" "$ACTIVE_ETCD/v2/keys/coreos.com/network/config?prevExist=false") + RES=$(curl --fail --silent -X PUT -d "value={\"Network\":\"{{.k8s_pod_network}}\",\"Backend\":{\"Type\":\"vxlan\"}}" "$ACTIVE_ETCD/v2/keys/coreos.com/network/config?prevExist=false") if [ -z "$(echo $RES | grep '"action":"create"')" ] && [ -z "$(echo $RES | grep 'Key already exists')" ]; then echo "Unexpected error configuring flannel pod network: $RES" fi @@ -752,20 +752,20 @@ storage: inline: | #!/bin/bash -ex echo "Waiting for Kubernetes API..." - until curl --silent "http://127.0.0.1:8080/version" + until curl --fail --silent "http://127.0.0.1:8080/version" do sleep 5 done echo "K8S: DNS addon" - curl --silent -H "Content-Type: application/yaml" -XPOST -d"$(cat /srv/kubernetes/manifests/kube-dns-deployment.yaml)" "http://127.0.0.1:8080/apis/extensions/v1beta1/namespaces/kube-system/deployments" - curl --silent -H "Content-Type: application/yaml" -XPOST -d"$(cat /srv/kubernetes/manifests/kube-dns-svc.yaml)" "http://127.0.0.1:8080/api/v1/namespaces/kube-system/services" - curl --silent -H "Content-Type: application/yaml" -XPOST -d"$(cat /srv/kubernetes/manifests/kube-dns-autoscaler-deployment.yaml)" "http://127.0.0.1:8080/apis/extensions/v1beta1/namespaces/kube-system/deployments" + curl --fail --silent -H "Content-Type: application/yaml" -XPOST -d"$(cat /srv/kubernetes/manifests/kube-dns-deployment.yaml)" "http://127.0.0.1:8080/apis/extensions/v1beta1/namespaces/kube-system/deployments" + curl --fail --silent -H "Content-Type: application/yaml" -XPOST -d"$(cat /srv/kubernetes/manifests/kube-dns-svc.yaml)" "http://127.0.0.1:8080/api/v1/namespaces/kube-system/services" + curl --fail --silent -H "Content-Type: application/yaml" -XPOST -d"$(cat /srv/kubernetes/manifests/kube-dns-autoscaler-deployment.yaml)" "http://127.0.0.1:8080/apis/extensions/v1beta1/namespaces/kube-system/deployments" echo "K8S: Heapster addon" - curl --silent -H "Content-Type: application/yaml" -XPOST -d"$(cat /srv/kubernetes/manifests/heapster-deployment.yaml)" "http://127.0.0.1:8080/apis/extensions/v1beta1/namespaces/kube-system/deployments" - curl --silent -H "Content-Type: application/yaml" -XPOST -d"$(cat /srv/kubernetes/manifests/heapster-svc.yaml)" "http://127.0.0.1:8080/api/v1/namespaces/kube-system/services" + curl --fail --silent -H "Content-Type: application/yaml" -XPOST -d"$(cat /srv/kubernetes/manifests/heapster-deployment.yaml)" "http://127.0.0.1:8080/apis/extensions/v1beta1/namespaces/kube-system/deployments" + curl --fail --silent -H "Content-Type: application/yaml" -XPOST -d"$(cat /srv/kubernetes/manifests/heapster-svc.yaml)" "http://127.0.0.1:8080/api/v1/namespaces/kube-system/services" echo "K8S: Dashboard addon" - curl --silent -H "Content-Type: application/yaml" -XPOST -d"$(cat /srv/kubernetes/manifests/kube-dashboard-deployment.yaml)" "http://127.0.0.1:8080/apis/extensions/v1beta1/namespaces/kube-system/deployments" - curl --silent -H "Content-Type: application/yaml" -XPOST -d"$(cat /srv/kubernetes/manifests/kube-dashboard-svc.yaml)" "http://127.0.0.1:8080/api/v1/namespaces/kube-system/services" + curl --fail --silent -H "Content-Type: application/yaml" -XPOST -d"$(cat /srv/kubernetes/manifests/kube-dashboard-deployment.yaml)" "http://127.0.0.1:8080/apis/extensions/v1beta1/namespaces/kube-system/deployments" + curl --fail --silent -H "Content-Type: application/yaml" -XPOST -d"$(cat /srv/kubernetes/manifests/kube-dashboard-svc.yaml)" "http://127.0.0.1:8080/api/v1/namespaces/kube-system/services" {{ if index . "ssh_authorized_keys" }} passwd: diff --git a/examples/ignition/k8s-worker.yaml b/examples/ignition/k8s-worker.yaml index cc99d5b5..6f616d35 100644 --- a/examples/ignition/k8s-worker.yaml +++ b/examples/ignition/k8s-worker.yaml @@ -39,7 +39,7 @@ systemd: After=network-online.target [Service] ExecStartPre=/usr/bin/mkdir -p /etc/kubernetes/ssl - ExecStart=/usr/bin/bash -c "[ -f /etc/kubernetes/ssl/%i ] || curl {{.k8s_cert_endpoint}}/tls/%i -o /etc/kubernetes/ssl/%i" + ExecStart=/usr/bin/bash -c "[ -f /etc/kubernetes/ssl/%i ] || curl --fail {{.k8s_cert_endpoint}}/tls/%i -o /etc/kubernetes/ssl/%i" - name: k8s-assets.target contents: | [Unit]