-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
3,204 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/configuration-chainsaw-v1alpha1.json | ||
apiVersion: chainsaw.kyverno.io/v1alpha1 | ||
kind: Configuration | ||
metadata: | ||
creationTimestamp: null | ||
name: configuration | ||
spec: | ||
timeouts: | ||
apply: 30s | ||
assert: 60s | ||
cleanup: 15s | ||
delete: 30s | ||
error: 30s | ||
exec: 30s | ||
skipDelete: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,292 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json | ||
apiVersion: chainsaw.kyverno.io/v1alpha1 | ||
kind: Test | ||
metadata: | ||
creationTimestamp: null | ||
name: provider-ceph | ||
spec: | ||
steps: | ||
|
||
- name: Assert that Crossplane has been installed. | ||
try: | ||
- assert: | ||
resource: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: crossplane | ||
namespace: crossplane-system | ||
status: | ||
readyReplicas: 1 | ||
- assert: | ||
resource: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: crossplane-rbac-manager | ||
namespace: crossplane-system | ||
status: | ||
readyReplicas: 1 | ||
- assert: | ||
resource: | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: providerconfigs.ceph.crossplane.io | ||
|
||
- name: Apply Localstack PCs. Assert Deployments are available and PCs are healthy. | ||
try: | ||
- command: | ||
# We don't do this inline because we use the localstack provider config mainifest | ||
# located in the localstack directory. We do this because this mainfes is used | ||
# elsewhere and it's best to use the same one everywhere. | ||
args: | ||
- apply | ||
- -f | ||
- ../../localstack/localstack-provider-cfg.yaml | ||
entrypoint: kubectl | ||
# Assert that Localstack Deployments are available. | ||
- assert: | ||
resource: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
io.kompose.service: localstack-a | ||
name: localstack-a | ||
namespace: crossplane-system | ||
status: | ||
availableReplicas: 1 | ||
- assert: | ||
resource: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
io.kompose.service: localstack-b | ||
name: localstack-b | ||
namespace: crossplane-system | ||
status: | ||
availableReplicas: 1 | ||
- assert: | ||
resource: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
io.kompose.service: localstack-c | ||
name: localstack-c | ||
namespace: crossplane-system | ||
status: | ||
availableReplicas: 1 | ||
|
||
- name: Make localstack-a unreachable and therefore Unhealthy. | ||
try: | ||
- command: | ||
args: | ||
- patch | ||
- service | ||
- localstack-a | ||
- -n | ||
- crossplane-system | ||
- --type=merge | ||
- -p | ||
- '{"spec":{"selector":{"io.kompose.service":"not-exists"}}}' | ||
entrypoint: kubectl | ||
- assert: | ||
resource: | ||
apiVersion: ceph.crossplane.io/v1alpha1 | ||
kind: ProviderConfig | ||
metadata: | ||
name: localstack-a | ||
status: | ||
conditions: | ||
- reason: HealthCheckFail | ||
status: "False" | ||
type: Ready | ||
|
||
- name: Make localstack-b unreachable and therefore Unhealthy. | ||
try: | ||
- command: | ||
args: | ||
- patch | ||
- service | ||
- localstack-b | ||
- -n | ||
- crossplane-system | ||
- --type=merge | ||
- -p | ||
- '{"spec":{"selector":{"io.kompose.service":"not-exists"}}}' | ||
entrypoint: kubectl | ||
- assert: | ||
resource: | ||
apiVersion: ceph.crossplane.io/v1alpha1 | ||
kind: ProviderConfig | ||
metadata: | ||
name: localstack-b | ||
status: | ||
conditions: | ||
- reason: HealthCheckFail | ||
status: "False" | ||
type: Ready | ||
|
||
- name: Make localstack-c unreachable and therefore Unhealthy. | ||
try: | ||
- command: | ||
args: | ||
- patch | ||
- service | ||
- localstack-c | ||
- -n | ||
- crossplane-system | ||
- --type=merge | ||
- -p | ||
- '{"spec":{"selector":{"io.kompose.service":"not-exists"}}}' | ||
entrypoint: kubectl | ||
- assert: | ||
resource: | ||
apiVersion: ceph.crossplane.io/v1alpha1 | ||
kind: ProviderConfig | ||
metadata: | ||
name: localstack-c | ||
status: | ||
conditions: | ||
- reason: HealthCheckFail | ||
status: "False" | ||
type: Ready | ||
|
||
- name: Apply auto-pause-bucket. | ||
try: | ||
- apply: | ||
resource: | ||
apiVersion: provider-ceph.ceph.crossplane.io/v1alpha1 | ||
kind: Bucket | ||
metadata: | ||
name: auto-pause-bucket | ||
labels: | ||
provider-ceph.crossplane.io/validation-required: "true" | ||
spec: | ||
autoPause: true | ||
forProvider: {} | ||
|
||
# Assert auto-pause-bucket has failed. | ||
- assert: | ||
resource: | ||
apiVersion: provider-ceph.ceph.crossplane.io/v1alpha1 | ||
kind: Bucket | ||
metadata: | ||
name: auto-pause-bucket | ||
status: | ||
conditions: | ||
- reason: Creating | ||
status: "False" | ||
type: Ready | ||
- reason: ReconcileError | ||
status: "False" | ||
type: Synced | ||
|
||
- name: Remove creation-failed annotation from auto-pause-bucket. | ||
try: | ||
- command: | ||
args: | ||
- patch | ||
- bucket | ||
- auto-pause-bucket | ||
- --type=json | ||
- -p | ||
- '[{"op": "remove", "path": "/metadata/annotations/crossplane.io~1external-create-failed"}]' | ||
entrypoint: kubectl | ||
|
||
|
||
- name: Make localstack-a reachable again and therefore Healthy. | ||
try: | ||
- command: | ||
args: | ||
- patch | ||
- service | ||
- localstack-a | ||
- -n | ||
- crossplane-system | ||
- --type=merge | ||
- -p | ||
- '{"spec":{"selector":{"io.kompose.service":"localstack-a"}}}' | ||
entrypoint: kubectl | ||
- assert: | ||
resource: | ||
apiVersion: ceph.crossplane.io/v1alpha1 | ||
kind: ProviderConfig | ||
metadata: | ||
name: localstack-a | ||
status: | ||
conditions: | ||
- reason: HealthCheckSuccess | ||
status: "True" | ||
type: Ready | ||
|
||
- name: Make localstack-b reachable again and therefore Healthy. | ||
try: | ||
- command: | ||
args: | ||
- patch | ||
- service | ||
- localstack-b | ||
- -n | ||
- crossplane-system | ||
- --type=merge | ||
- -p | ||
- '{"spec":{"selector":{"io.kompose.service":"localstack-b"}}}' | ||
entrypoint: kubectl | ||
- assert: | ||
resource: | ||
apiVersion: ceph.crossplane.io/v1alpha1 | ||
kind: ProviderConfig | ||
metadata: | ||
name: localstack-b | ||
status: | ||
conditions: | ||
- reason: HealthCheckSuccess | ||
status: "True" | ||
type: Ready | ||
|
||
- name: Make localstack-c reachable again and therefore Healthy. | ||
try: | ||
- command: | ||
args: | ||
- patch | ||
- service | ||
- localstack-c | ||
- -n | ||
- crossplane-system | ||
- --type=merge | ||
- -p | ||
- '{"spec":{"selector":{"io.kompose.service":"localstack-c"}}}' | ||
entrypoint: kubectl | ||
- assert: | ||
resource: | ||
apiVersion: ceph.crossplane.io/v1alpha1 | ||
kind: ProviderConfig | ||
metadata: | ||
name: localstack-c | ||
status: | ||
conditions: | ||
- reason: HealthCheckSuccess | ||
status: "True" | ||
type: Ready | ||
|
||
- name: Apply auto-pause-bucket. | ||
try: | ||
# Assert auto-pause-bucket has been created successfully. | ||
- assert: | ||
resource: | ||
apiVersion: provider-ceph.ceph.crossplane.io/v1alpha1 | ||
kind: Bucket | ||
metadata: | ||
name: auto-pause-bucket | ||
status: | ||
conditions: | ||
- reason: Available | ||
status: "True" | ||
type: Ready | ||
- reason: ReconcileSuccess | ||
status: "True" | ||
type: Synced |
Oops, something went wrong.