Skip to content

Commit bae438f

Browse files
committed
Tighten SwiftContainer API and e2e assertions
1 parent 1896747 commit bae438f

16 files changed

Lines changed: 18 additions & 77 deletions

File tree

api/v1alpha1/swiftcontainer_types.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,4 @@ type SwiftContainerResourceStatus struct {
178178
// +kubebuilder:validation:MaxLength=1024
179179
// +optional
180180
Versions string `json:"versions,omitempty"`
181-
182-
// quotaBytes is the quota on the maximum number of bytes that can be
183-
// stored in the container, if set.
184-
// +optional
185-
QuotaBytes *int64 `json:"quotaBytes,omitempty"`
186-
187-
// quotaCount is the quota on the maximum number of objects that can be
188-
// stored in the container, if set.
189-
// +optional
190-
QuotaCount *int64 `json:"quotaCount,omitempty"`
191181
}

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/models-schema/zz_generated.openapi.go

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/openstack.k-orc.cloud_swiftcontainers.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -385,18 +385,6 @@ spec:
385385
container.
386386
format: int64
387387
type: integer
388-
quotaBytes:
389-
description: |-
390-
quotaBytes is the quota on the maximum number of bytes that can be
391-
stored in the container, if set.
392-
format: int64
393-
type: integer
394-
quotaCount:
395-
description: |-
396-
quotaCount is the quota on the maximum number of objects that can be
397-
stored in the container, if set.
398-
format: int64
399-
type: integer
400388
storagePolicy:
401389
description: storagePolicy is the name of the storage policy assigned
402390
to the container.

internal/controllers/swiftcontainer/tests/swiftcontainer-create-full/00-assert.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ metadata:
66
status:
77
resource:
88
name: swiftcontainer-create-full-override
9+
bytesUsed: 0
10+
objectCount: 0
911
containerRead: ".r:*,.rlistings"
1012
containerWrite: "openstack:*"
13+
storagePolicy: Policy-0
1114
conditions:
1215
- type: Available
1316
status: "True"
@@ -26,9 +29,6 @@ resourceRefs:
2629
assertAll:
2730
- celExpr: "swiftcontainer.status.id != ''"
2831
- celExpr: "swiftcontainer.status.id == 'swiftcontainer-create-full-override'"
29-
- celExpr: "swiftcontainer.status.resource.name == 'swiftcontainer-create-full-override'"
30-
- celExpr: "swiftcontainer.status.resource.containerRead == '.r:*,.rlistings'"
31-
- celExpr: "swiftcontainer.status.resource.containerWrite == 'openstack:*'"
3232
- celExpr: "has(swiftcontainer.status.resource.metadata)"
3333
- celExpr: "swiftcontainer.status.resource.metadata.exists(m, m.name == 'Environment' && m.value == 'test')"
3434
- celExpr: "swiftcontainer.status.resource.metadata.exists(m, m.name == 'Owner' && m.value == 'orc-e2e')"

internal/controllers/swiftcontainer/tests/swiftcontainer-create-full/00-create-resource.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ spec:
1717
value: orc-e2e
1818
containerRead: ".r:*,.rlistings"
1919
containerWrite: "openstack:*"
20+
storagePolicy: Policy-0

internal/controllers/swiftcontainer/tests/swiftcontainer-create-full/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Validates that:
1212
`status.resource.metadata`.
1313
- Read ACL (`containerRead`) and write ACL (`containerWrite`) are configured
1414
and reflected in `status.resource`.
15+
- Storage policy (`storagePolicy`) is configured and reflected in
16+
`status.resource`.
1517
- `Available=True` and `Progressing=False` conditions are set.
1618

1719
## Reference

internal/controllers/swiftcontainer/tests/swiftcontainer-create-minimal/00-assert.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ metadata:
66
status:
77
resource:
88
name: swiftcontainer-create-minimal
9+
bytesUsed: 0
10+
objectCount: 0
911
conditions:
1012
- type: Available
1113
status: "True"

internal/controllers/swiftcontainer/tests/swiftcontainer-import/02-assert.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@ status:
3434
reason: Success
3535
resource:
3636
name: swiftcontainer-import-external
37+
bytesUsed: 0
38+
objectCount: 0

internal/controllers/swiftcontainer/tests/swiftcontainer-update/00-assert.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ metadata:
1919
status:
2020
resource:
2121
name: swiftcontainer-update
22+
bytesUsed: 0
23+
objectCount: 0
2224
conditions:
2325
- type: Available
2426
status: "True"

0 commit comments

Comments
 (0)