forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
raw_manifest.go
105 lines (100 loc) · 3.5 KB
/
raw_manifest.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
104
105
package manifest
type rawManifest struct {
Applications []Application `yaml:"applications"`
GlobalBuildpack interface{} `yaml:"buildpack"`
GlobalCommand interface{} `yaml:"command"`
GlobalDiskQuota interface{} `yaml:"disk_quota"`
GlobalDocker interface{} `yaml:"docker"`
GlobalDomain interface{} `yaml:"domain"`
GlobalDomains interface{} `yaml:"domains"`
GlobalEnv interface{} `yaml:"env"`
GlobalHealthCheckHTTPEndpoint interface{} `yaml:"health-check-http-endpoint"`
GlobalHealthCheckTimeout interface{} `yaml:"timeout"`
GlobalHealthCheckType interface{} `yaml:"health-check-type"`
GlobalHost interface{} `yaml:"host"`
GlobalHosts interface{} `yaml:"hosts"`
GlobalInstances interface{} `yaml:"instances"`
GlobalMemory interface{} `yaml:"memory"`
GlobalName interface{} `yaml:"name"`
GlobalNoHostname interface{} `yaml:"no-hostname"`
GlobalNoRoute interface{} `yaml:"no-route"`
GlobalPath interface{} `yaml:"path"`
GlobalRandomRoute interface{} `yaml:"random-route"`
GlobalRoutes interface{} `yaml:"routes"`
GlobalServices interface{} `yaml:"services"`
GlobalStack interface{} `yaml:"stack"`
Inherit interface{} `yaml:"inherit"`
}
func (raw rawManifest) containsInheritanceField() bool {
return raw.Inherit != nil
}
func (raw rawManifest) containsGlobalFields() []string {
globalFields := []string{}
if raw.GlobalBuildpack != nil {
globalFields = append(globalFields, "buildpack")
}
if raw.GlobalCommand != nil {
globalFields = append(globalFields, "command")
}
if raw.GlobalDiskQuota != nil {
globalFields = append(globalFields, "disk_quota")
}
if raw.GlobalDocker != nil {
globalFields = append(globalFields, "docker")
}
if raw.GlobalDomain != nil {
globalFields = append(globalFields, "domain")
}
if raw.GlobalDomains != nil {
globalFields = append(globalFields, "domains")
}
if raw.GlobalEnv != nil {
globalFields = append(globalFields, "env")
}
if raw.GlobalHealthCheckHTTPEndpoint != nil {
globalFields = append(globalFields, "health-check-http-endpoint")
}
if raw.GlobalHealthCheckTimeout != nil {
globalFields = append(globalFields, "timeout")
}
if raw.GlobalHealthCheckType != nil {
globalFields = append(globalFields, "health-check-type")
}
if raw.GlobalHost != nil {
globalFields = append(globalFields, "host")
}
if raw.GlobalHosts != nil {
globalFields = append(globalFields, "hosts")
}
if raw.GlobalInstances != nil {
globalFields = append(globalFields, "instances")
}
if raw.GlobalMemory != nil {
globalFields = append(globalFields, "memory")
}
if raw.GlobalName != nil {
globalFields = append(globalFields, "name")
}
if raw.GlobalNoHostname != nil {
globalFields = append(globalFields, "no-hostname")
}
if raw.GlobalNoRoute != nil {
globalFields = append(globalFields, "no-route")
}
if raw.GlobalPath != nil {
globalFields = append(globalFields, "path")
}
if raw.GlobalRandomRoute != nil {
globalFields = append(globalFields, "random-route")
}
if raw.GlobalRoutes != nil {
globalFields = append(globalFields, "routes")
}
if raw.GlobalServices != nil {
globalFields = append(globalFields, "services")
}
if raw.GlobalStack != nil {
globalFields = append(globalFields, "stack")
}
return globalFields
}