Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors on kubectl get ksvc/${KUBE_SERVICE_NAME} #18

Open
marque88 opened this issue May 18, 2023 · 0 comments
Open

Errors on kubectl get ksvc/${KUBE_SERVICE_NAME} #18

marque88 opened this issue May 18, 2023 · 0 comments

Comments

@marque88
Copy link

Hi everyone,
I'm getting errors on these lines

SVC_STATUS_READY=$(kubectl get ksvc/${KUBE_SERVICE_NAME} -o json | jq '.status?.conditions[]?.status?|select(. == "True")')
SVC_STATUS_NOT_READY=$(kubectl get ksvc/${KUBE_SERVICE_NAME} -o json | jq '.status?.conditions[]?.status?|select(. == "False")')
SVC_STATUS_UNKNOWN=$(kubectl get ksvc/${KUBE_SERVICE_NAME} -o json | jq '.status?.conditions[]?.status?|select(. == "Unknown")')

because sometimes the request kubectl get ksvc/${KUBE_SERVICE_NAME} -o json goes in error (for example: Unable to connect to the server: net/http: TLS handshake timeout)

I know that's not a script error, but to manage temporary server error I wrapped all calls with an if statement to avoid that all pipeline fails because all script is executed setting -e option

script: |
#!/bin/bash
set -e -o pipefail

If it can help I open a pull request

Screenshot 2023-05-18 alle 15 59 26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant