This repository was archived by the owner on Jun 15, 2021. It is now read-only.
forked from kubernetes-retired/kube-aws
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.go
103 lines (79 loc) · 3.23 KB
/
types.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
package provisioner
// RemoteFileSpec represents a file that is restored on remote nodes
type RemoteFileSpec struct {
Path string `yaml:"path"`
// Content is the content of this file
// Either Content or Source can be specified
Content Content `yaml:"content,omitempty"`
// Template is the template for the content of this file
// that exists for backward-compatibility with CustomFile
Template string `yaml:"template,omitempty"`
// Permissions is the desired file mode of the file at `Path`, that looks like 0755
//
// kube-aws runs chmod on the file towards the desired file mode.
//
// This is optional. When omitted, kube-aws doesn't run chmod
Permissions uint `yaml:"permissions"`
// Source specifies how and from where the content of this file is loaded
// Either Content or Source can be specified
Source `yaml:"source"`
// Type, when specified to binary, omits diff for this file
Type string `yaml:"type"`
// CachePath specifies where this file should be cached locally
CachePath string
}
// RemoteFile is an instantiation of RemoteFileSpec
type RemoteFile struct {
Path string `yaml:"path"`
// Content is the content of this file
// Either Content or Source can be specified
Content Content `yaml:"content,omitempty"`
// Permissions is the desired file mode of the file at `Path`, that looks like 0755
//
// kube-aws runs chmod on the file towards the desired file mode.
//
// This is optional. When omitted, kube-aws doesn't run chmod
Permissions uint `yaml:"permissions"`
// Type and Encrypted affects how kube-aws handles the file in transfer and decryption
// Type, when specified to binary, omits diff for this file
Type string `yaml:"type"`
// Encrypted should be set to true when the content is encrypted with AWS KMS
Encrypted bool `yaml:"encrypted"`
}
type Source struct {
// Path is from where kube-aws loads the content of this `RemoteFileSpec`.
Path string `yaml:"path"`
// URL, when specified, instruct kube-aws to download the resource into `Path`.
URL string `yaml:"url"`
// Cert is the name of the keypair from which load the x509 cert
Cert string `yaml:"cert"`
// Cert is the name of the keypair from which load the x509 key
Key string `yaml:"key"`
}
type Content struct {
bytes []byte
str string
}
// TarGzArchiver is a archived bundle.
// TarGzArchiver is created, transferred, and then extracted to the etcd, controller and worker nodes to provide
// necessary files for node provisioning.
type TarGzArchiver struct {
File RemoteFileSpec `yaml:",inline"`
// Bundle is a set of files necessary for node provisioning, that is composed of multiple source files
Bundle []RemoteFileSpec `yaml:"files"`
}
type TransferredFile struct {
RemoteFileSpec
s3DirURI string
}
type Provisioner struct {
// Name is the name of the provisioner
Name string `yaml:"name"`
// EntrypointLocalPath is an executable file that is executed on the node after the bundle is transferred.
// EntrypointLocalPath can either be one of bundled files that are transferred, or an already existing file on the remote node.
EntrypointLocalPath string `yaml:"entrypoint"`
// Bundle is the bundle the provisioner uses to provision nodes
Bundle []RemoteFileSpec `yaml:"bundle,inline"`
S3DirURI string
LocalCacheDir string
}