Skip to content

Commit 1ebe879

Browse files
authored
Use new plugin SDK interface to build kubernetes_multicluster plugin (#5702)
Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
1 parent d84746b commit 1ebe879

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

pkg/app/pipedv1/plugin/kubernetes_multicluster/main.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@ import (
2121
)
2222

2323
func main() {
24-
sdk.RegisterStagePlugin(&plugin{})
24+
plugin, err := sdk.NewPlugin(
25+
"kubernetes_multicluster", "0.0.1",
26+
sdk.WithStagePlugin(&plugin{}),
27+
)
28+
if err != nil {
29+
log.Fatalln(err)
30+
}
2531

26-
if err := sdk.Run(); err != nil {
32+
if err := plugin.Run(); err != nil {
2733
log.Fatalln(err)
2834
}
2935
}

pkg/app/pipedv1/plugin/kubernetes_multicluster/plugin.go

+2
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ type deployTargetConfig struct{}
3030
var _ sdk.StagePlugin[config, deployTargetConfig] = (*plugin)(nil)
3131

3232
// Name implements sdk.Plugin.
33+
// TODO: remove this method after changing the sdk.StagePlugin interface.
3334
func (p *plugin) Name() string {
3435
return "kubernetes_multicluster"
3536
}
3637

3738
// Version implements sdk.Plugin.
39+
// TODO: remove this method after changing the sdk.StagePlugin interface.
3840
func (p *plugin) Version() string {
3941
return "0.0.1"
4042
}

0 commit comments

Comments
 (0)