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

Fix panic in waitForConsole #2

Merged
merged 1 commit into from
Sep 14, 2023
Merged

Fix panic in waitForConsole #2

merged 1 commit into from
Sep 14, 2023

Conversation

benwh
Copy link

@benwh benwh commented Sep 14, 2023

Resolve this error:

panic: interface conversion: runtime.Object is *v1.Status, not *unstructured.Unstructured

There was an assumption of the object type that didn't hold true. If a watch ERROR event type is received, then it should be cast to a v1.Status instead.

To avoid this, skip the event if it's of this type. This is likely fine for this case, as per the comment.

Also add some extra error handling.

https://github.com/kubernetes/apimachinery/blob/fd8daa85285e31da9771dbe372a66dfa20e78489/pkg/watch/watch.go#L43-L70

Resolve this error:
```
panic: interface conversion: runtime.Object is *v1.Status, not *unstructured.Unstructured
```

There was an assumption of the object type that didn't hold true. If a
watch `ERROR` event type is received, then it should be cast to a `v1.Status`
instead.

To avoid this, skip the event if it's of this type. This is likely fine
for this case, as per the comment.

Also add some extra error handling.

https://github.com/kubernetes/apimachinery/blob/fd8daa85285e31da9771dbe372a66dfa20e78489/pkg/watch/watch.go#L43-L70
@benwh benwh merged commit 62fe86a into master Sep 14, 2023
4 checks passed
@benwh benwh deleted the ben/watch-fix branch September 14, 2023 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant