Skip to content

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

@marque88

Description

@marque88

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions