-
Notifications
You must be signed in to change notification settings - Fork 6
/
config.go
57 lines (48 loc) · 1.93 KB
/
config.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
54
55
56
57
package podman
import (
"time"
"github.com/docker/docker/api/types/container"
)
type Config struct {
Podman Podman `json:"podman"`
Deployment Deployment `json:"deployment"`
Timeouts Timeouts `json:"timeouts"`
}
// Validate checks the configuration structure for conformance with the schema.
func (c *Config) Validate() error {
return Schema.ValidateType(c)
}
// ImagePullPolicy drives when an image should be pulled.
type ImagePullPolicy string
const (
// ImagePullPolicyAlways means that the container image will be pulled for every workflow run.
ImagePullPolicyAlways ImagePullPolicy = "Always"
// ImagePullPolicyIfNotPresent means the image will be pulled if the image is not present locally, an empty tag, or
// the "latest" tag was specified.
ImagePullPolicyIfNotPresent ImagePullPolicy = "IfNotPresent"
// ImagePullPolicyNever means that the image will never be pulled, and if the image is not available locally the
// execution will fail.
ImagePullPolicyNever ImagePullPolicy = "Never"
)
type Podman struct {
Path string `json:"path"`
// Constant prefix prepended to the randomized container name string.
ContainerNamePrefix string `json:"containerNamePrefix"`
// The initial integer that is the starting point for a
// Random Number Generator's algorithm.
RngSeed int64 `json:"rngSeed"`
// Specify the optional --connection parameter for podman
ConnectionName *string `json:"connectionName"`
}
// Deployment contains the information about deploying the plugin.
type Deployment struct {
ContainerConfig *container.Config `json:"container"`
HostConfig *container.HostConfig `json:"host"`
ImagePullPolicy ImagePullPolicy `json:"imagePullPolicy"`
ImagePlatform *string `json:"imagePlatform"`
ConnectionName *string `json:"connectionName"`
}
// Timeouts drive the timeouts for various interactions in relation to Docker.
type Timeouts struct {
HTTP time.Duration `json:"http"`
}