Skip to content

Commit 9e75585

Browse files
Add maintenanceGroup and argoInstance fields (#107)
1 parent ce71c64 commit 9e75585

File tree

13 files changed

+163
-67
lines changed

13 files changed

+163
-67
lines changed

config/crd/bases/registry.ethos.adobe.com_clusters.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ spec:
7474
- certificateAuthorityData
7575
- endpoint
7676
type: object
77+
argoInstance:
78+
description: The corresponding Argo instance of the cluster
79+
type: string
7780
availabilityZones:
7881
description: AvailabilityZones cluster availability zones
7982
items:
@@ -171,6 +174,9 @@ spec:
171174
lastUpdated:
172175
description: Timestamp when cluster information was updated
173176
type: string
177+
maintenanceGroup:
178+
description: Cluster maintenance group
179+
type: string
174180
managingOrg:
175181
description: The Org that is responsible for the cluster operations
176182
type: string
@@ -322,13 +328,15 @@ spec:
322328
required:
323329
- accountId
324330
- apiServer
331+
- argoInstance
325332
- businessUnit
326333
- chargebackBusinessUnit
327334
- chargedBack
328335
- cloudProviderRegion
329336
- cloudType
330337
- environment
331338
- lastUpdated
339+
- maintenanceGroup
332340
- managingOrg
333341
- name
334342
- offering

local/client/dummy-crd.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ spec:
99
apiServer:
1010
endpoint: https://cluster01-local-useast1.example.com
1111
certificateAuthorityData: LS0tLS1CRUdJTiBDRVJUSUZJ==
12+
argoInstance: argocd-local-gen-01.cluster01-local-useast1.example.com
1213
region: useast1
1314
cloudType: azure
1415
cloudProviderRegion: useast1
@@ -88,6 +89,7 @@ spec:
8889
ownerID: ownerxxx
8990
registeredAt: "2021-12-13T05:50:07.492Z"
9091
lastUpdated: "2021-12-13T05:50:07.492Z"
92+
maintenanceGroup: A
9193
managingOrg: Ethos
9294
capacity:
9395
clusterCapacity: 50

local/database/dummy-data.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
apiServer:
1010
endpoint: https://cluster01-prod-useast1.example.com
1111
certificateAuthorityData: LS0tLS1CRUdJTiBDRVJUSUZJ==
12+
argoInstance: argocd-prod-gen-01.cluster01-prod-useast1.example.com
1213
region: useast1
1314
cloudType: azure
1415
cloudProviderRegion: useast1
@@ -84,6 +85,7 @@
8485
ownerID: ownerxxx
8586
registeredAt: "2021-12-13T05:50:07.492Z"
8687
lastUpdated: "2021-12-13T05:50:07.492Z"
88+
maintenanceGroup: B
8789
managingOrg: Ethos
8890
capacity:
8991
clusterCapacity: 50
@@ -117,13 +119,15 @@
117119
apiServer:
118120
endpoint: https://cluster02-prod-euwest1.example.com
119121
certificateAuthorityData: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0==
122+
argoInstance: argocd-prod-gen-02.cluster02-prod-euwest1.example.com
120123
region: euwest1
121124
cloudType: azure
122125
cloudProviderRegion: euwest1
123126
environment: Prod
124127
type: Dedicated
125128
businessUnit: BU2
126129
chargebackBusinessUnit: BU2
130+
chargedBack: true
127131
offering:
128132
- CaaS
129133
- PaaS
@@ -168,6 +172,7 @@
168172
- 10.3.0.0/24
169173
registeredAt: "2019-02-10T06:15:32Z"
170174
lastUpdated: "2020-02-10T06:15:32Z"
175+
maintenanceGroup: A
171176
managingOrg: Ethos
172177
capacity:
173178
clusterCapacity: 50
@@ -202,13 +207,15 @@
202207
apiServer:
203208
endpoint: https://cluster03-prod-uswest1.example.com
204209
certificateAuthorityData: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS==
210+
argoInstance: argocd-prod-gen-03.cluster03-prod-uswest1.example.com
205211
region: uswest1
206212
cloudType: aws
207213
cloudProviderRegion: uswest1
208214
environment: Prod
209215
type: Dedicated
210216
businessUnit: BU1
211217
chargebackBusinessUnit: BU1
218+
chargedBack: true
212219
offering:
213220
- PaaS
214221
allowedTeams:
@@ -262,6 +269,7 @@
262269
- 10.0.22.0/8
263270
registeredAt: "2020-03-19T07:55:46.132Z"
264271
lastUpdated: "2020-03-20T07:55:46.132Z"
272+
maintenanceGroup: C
265273
managingOrg: Ethos
266274
capacity:
267275
clusterCapacity: 30

pkg/api/registry/v1/cluster_types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ type ClusterSpec struct {
9797
// +kubebuilder:validation:Enum=Building;Testing;Running;Upgrading
9898
Phase string `json:"phase"`
9999

100+
// Cluster maintenance group
101+
// +kubebuilder:validation:Required
102+
MaintenanceGroup string `json:"maintenanceGroup"`
103+
104+
// The corresponding Argo instance of the cluster
105+
// +kubebuilder:validation:Required
106+
ArgoInstance string `json:"argoInstance"`
107+
100108
// The type of the cluster
101109
Type string `json:"type,omitempty"`
102110

pkg/apiserver/docs/docs.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,10 @@ const docTemplate = `{
515515
}
516516
]
517517
},
518+
"argoInstance": {
519+
"description": "The corresponding Argo instance of the cluster\n+kubebuilder:validation:Required",
520+
"type": "string"
521+
},
518522
"availabilityZones": {
519523
"description": "AvailabilityZones cluster availability zones",
520524
"type": "array",
@@ -573,6 +577,10 @@ const docTemplate = `{
573577
"description": "Timestamp when cluster information was updated",
574578
"type": "string"
575579
},
580+
"maintenanceGroup": {
581+
"description": "Cluster maintenance group\n+kubebuilder:validation:Required",
582+
"type": "string"
583+
},
576584
"managingOrg": {
577585
"description": "The Org that is responsible for the cluster operations\n+kubebuilder:validation:Required",
578586
"type": "string"

pkg/apiserver/docs/swagger.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,10 @@
513513
}
514514
]
515515
},
516+
"argoInstance": {
517+
"description": "The corresponding Argo instance of the cluster\n+kubebuilder:validation:Required",
518+
"type": "string"
519+
},
516520
"availabilityZones": {
517521
"description": "AvailabilityZones cluster availability zones",
518522
"type": "array",
@@ -571,6 +575,10 @@
571575
"description": "Timestamp when cluster information was updated",
572576
"type": "string"
573577
},
578+
"maintenanceGroup": {
579+
"description": "Cluster maintenance group\n+kubebuilder:validation:Required",
580+
"type": "string"
581+
},
574582
"managingOrg": {
575583
"description": "The Org that is responsible for the cluster operations\n+kubebuilder:validation:Required",
576584
"type": "string"

pkg/apiserver/docs/swagger.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ definitions:
6464
description: |-
6565
Information about K8s API endpoint and CA cert
6666
+kubebuilder:validation:Required
67+
argoInstance:
68+
description: |-
69+
The corresponding Argo instance of the cluster
70+
+kubebuilder:validation:Required
71+
type: string
6772
availabilityZones:
6873
description: AvailabilityZones cluster availability zones
6974
items:
@@ -115,6 +120,11 @@ definitions:
115120
lastUpdated:
116121
description: Timestamp when cluster information was updated
117122
type: string
123+
maintenanceGroup:
124+
description: |-
125+
Cluster maintenance group
126+
+kubebuilder:validation:Required
127+
type: string
118128
managingOrg:
119129
description: |-
120130
The Org that is responsible for the cluster operations

pkg/client/controllers/cluster_controller_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ var _ = Describe("Cluster Controller", func() {
6969
Name: "cluster01-prod-useast1",
7070
ShortName: "cluster01produseast1",
7171
APIServer: registryv1.APIServer{Endpoint: "", CertificateAuthorityData: ""},
72+
ArgoInstance: "argocd-prod-gen-01.cluster01-prod-useast1.example.com",
7273
Region: "useast1",
7374
CloudType: "Azure",
7475
Environment: "Prod",
@@ -83,6 +84,7 @@ var _ = Describe("Cluster Controller", func() {
8384
Status: "Active",
8485
Phase: "Running",
8586
Type: "Shared",
87+
MaintenanceGroup: "B",
8688
Extra: registryv1.Extra{
8789
DomainName: "",
8890
LbEndpoints: map[string]string{},

pkg/client/webhook/webhook_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ var _ = Describe("Webhook Server", func() {
184184
Name: "cluster01-prod-useast1",
185185
ShortName: "cluster01produseast1",
186186
APIServer: registryv1.APIServer{Endpoint: "", CertificateAuthorityData: ""},
187+
ArgoInstance: "argocd-prod-gen-01.cluster01-prod-useast1.example.com",
187188
Region: "useast1",
188189
CloudType: "Azure",
189190
Environment: "Prod",
@@ -198,6 +199,7 @@ var _ = Describe("Webhook Server", func() {
198199
Status: "Active",
199200
Phase: "Running",
200201
Type: "Shared",
202+
MaintenanceGroup: "B",
201203
Extra: registryv1.Extra{
202204
DomainName: "",
203205
LbEndpoints: map[string]string{},

0 commit comments

Comments
 (0)