devspace-sh / devspace

DevSpace - The Fastest Developer Tool for Kubernetes ⚡ Automate your deployment workflow with DevSpace and develop software directly inside Kubernetes.
https://devspace.sh
Apache License 2.0
4.19k stars 351 forks source link

devspace deploy with --wait=true doesn't fail after timeout #2046

Closed mattndr closed 2 years ago

mattndr commented 2 years ago

What happened?

I run the following deploy command: devspace deploy --skip-build --config=devspace-ci.yaml --timeout=30 --wait=true. It should wait for pod to be running or fails after given timeout. The deployed pod status is ImagePullBackOff so it never swtich to Running state, this is an expected behaviour because I was testing an eventual pod deployment failure.

NAMESPACE                          NAME                                       READY   STATUS             RESTARTS      AGE     IP              NODE     NOMINATED NODE   READINESS GATES

pullrequest-1                      api-647b944564-g4rh8                       0/1     ImagePullBackOff   0             6m57s   10.244.84.140   node-1   <none>           <none>

However:

[info]   Using kube context 'kubernetes-admin@kubernetes'
deployment.apps/api created                                                
[done] √ Successfully deployed pullrequest with kubectl
[done] √ Successfully deployed!    

The devspace deploy command above do not check if the pod is in a Running state, as a result it never fails.

What did you expect to happen instead?
Since --wait=true and the pod is never running, it should fail after given timeout.

My devspace.yaml:

version: v1beta11
deployments:
  - name: pullrequest
    namespace: pullrequest-1
    kubectl:
      manifests:
        - manifests/production/api/

Local Environment:

Anything else we need to know?

/kind bug

mattndr commented 2 years ago

The problem was related to the currently configured namespace.