-
Notifications
You must be signed in to change notification settings - Fork 88
/
types.go
58 lines (48 loc) · 1.29 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
package types
import (
"path"
kotsscheme "github.com/replicatedhq/kots/kotskinds/client/kotsclientset/scheme"
"k8s.io/client-go/kubernetes/scheme"
)
func init() {
kotsscheme.AddToScheme(scheme.Scheme)
}
type UpstreamFile struct {
Path string
Content []byte
}
type Upstream struct {
URI string
Name string
Type string
Files []UpstreamFile
UpdateCursor string
ChannelName string
VersionLabel string
ReleaseNotes string
EncryptionKey string
}
type WriteOptions struct {
RootDir string
CreateAppDir bool
IncludeAdminConsole bool
// This should be set to true when updating due to license sync, config update, registry settings update.
// and should be false when it's an upstream update.
// When true, the channel name in Installation yaml will not be changed.
PreserveInstallation bool
SharedPassword string
}
func (u *Upstream) GetUpstreamDir(options WriteOptions) string {
renderDir := options.RootDir
if options.CreateAppDir {
renderDir = path.Join(renderDir, u.Name)
}
return path.Join(renderDir, "upstream")
}
func (u *Upstream) GetBaseDir(options WriteOptions) string {
renderDir := options.RootDir
if options.CreateAppDir {
renderDir = path.Join(renderDir, u.Name)
}
return path.Join(renderDir, "base")
}