Skip to content

Commit e909144

Browse files
committed
feat(tenant): add available classes as status fields
Signed-off-by: Oliver Bähler <[email protected]>
1 parent 581a8fe commit e909144

25 files changed

+1622
-291
lines changed

api/v1beta2/gateway_options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ import (
88
)
99

1010
type GatewayOptions struct {
11-
AllowedClasses *api.SelectionListWithDefaultSpec `json:"allowedClasses,omitempty"`
11+
AllowedClasses *api.DefaultAllowedListSpec `json:"allowedClasses,omitempty"`
1212
}

api/v1beta2/tenant_status.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ const (
1919

2020
// Returns the observed state of the Tenant.
2121
type TenantStatus struct {
22+
// Allowed Cluster Objects within Tenant
23+
TenantAvailableStatus `json:",inline"`
24+
2225
// +kubebuilder:default=Active
2326
// The operational state of the Tenant. Possible values are "Active", "Cordoned".
2427
State tenantState `json:"state"`
@@ -50,6 +53,22 @@ type TenantStatusNamespaceMetadata struct {
5053
Annotations map[string]string `json:"annotations,omitempty"`
5154
}
5255

56+
type TenantAvailableStatus struct {
57+
// Available Class Types within Tenant
58+
Classes TenantAvailableClassesStatus `json:"classes,omitempty"`
59+
}
60+
61+
type TenantAvailableClassesStatus struct {
62+
// Available Storageclasses (Only collected if any matching condition is specified)
63+
StorageClasses []string `json:"storage,omitempty"`
64+
// Available PriorityClasses
65+
PriorityClasses []string `json:"priority,omitempty"`
66+
// Available StorageClasses
67+
RuntimeClasses []string `json:"runtime,omitempty"`
68+
// Available GatewayClasses
69+
GatewayClasses []string `json:"gateway,omitempty"`
70+
}
71+
5372
func (ms *TenantStatus) GetInstance(stat *TenantStatusNamespaceItem) *TenantStatusNamespaceItem {
5473
for _, source := range ms.Spaces {
5574
if ms.instancequal(source, stat) {

api/v1beta2/zz_generated.deepcopy.go

Lines changed: 53 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/capsule/crds/capsule.clastix.io_tenants.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,13 @@ spec:
123123
can use only one of the allowed trusted registries. Optional.
124124
properties:
125125
allowed:
126+
description: Match exact elements which are allowed as class names
127+
within this tenant
126128
items:
127129
type: string
128130
type: array
129131
allowedRegex:
132+
description: Match elements by regex (DEPRECATED)
130133
type: string
131134
type: object
132135
imagePullPolicies:
@@ -151,10 +154,13 @@ spec:
151154
Optional.
152155
properties:
153156
allowed:
157+
description: Match exact elements which are allowed as class
158+
names within this tenant
154159
items:
155160
type: string
156161
type: array
157162
allowedRegex:
163+
description: Match elements by regex (DEPRECATED)
158164
type: string
159165
type: object
160166
allowedHostnames:
@@ -164,10 +170,13 @@ spec:
164170
Optional.
165171
properties:
166172
allowed:
173+
description: Match exact elements which are allowed as class
174+
names within this tenant
167175
items:
168176
type: string
169177
type: array
170178
allowedRegex:
179+
description: Match elements by regex (DEPRECATED)
171180
type: string
172181
type: object
173182
hostnameCollisionScope:
@@ -840,10 +849,13 @@ spec:
840849
can use only one of the allowed PriorityClasses. Optional.
841850
properties:
842851
allowed:
852+
description: Match exact elements which are allowed as class names
853+
within this tenant
843854
items:
844855
type: string
845856
type: array
846857
allowedRegex:
858+
description: Match elements by regex (DEPRECATED)
847859
type: string
848860
type: object
849861
resourceQuotas:
@@ -1012,10 +1024,13 @@ spec:
10121024
Optional.
10131025
properties:
10141026
allowed:
1027+
description: Match exact elements which are allowed as class names
1028+
within this tenant
10151029
items:
10161030
type: string
10171031
type: array
10181032
allowedRegex:
1033+
description: Match elements by regex (DEPRECATED)
10191034
type: string
10201035
type: object
10211036
required:
@@ -1164,10 +1179,13 @@ spec:
11641179
can use only one of the allowed trusted registries. Optional.
11651180
properties:
11661181
allowed:
1182+
description: Match exact elements which are allowed as class names
1183+
within this tenant
11671184
items:
11681185
type: string
11691186
type: array
11701187
allowedRegex:
1188+
description: Match elements by regex (DEPRECATED)
11711189
type: string
11721190
type: object
11731191
cordoned:
@@ -1191,6 +1209,15 @@ spec:
11911209
properties:
11921210
allowedClasses:
11931211
properties:
1212+
allowed:
1213+
description: Match exact elements which are allowed as class
1214+
names within this tenant
1215+
items:
1216+
type: string
1217+
type: array
1218+
allowedRegex:
1219+
description: Match elements by regex (DEPRECATED)
1220+
type: string
11941221
default:
11951222
type: string
11961223
matchExpressions:
@@ -1264,10 +1291,13 @@ spec:
12641291
Optional.
12651292
properties:
12661293
allowed:
1294+
description: Match exact elements which are allowed as class
1295+
names within this tenant
12671296
items:
12681297
type: string
12691298
type: array
12701299
allowedRegex:
1300+
description: Match elements by regex (DEPRECATED)
12711301
type: string
12721302
default:
12731303
type: string
@@ -1321,10 +1351,13 @@ spec:
13211351
Optional.
13221352
properties:
13231353
allowed:
1354+
description: Match exact elements which are allowed as class
1355+
names within this tenant
13241356
items:
13251357
type: string
13261358
type: array
13271359
allowedRegex:
1360+
description: Match elements by regex (DEPRECATED)
13281361
type: string
13291362
type: object
13301363
hostnameCollisionScope:
@@ -2139,10 +2172,13 @@ spec:
21392172
Optional.
21402173
properties:
21412174
allowed:
2175+
description: Match exact elements which are allowed as class names
2176+
within this tenant
21422177
items:
21432178
type: string
21442179
type: array
21452180
allowedRegex:
2181+
description: Match elements by regex (DEPRECATED)
21462182
type: string
21472183
default:
21482184
type: string
@@ -2283,10 +2319,13 @@ spec:
22832319
Optional.
22842320
properties:
22852321
allowed:
2322+
description: Match exact elements which are allowed as class names
2323+
within this tenant
22862324
items:
22872325
type: string
22882326
type: array
22892327
allowedRegex:
2328+
description: Match elements by regex (DEPRECATED)
22902329
type: string
22912330
default:
22922331
type: string
@@ -2413,10 +2452,13 @@ spec:
24132452
Optional.
24142453
properties:
24152454
allowed:
2455+
description: Match exact elements which are allowed as class names
2456+
within this tenant
24162457
items:
24172458
type: string
24182459
type: array
24192460
allowedRegex:
2461+
description: Match elements by regex (DEPRECATED)
24202462
type: string
24212463
default:
24222464
type: string
@@ -2467,6 +2509,31 @@ spec:
24672509
status:
24682510
description: Returns the observed state of the Tenant.
24692511
properties:
2512+
classes:
2513+
description: Available Class Types within Tenant
2514+
properties:
2515+
gateway:
2516+
description: Available GatewayClasses
2517+
items:
2518+
type: string
2519+
type: array
2520+
priority:
2521+
description: Available PriorityClasses
2522+
items:
2523+
type: string
2524+
type: array
2525+
runtime:
2526+
description: Available StorageClasses
2527+
items:
2528+
type: string
2529+
type: array
2530+
storage:
2531+
description: Available Storageclasses (Only collected if any matching
2532+
condition is specified)
2533+
items:
2534+
type: string
2535+
type: array
2536+
type: object
24702537
conditions:
24712538
description: Tenant Condition
24722539
items:

0 commit comments

Comments
 (0)