Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

issue #58 - adding a listener for server changes to published integra… #130

Merged
merged 1 commit into from
Sep 18, 2019
Merged

issue #58 - adding a listener for server changes to published integra… #130

merged 1 commit into from
Sep 18, 2019

Conversation

bfitzpat
Copy link
Contributor

…tions

Signed-off-by: Brian Fitzpatrick bfitzpat@redhat.com

@bfitzpat bfitzpat self-assigned this Sep 13, 2019
@bfitzpat bfitzpat requested review from apupier and lhein September 13, 2019 14:53
@bfitzpat
Copy link
Contributor Author

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

@bfitzpat
Copy link
Contributor Author

I can probably get around this watching the integrationkits thread instead - "kubectl get integrationkits -w" - trying that now.

@bfitzpat
Copy link
Contributor Author

Nope - that doesn't work - and eventually the watch thread quits as well, so this may not be the best way to go.

@bfitzpat
Copy link
Contributor Author

If I can find a way to keep the kubectl call from timing out after a certain amount of inactivity, maybe this will work.

@lhein
Copy link
Contributor

lhein commented Sep 13, 2019

it feels like this feature is not ready yet then?

@bfitzpat
Copy link
Contributor Author

bfitzpat commented Sep 13, 2019

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)

@bfitzpat
Copy link
Contributor Author

@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 kamel get calls to see if we could detect changes, but now that we're using the watch we don't need to do so.

@lhein
Copy link
Contributor

lhein commented Sep 13, 2019

ok, is there not a parameter to watch in endless mode?

@bfitzpat
Copy link
Contributor Author

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.

Copy link
Contributor

@lhein lhein left a 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.

Copy link
Member

@apupier apupier left a 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 :-(

src/extension.ts Outdated Show resolved Hide resolved
…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>
@bfitzpat bfitzpat merged commit 7a4d7e7 into camel-tooling:master Sep 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants