-
Notifications
You must be signed in to change notification settings - Fork 474
/
app.go
99 lines (78 loc) · 2.35 KB
/
app.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
package models
type AppList struct {
// Namespace where the apps live in
// required: true
// example: bookinfo
Namespace Namespace `json:"namespace"`
// Cluster where the apps live in
// required: true
// example: east
Cluster string `json:"cluster"`
// Applications for a given namespace
// required: true
Apps []AppListItem `json:"applications"`
}
// AppListItem has the necessary information to display the console app list
type AppListItem struct {
// Name of the application
// required: true
// example: reviews
Name string `json:"name"`
// Cluster of the application
// required: true
// example: reviews
Cluster string `json:"cluster"`
// Define if all Pods related to the Workloads of this app has an IstioSidecar deployed
// required: true
// example: true
IstioSidecar bool `json:"istioSidecar"`
// Define if any pod has the Ambient annotation
// required: true
// example: true
IstioAmbient bool `json:"istioAmbient"`
// Labels for App
Labels map[string]string `json:"labels"`
// Istio References
IstioReferences []*IstioValidationKey `json:"istioReferences"`
// Health
Health AppHealth `json:"health,omitempty"`
}
type WorkloadItem struct {
// Name of a workload member of an application
// required: true
// example: reviews-v1
WorkloadName string `json:"workloadName"`
// Define if all Pods related to the Workload has an IstioSidecar deployed
// required: true
// example: true
IstioSidecar bool `json:"istioSidecar"`
// Define if belongs to a namespace labeled as ambient
// required: true
// example: true
IstioAmbient bool `json:"istioAmbient"`
// Labels for Workload
Labels map[string]string `json:"labels"`
// List of service accounts involved in this application
// required: true
ServiceAccountNames []string `json:"serviceAccountNames"`
}
type App struct {
// Namespace where the app lives in
// required: true
// example: bookinfo
Namespace Namespace `json:"namespace"`
// Name of the application
// required: true
// example: reviews
Name string `json:"name"`
// Workloads for a given application
// required: true
Workloads []WorkloadItem `json:"workloads"`
// List of service names linked with an application
// required: true
ServiceNames []string `json:"serviceNames"`
// Runtimes and associated dashboards
Runtimes []Runtime `json:"runtimes"`
// Health
Health AppHealth `json:"health"`
}