Skip to content

Commit d84746b

Browse files
authored
Use new plugin sdk interface to build wait plugin (#5700)
Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
1 parent d7fbff0 commit d84746b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

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

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

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

26-
if err := sdk.Run(); err != nil {
29+
if err := plugin.Run(); err != nil {
2730
log.Fatalln(err)
2831
}
2932
}

pkg/app/pipedv1/plugin/wait/plugin.go

+2
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ const (
2727
type plugin struct{}
2828

2929
// Name implements sdk.Plugin.
30+
// TODO: remove this method after changing the sdk.StagePlugin interface.
3031
func (p *plugin) Name() string {
3132
return "wait"
3233
}
3334

3435
// Version implements sdk.Plugin.
36+
// TODO: remove this method after changing the sdk.StagePlugin interface.
3537
func (p *plugin) Version() string {
3638
return "0.0.1" // TODO
3739
}

0 commit comments

Comments
 (0)