-
Notifications
You must be signed in to change notification settings - Fork 887
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
kubectl wait with jsonpath
fails when field is not found
#1236
Comments
@pierDipi: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/sig cli |
Could u please explain this more? IMO, If the field is not exist, wait will return |
Currently, waiting on a condition with
waits even when the condition
fails immediately when |
Example use case where the wait with $ kubectl create deployment nginx --image=nginx; kubectl wait --for=jsonpath='{.status.readyReplicas}'=1 deploy/nginx
deployment.apps/nginx created
error: readyReplicas is not found instead with kubectl create deployment nginx --image=nginx; kubectl wait --for=condition=Available=True deploy/nginx
deployment.apps/nginx created
deployment.apps/nginx condition met |
I think this is more like a feature which keep the behavior of both logics consistent. |
Already implement this and test locally. kubectl create deployment nginx --image=nginx; kubectl wait --for=jsonpath=.status.readyReplicas=1 deploy/nginx
deployment.apps/nginx created
deployment.apps/nginx condition met For fileds that not exist, will return timeout. |
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
* Add Kafka Broker generator Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Generate some tests Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Scale machinesets Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Introduce a Kafka Broker/Trigger generator Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Update nightlies - ./bin/update-nightlies.sh Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Adjust resource requests and limits Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Use hyperfoil snapshot version Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Add workaround for kubernetes/kubernetes#109489 Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Test hyperfoil route connection Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Use Dict instead of dict Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Avoid using python 3.9 APIs Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Scale Kafka broker deployments Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Remove duplicate scale machineset Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Fix scale deployment Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
/transfer kubectl |
/triage accepted |
This might be a duplicate of #1204 |
What happened?
Waiting for a field to be set on a resource using
--for=jsonpath=
fails when the field is not found.What did you expect to happen?
The
jsonpath
syntax behaves differently when compared to--for=condition=
since this:waits even when there is no condition called
Nope
.In addition, waiting on status fields that are set asynchronously is really useful, so the usual flow of creating and waiting for a resource to have a specific field isn't reliably solvable with this error thrown.
How can we reproduce it (as minimally and precisely as possible)?
Run:
Anything else we need to know?
I see a test with this behavior [1], however, I think it's not consistent with the existing wait behavior.
[1] https://github.com/kubernetes/kubernetes/blob/10dcc6c5f44a0607881cd2f3bd5c4d80f61ad120/staging/src/k8s.io/kubectl/pkg/cmd/wait/wait_test.go#L1167-L1176
Kubernetes version
Cloud provider
OS version
Install tools
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)
The text was updated successfully, but these errors were encountered: