loft-sh / vcluster-sdk

Provides a toolset to create custom vcluster syncers
Apache License 2.0
25 stars 20 forks source link

Plugin hangs on vcluster 0.9.0 #26

Closed aikoven closed 2 years ago

aikoven commented 2 years ago

Hi,

After upgrading vcluster from 0.8.0 to 0.9.0 our plugin stopped working. At first it stuck at

I0617 04:55:36.701958       1 logr.go:249] plugin: Try creating context...

We've upgraded vcluster-sdk dependency to v0.2.0, and it went further but still stuck after:

I0617 05:21:19.046503       1 logr.go:249] plugin: Try creating context...
I0617 05:21:24.092359       1 logr.go:249] plugin: Waiting for vcluster to become leader...
FabianKramm commented 2 years ago

@aikoven thanks for creating this issue! Mhh thats strange v0.9.1 and higher should work fine with the SDK v0.2.0. Is there any output on the syncer container regarding this?

aikoven commented 2 years ago

The output of the syncer container is:

I0617 05:21:20.991965       1 start.go:294] Start Plugins Manager...
I0617 05:21:20.993172       1 plugin.go:164] Plugin server listening on localhost:10099
I0617 05:21:20.993514       1 plugin.go:185] Waiting for plugin contour-sync to register...
I0617 05:21:24.092193       1 plugin.go:222] Registering plugin contour-sync-plugin

And yeah, we tried both 0.9.0 and 0.9.1.

FabianKramm commented 2 years ago

@aikoven it seems your plugin is called in your plugin.yaml contour-sync and inside the plugin itself contour-sync-plugin. This can cause problems as vcluster is waiting for contour-sync, but contour-sync-plugin registers. Does it work when you name the plugin the same in code and plugin.yaml?

aikoven commented 2 years ago

I didn't notice that, good catch! This indeed fixed the issue.

Thanks!

FabianKramm commented 2 years ago

@aikoven yes I admit this is currently a little bit unfortunate, but we will get rid of this requirement to have a name in plugin.yaml as well as the plugin itself in one of the next vcluster versions.