-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployer.go
168 lines (145 loc) · 6.85 KB
/
deployer.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
package api
import (
"context"
)
type Deployer interface {
GetLocation(ctx context.Context, m *Empty) (*LocationItem, error)
IsDomainActive(ctx context.Context, m *DeployerIsDomainActive) (bool, error)
GetCommands(ctx context.Context, m *Empty) (*GetCommandsResult, error)
SetResults(ctx context.Context, m *DeployerSetResult) (*Empty, error)
}
type DeployerIsDomainActive struct {
Domain string `json:"domain"`
}
type GetCommandsResult []*DeployerCommandItem
type DeployerCommandItem struct {
PullSecretCreate *DeployerCommandPullSecretCreate `json:"pullSecretCreate,omitempty"`
PullSecretDelete *DeployerCommandMetadata `json:"pullSecretDelete,omitempty"`
WorkloadIdentityCreate *DeployerCommandWorkloadIdentityCreate `json:"workloadIdentityCreate,omitempty"`
WorkloadIdentityDelete *DeployerCommandMetadata `json:"workloadIdentityDelete,omitempty"`
DiskCreate *DeployerCommandDiskCreate `json:"diskCreate,omitempty"`
DiskDelete *DeployerCommandMetadata `json:"diskDelete,omitempty"`
DeploymentDeploy *DeployerCommandDeploymentDeploy `json:"deploymentDeploy,omitempty"`
DeploymentDelete *DeployerCommandDeploymentMetadata `json:"deploymentDelete,omitempty"`
DeploymentPause *DeployerCommandDeploymentMetadata `json:"deploymentPause,omitempty"`
DeploymentCleanup *DeployerCommandDeploymentMetadata `json:"deploymentCleanup,omitempty"`
RouteCreate *DeployerCommandRouteCreate `json:"routeCreate,omitempty"`
RouteDelete *DeployerCommandRouteDelete `json:"routeDelete,omitempty"`
}
type DeployerCommandMetadata struct {
ID int64 `json:"id"`
ProjectID int64 `json:"projectId"`
Name string `json:"name"`
}
type DeployerCommandPullSecretCreate struct {
ID int64 `json:"id"`
ProjectID int64 `json:"projectId"`
Name string `json:"name"`
Value string `json:"value"`
}
type DeployerCommandWorkloadIdentityCreate struct {
ID int64 `json:"id"`
ProjectID int64 `json:"projectId"`
Name string `json:"name"`
GSA string `json:"gsa"`
}
type DeployerCommandDiskCreate struct {
ID int64 `json:"id"`
ProjectID int64 `json:"projectId"`
Name string `json:"name"`
Size int64 `json:"size"`
}
type DeployerCommandDeploymentMetadata struct {
ID int64 `json:"id"`
ProjectID int64 `json:"projectId"`
Name string `json:"name"`
Revision int64 `json:"revision"`
Type DeploymentType `json:"type"`
}
type DeployerCommandDeploymentDeploy struct {
ID int64 `json:"id"`
ProjectID int64 `json:"projectId"`
Name string `json:"name"`
Revision int64 `json:"revision"`
Type DeploymentType `json:"type"`
BillingConfig DeployerCommandDeploymentDeployBillingConfig `json:"config"`
Spec DeployerCommandDeploymentDeploySpec `json:"spec"`
}
type DeployerCommandDeploymentDeployBillingConfig struct {
Pool string `json:"pool"`
SharePool bool `json:"sharePool"`
ForceSpot bool `json:"forceSpot"`
}
type DeployerCommandDeploymentDeploySpec struct {
Image string `json:"image"`
Env map[string]string `json:"env"`
Command []string `json:"command"`
Args []string `json:"args"`
WorkloadIdentityName string `json:"workloadIdentityName"`
MinReplicas int `json:"minReplicas"`
MaxReplicas int `json:"maxReplicas"`
Port int `json:"port"`
Protocol DeploymentProtocol `json:"protocol"`
Internal bool `json:"internal"`
Schedule string `json:"schedule"`
Annotations map[string]string `json:"annotations"`
CPU string `json:"cpu"`
CPULimit string `json:"cpuLimit"`
Memory string `json:"memory"`
PullSecretName string `json:"pullSecretName"`
DiskName string `json:"diskName"`
DiskMountPath string `json:"diskMountPath"`
DiskSubPath string `json:"diskSubPath"`
MountData map[string]string `json:"mountData"` // file path => data
Sidecars []*Sidecar `json:"sidecars"`
HealthCheck DeploymentHealthCheck `json:"healthCheck"`
}
type DeploymentHealthCheck struct {
TCPSocket *TCPSocketAction `json:"tcpSocket"`
HTTPGet *HTTPGetAction `json:"httpGet"`
}
type TCPSocketAction struct{}
type HTTPGetAction struct {
Path string `json:"path"`
}
type DeployerCommandRouteCreate struct {
ID int64 `json:"id"`
ProjectID int64 `json:"projectId"`
Domain string `json:"domain"`
Path string `json:"path"`
Target string `json:"target"`
Config RouteConfig `json:"config"`
}
type DeployerCommandRouteDelete struct {
ID int64 `json:"id"`
ProjectID int64 `json:"projectId"`
Domain string `json:"domain"`
}
type DeployerSetResult []*DeployerSetResultItem
type DeployerSetResultItem struct {
PullSecretCreate *DeployerSetResultItemGeneral `json:"pullSecretCreate,omitempty"`
PullSecretDelete *DeployerSetResultItemGeneral `json:"pullSecretDelete,omitempty"`
WorkloadIdentityCreate *DeployerSetResultItemGeneral `json:"workloadIdentityCreate,omitempty"`
WorkloadIdentityDelete *DeployerSetResultItemGeneral `json:"workloadIdentityDelete,omitempty"`
DiskCreate *DeployerSetResultItemGeneral `json:"diskCreate,omitempty"`
DiskDelete *DeployerSetResultItemGeneral `json:"diskDelete,omitempty"`
DeploymentDeploy *DeployerSetResultItemDeploy `json:"deploymentDeploy,omitempty"`
DeploymentDelete *DeployerSetResultItemGeneral `json:"deploymentDelete,omitempty"`
DeploymentPause *DeployerSetResultItemDeployment `json:"deploymentPause,omitempty"`
DeploymentCleanup *DeployerSetResultItemDeployment `json:"deploymentCleanup,omitempty"`
RouteCreate *DeployerSetResultItemGeneral `json:"routeCreate,omitempty"`
RouteDelete *DeployerSetResultItemGeneral `json:"routeDelete,omitempty"`
}
type DeployerSetResultItemGeneral struct {
ID int64 `json:"id"`
}
type DeployerSetResultItemDeploy struct {
ID int64 `json:"id"`
Revision int64 `json:"revision"`
Success bool `json:"success"`
NodePort *int `json:"nodePort,omitempty"`
}
type DeployerSetResultItemDeployment struct {
ID int64 `json:"id"`
Revision int64 `json:"revision"`
}