-
Notifications
You must be signed in to change notification settings - Fork 1
/
plugin.go
53 lines (43 loc) · 978 Bytes
/
plugin.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Use and distribution licensed under the Apache license version 2.
//
// See the COPYING file in the root project directory for full text.
package kube
import (
"github.com/gdt-dev/gdt"
"github.com/gdt-dev/gdt/api"
"gopkg.in/yaml.v3"
)
var (
// DefaultTimeout is the default timeout used for each individual test
// spec. Note that gdt's top-level Scenario.Run handles all timeout and
// retry behaviour.
DefaultTimeout = "5s"
)
func init() {
gdt.RegisterPlugin(Plugin())
}
const (
pluginName = "kube"
)
type plugin struct{}
func (p *plugin) Info() api.PluginInfo {
return api.PluginInfo{
Name: pluginName,
Retry: &api.Retry{
Exponential: true,
},
Timeout: &api.Timeout{
After: DefaultTimeout,
},
}
}
func (p *plugin) Defaults() yaml.Unmarshaler {
return &Defaults{}
}
func (p *plugin) Specs() []api.Evaluable {
return []api.Evaluable{&Spec{}}
}
// Plugin returns the Kubernetes gdt plugin
func Plugin() api.Plugin {
return &plugin{}
}