@@ -29,6 +29,10 @@ type Cluster struct {
29
29
ClusterId string `json:"clusterId"`
30
30
CreateId string `json:"createId"`
31
31
32
+ // What version is the user running?
33
+ Version string `json:"version"`
34
+ GitCommit string `json:"gitCommit"`
35
+
32
36
// The rest of these fields must be populated by the client on POST.
33
37
//String Format: 2006-01-02T15:04:05.000Z Test string: 2021-11-12T11:45:26.371Z
34
38
Timestamp string `json:"timestamp"`
@@ -42,6 +46,8 @@ type Cluster struct {
42
46
DefaultNodepoolOS string `json:"defaultNodepoolOS"`
43
47
PrivateEndpoint bool `json:"privateEndpoint"`
44
48
EnableConfigSync bool `json:"enableConfigSync"`
49
+ AnthosServiceMesh bool `json:"anthosServiceMesh"`
50
+ MultiClusterGateway bool `json:"multiClusterGateway"`
45
51
EnablePolicyController bool `json:"enablePolicyController"`
46
52
VPCType string `json:"vpcType"`
47
53
@@ -175,9 +181,11 @@ func initCloudSQL() (*app, error) {
175
181
}
176
182
177
183
tableCreate := `
178
- CREATE TABLE IF NOT EXISTS CLUSTERS (
184
+ CREATE TABLE IF NOT EXISTS CLUSTERS3 (
179
185
ClusterId TEXT,
180
186
CreateId TEXT,
187
+ Version TEXT,
188
+ GitCommit TEXT,
181
189
Timestamp TIMESTAMP,
182
190
OS TEXT,
183
191
TerraformState TEXT,
@@ -188,6 +196,8 @@ func initCloudSQL() (*app, error) {
188
196
PrivateEndpoint BOOL,
189
197
EnableConfigSync BOOL,
190
198
EnablePolicyController BOOL,
199
+ AnthosServiceMesh BOOL,
200
+ MultiClusterGateway BOOL,
191
201
VPCType TEXT,
192
202
ClusterIndex INTEGER,
193
203
ClusterNumNodes INTEGER,
@@ -206,9 +216,9 @@ func initCloudSQL() (*app, error) {
206
216
207
217
// Helper - writes Cluster object to Cloud SQL on localhost (via proxy)
208
218
func writeToCloudSQL (app * app , c Cluster ) error {
209
- sqlInsert := "INSERT INTO CLUSTERS (ClusterId, CreateId, Timestamp, OS, TerraformState, Region, EnableWorkloadIdentity, EnablePreemptibleNodepool, DefaultNodepoolOS, PrivateEndpoint, EnableConfigSync, EnablePolicyController, VPCType, ClusterIndex, ClusterNumNodes, ClusterMachineType, ClusterRegion, ClusterZone) VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18)"
219
+ sqlInsert := "INSERT INTO CLUSTERS3 (ClusterId, CreateId, Version, GitCommit, Timestamp, OS, TerraformState, Region, EnableWorkloadIdentity, EnablePreemptibleNodepool, DefaultNodepoolOS, PrivateEndpoint, EnableConfigSync, EnablePolicyController, AnthosServiceMesh, MultiClusterGateway, VPCType, ClusterIndex, ClusterNumNodes, ClusterMachineType, ClusterRegion, ClusterZone) VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22 )"
210
220
211
- _ , err := app .db .Exec (sqlInsert , c .ClusterId , c .CreateId , c .Timestamp , c .OS , c .TerraformState , c .Region , c .EnableWorkloadIdentity , c .EnablePreemptibleNodepool , c .DefaultNodepoolOS , c .PrivateEndpoint , c .EnableConfigSync , c .EnablePolicyController , c .VPCType , c .ClusterIndex , c .ClusterNumNodes , c .ClusterMachineType , c .ClusterRegion , c .ClusterZone )
221
+ _ , err := app .db .Exec (sqlInsert , c .ClusterId , c .CreateId , c .Version , c . GitCommit , c . Timestamp , c .OS , c .TerraformState , c .Region , c .EnableWorkloadIdentity , c .EnablePreemptibleNodepool , c .DefaultNodepoolOS , c .PrivateEndpoint , c .EnableConfigSync , c .EnablePolicyController , c . AnthosServiceMesh , c . MultiClusterGateway , c .VPCType , c .ClusterIndex , c .ClusterNumNodes , c .ClusterMachineType , c .ClusterRegion , c .ClusterZone )
212
222
213
223
if err != nil {
214
224
return fmt .Errorf ("Error on Cloud SQL Insert: %v" , err )
0 commit comments