-
Notifications
You must be signed in to change notification settings - Fork 13
issue #58 - adding a listener for server changes to published integra… #130
issue #58 - adding a listener for server changes to published integra… #130
Conversation
So a couple of things here. I'm using kubectl to monitor the system and react when anything changes with published "integration" objects in the server. I'm using "kubectl get integrations -w" This works great for the traditional case where everything runs fine. I get notified for most states if they work all the way through Building Kit into Running, but I'm not getting notified when things go from Building Kit to Error. Wondering if that's a missed notification being passed along from Camel K back to Kubernetes? Have asked on the Camel K chat but also opened an issue - apache/camel-k#937 |
I can probably get around this watching the integrationkits thread instead - "kubectl get integrationkits -w" - trying that now. |
Nope - that doesn't work - and eventually the watch thread quits as well, so this may not be the best way to go. |
If I can find a way to keep the kubectl call from timing out after a certain amount of inactivity, maybe this will work. |
it feels like this feature is not ready yet then? |
Still working on it. I'm guessing there's a way to work around the kubernetes timeout. And the Building Kit/Error problem is being fixed on the Camel K side already courtesy of @jamesnetherton (see apache/camel-k#927) |
@lhein Found a workaround - now we simply restart the watch when it times out and all is good with the world. Even did some additional cleanup to remove now unnecessary code in the node provider. We used to do multiple |
ok, is there not a parameter to watch in endless mode? |
Not that I can find in the kubectl guide - https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#get And looking online it looks like the timeout is customizable on the server side, so it's nothing I can pass on the cli. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I am not able to test the functionality but from reading the code it looks fine. Maybe its a good idea to let @apupier review too before the merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works great (yes I installed Camel K locally and it worked on first try!)
little suggestion for code improvements (the only point to be discussed or changed before I approve)
there is no test but I have no suggestion on how to test this code efficiently in typescript and without a Camel k instance :-(
…tions -- use kubectl get integrations -w to watch for system changes and refresh the tree -- use node.js event system to restart the watch when the kubernetes call times out -- only refresh the tree when the view is visible -- get rid of old code that did a max of 10 tries to get details from the system to watch for changes Signed-off-by: Brian Fitzpatrick <bfitzpat@redhat.com>
…tions
Signed-off-by: Brian Fitzpatrick bfitzpat@redhat.com