Skip to content

Commit

Permalink
Add e2e tests for json patches
Browse files Browse the repository at this point in the history
Signed-off-by: alexander-demicev <[email protected]>
  • Loading branch information
alexander-demicev committed Oct 23, 2023
1 parent 1c091f2 commit 52286ec
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 4 deletions.
23 changes: 19 additions & 4 deletions test/e2e/minimal_configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ data:
AdditionalManifestsRef: &operatorv1.ConfigmapReference{
Name: additionalManifests.Name,
},
ManifestPatches: []string{`apiVersion: apps/v1
kind: Deployment
metadata:
labels:
test-label: test-value`},
},
},
}
Expand All @@ -83,6 +88,15 @@ data:
Deployment: &appsv1.Deployment{ObjectMeta: metav1.ObjectMeta{Name: coreProviderDeploymentName, Namespace: operatorNamespace}},
}, e2eConfig.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers")...)

By("Checking for deployment to have additional labels")
deployment := &appsv1.Deployment{ObjectMeta: metav1.ObjectMeta{Name: coreProviderDeploymentName, Namespace: operatorNamespace}}
WaitFor(ctx, For(deployment).In(bootstrapCluster).ToSatisfy(func() bool {
if v, ok := deployment.Labels["test-label"]; ok {
return v == "test-value"
}
return false
}), e2eConfig.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers")...)

By("Waiting for core provider to be ready")
WaitFor(ctx, For(coreProvider).In(bootstrapCluster).ToSatisfy(
HaveStatusCondition(&coreProvider.Status.Conditions, operatorv1.ProviderInstalledCondition)),
Expand All @@ -94,10 +108,11 @@ data:
}), e2eConfig.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers")...)

By("Checking if additional manifests are applied")
cm := &corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{
Name: "test-config-map",
Namespace: operatorNamespace,
}}
cm := &corev1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
Name: "test-config-map",
Namespace: operatorNamespace,
}}
WaitFor(ctx, For(cm).In(bootstrapCluster).ToSatisfy(func() bool {
value, ok := cm.Data["test"]
return ok && value == "test"
Expand Down
45 changes: 45 additions & 0 deletions test/e2e/resources/full-chart-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1482,6 +1482,15 @@ spec:
type: integer
type: object
type: object
manifestPatches:
description: ManifestPatches are applied to rendered provider manifests
to customize the provider manifests. Patches are applied in the
order they are specified. The `kind` field must match the target
object, and if `apiVersion` is specified it will only be applied
to matching objects. This should be an inline yaml blob-string https://datatracker.ietf.org/doc/html/rfc7396
items:
type: string
type: array
version:
description: Version indicates the provider version.
type: string
Expand Down Expand Up @@ -4566,6 +4575,15 @@ spec:
type: integer
type: object
type: object
manifestPatches:
description: ManifestPatches are applied to rendered provider manifests
to customize the provider manifests. Patches are applied in the
order they are specified. The `kind` field must match the target
object, and if `apiVersion` is specified it will only be applied
to matching objects. This should be an inline yaml blob-string https://datatracker.ietf.org/doc/html/rfc7396
items:
type: string
type: array
version:
description: Version indicates the provider version.
type: string
Expand Down Expand Up @@ -7653,6 +7671,15 @@ spec:
type: integer
type: object
type: object
manifestPatches:
description: ManifestPatches are applied to rendered provider manifests
to customize the provider manifests. Patches are applied in the
order they are specified. The `kind` field must match the target
object, and if `apiVersion` is specified it will only be applied
to matching objects. This should be an inline yaml blob-string https://datatracker.ietf.org/doc/html/rfc7396
items:
type: string
type: array
version:
description: Version indicates the provider version.
type: string
Expand Down Expand Up @@ -10738,6 +10765,15 @@ spec:
type: integer
type: object
type: object
manifestPatches:
description: ManifestPatches are applied to rendered provider manifests
to customize the provider manifests. Patches are applied in the
order they are specified. The `kind` field must match the target
object, and if `apiVersion` is specified it will only be applied
to matching objects. This should be an inline yaml blob-string https://datatracker.ietf.org/doc/html/rfc7396
items:
type: string
type: array
version:
description: Version indicates the provider version.
type: string
Expand Down Expand Up @@ -13825,6 +13861,15 @@ spec:
type: integer
type: object
type: object
manifestPatches:
description: ManifestPatches are applied to rendered provider manifests
to customize the provider manifests. Patches are applied in the
order they are specified. The `kind` field must match the target
object, and if `apiVersion` is specified it will only be applied
to matching objects. This should be an inline yaml blob-string https://datatracker.ietf.org/doc/html/rfc7396
items:
type: string
type: array
version:
description: Version indicates the provider version.
type: string
Expand Down

0 comments on commit 52286ec

Please sign in to comment.