-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add logging app interface cloudwatch to the cache at the start of rec…
…onciliation
- Loading branch information
Showing
9 changed files
with
186 additions
and
0 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
8 changes: 8 additions & 0 deletions
8
tests/kuttl/test-clowdapp-watcher-logging-app-interface-cloudwatch/00-install.yaml
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,8 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: test-clowdapp-watcher-logging-app-interface-clowdwatch | ||
spec: | ||
finalizers: | ||
- kubernetes |
50 changes: 50 additions & 0 deletions
50
tests/kuttl/test-clowdapp-watcher-logging-app-interface-cloudwatch/01-assert.yaml
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,50 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: puptoo | ||
namespace: test-clowdapp-watcher-logging-app-interface-clowdwatch | ||
labels: | ||
app: puptoo | ||
ownerReferences: | ||
- apiVersion: cloud.redhat.com/v1alpha1 | ||
kind: ClowdApp | ||
name: puptoo | ||
type: Opaque | ||
data: | ||
cdappconfig.json: eyJoYXNoQ2FjaGUiOiJlM2IwYzQ0Mjk4ZmMxYzE0OWFmYmY0Yzg5OTZmYjkyNDI3YWU0MWU0NjQ5YjkzNGNhNDk1OTkxYjc4NTJiODU1OGRlMGJhZjAzY2NhOTRhZjBhMzdjZmYwYmFjMzE1NjdkZDI2ODhiZDYzMDZjYjZjMDM5MGVlYjYzMTA2ZjIyYiIsImxvZ2dpbmciOnsiY2xvdWR3YXRjaCI6eyJhY2Nlc3NLZXlJZCI6ImFjY2Vzcy1rZXktaWQiLCJsb2dHcm91cCI6IkxvZ3NfU3RhZ2UiLCJyZWdpb24iOiJldS1jZW50cmFsLTEiLCJzZWNyZXRBY2Nlc3NLZXkiOiJ0b3Atc2VjcmV0In0sInR5cGUiOiIifSwibWV0YWRhdGEiOnsiZGVwbG95bWVudHMiOlt7ImltYWdlIjoicXVheS5pby9wc2F2L2Nsb3dkZXItaGVsbG8iLCJuYW1lIjoicHJvY2Vzc29yIn1dLCJlbnZOYW1lIjoidGVzdC1jbG93ZGFwcC13YXRjaGVyLWxvZ2dpbmctYXBwLWludGVyZmFjZS1jbG93ZHdhdGNoIiwibmFtZSI6InB1cHRvbyJ9LCJtZXRyaWNzUGF0aCI6Ii9tZXRyaWNzIiwibWV0cmljc1BvcnQiOjkwMDAsInByaXZhdGVQb3J0IjoxMDAwMCwicHVibGljUG9ydCI6ODAwMCwid2ViUG9ydCI6ODAwMH0= | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: puptoo-processor | ||
namespace: test-clowdapp-watcher-logging-app-interface-clowdwatch | ||
spec: | ||
strategy: | ||
type: RollingUpdate | ||
template: | ||
spec: | ||
serviceAccountName: puptoo-processor | ||
containers: | ||
- env: | ||
- name: ENV_VAR_1 | ||
value: "env_var_1" | ||
- name: ACG_CONFIG | ||
value: /cdapp/cdappconfig.json | ||
--- | ||
apiVersion: cloud.redhat.com/v1alpha1 | ||
kind: ClowdEnvironment | ||
metadata: | ||
name: test-clowdapp-watcher-logging-app-interface-clowdwatch | ||
status: | ||
apps: | ||
- name: puptoo | ||
deployments: | ||
- name: puptoo-processor | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: test-clowdapp-watcher-logging-app-interface-clowdwatch | ||
labels: | ||
kubernetes.io/metadata.name: test-clowdapp-watcher-logging-app-interface-clowdwatch |
59 changes: 59 additions & 0 deletions
59
tests/kuttl/test-clowdapp-watcher-logging-app-interface-cloudwatch/01-pods.yaml
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,59 @@ | ||
--- | ||
apiVersion: v1 | ||
data: | ||
aws_access_key_id: YWNjZXNzLWtleS1pZA== # access-key-id | ||
aws_secret_access_key: dG9wLXNlY3JldA== # top-secret | ||
aws_region: ZXUtY2VudHJhbC0x # eu-central-1 | ||
log_group_name: TG9nc19TdGFnZQ== # Logs_Stage | ||
kind: Secret | ||
metadata: | ||
name: cloudwatch | ||
namespace: test-clowdapp-watcher-logging-app-interface-clowdwatch | ||
type: Opaque | ||
--- | ||
apiVersion: cloud.redhat.com/v1alpha1 | ||
kind: ClowdEnvironment | ||
metadata: | ||
name: test-clowdapp-watcher-logging-app-interface-clowdwatch | ||
spec: | ||
targetNamespace: test-clowdapp-watcher-logging-app-interface-clowdwatch | ||
providers: | ||
web: | ||
port: 8000 | ||
mode: operator | ||
metrics: | ||
port: 9000 | ||
mode: operator | ||
path: "/metrics" | ||
kafka: | ||
mode: none | ||
db: | ||
mode: none | ||
logging: | ||
mode: app-interface | ||
objectStore: | ||
mode: none | ||
inMemoryDb: | ||
mode: none | ||
resourceDefaults: | ||
limits: | ||
cpu: 400m | ||
memory: 1024Mi | ||
requests: | ||
cpu: 30m | ||
memory: 512Mi | ||
--- | ||
apiVersion: cloud.redhat.com/v1alpha1 | ||
kind: ClowdApp | ||
metadata: | ||
name: puptoo | ||
namespace: test-clowdapp-watcher-logging-app-interface-clowdwatch | ||
spec: | ||
envName: test-clowdapp-watcher-logging-app-interface-clowdwatch | ||
deployments: | ||
- name: processor | ||
podSpec: | ||
image: quay.io/psav/clowder-hello | ||
env: | ||
- name: ENV_VAR_1 | ||
value: env_var_1 |
8 changes: 8 additions & 0 deletions
8
tests/kuttl/test-clowdapp-watcher-logging-app-interface-cloudwatch/02-json-asserts.yaml
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,8 @@ | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: kubectl get secret --namespace=test-clowdapp-watcher-logging-app-interface-clowdwatch puptoo -o json > /tmp/test-clowdapp-watcher-logging-app-interface-clowdwatch | ||
- script: jq -r '.data["cdappconfig.json"]' < /tmp/test-clowdapp-watcher-logging-app-interface-clowdwatch | base64 -d > /tmp/test-clowdapp-watcher-logging-app-interface-clowdwatch-json | ||
|
||
- script: jq -r '.logging.cloudwatch.secretAccessKey == "top-secret"' -e < /tmp/test-clowdapp-watcher-logging-app-interface-clowdwatch-json |
15 changes: 15 additions & 0 deletions
15
tests/kuttl/test-clowdapp-watcher-logging-app-interface-cloudwatch/03-assert.yaml
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 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: puptoo | ||
namespace: test-clowdapp-watcher-logging-app-interface-clowdwatch | ||
labels: | ||
app: puptoo | ||
ownerReferences: | ||
- apiVersion: cloud.redhat.com/v1alpha1 | ||
kind: ClowdApp | ||
name: puptoo | ||
type: Opaque | ||
data: | ||
cdappconfig.json: eyJoYXNoQ2FjaGUiOiJlM2IwYzQ0Mjk4ZmMxYzE0OWFmYmY0Yzg5OTZmYjkyNDI3YWU0MWU0NjQ5YjkzNGNhNDk1OTkxYjc4NTJiODU1YzgwZDIwNmI0NDA4MmYyMWFlNjI4ZTA5OGU4OWEyMzUxNDI1ZGJjZTRkZjViOWIyNzAzOGI5MDQ1NDU0MTVjZiIsImxvZ2dpbmciOnsiY2xvdWR3YXRjaCI6eyJhY2Nlc3NLZXlJZCI6ImFjY2Vzcy1rZXktaWQiLCJsb2dHcm91cCI6IkxvZ3NfU3RhZ2UiLCJyZWdpb24iOiJldS1jZW50cmFsLTEiLCJzZWNyZXRBY2Nlc3NLZXkiOiJzdHJvbmctdG9wLXNlY3JldCJ9LCJ0eXBlIjoiIn0sIm1ldGFkYXRhIjp7ImRlcGxveW1lbnRzIjpbeyJpbWFnZSI6InF1YXkuaW8vcHNhdi9jbG93ZGVyLWhlbGxvIiwibmFtZSI6InByb2Nlc3NvciJ9XSwiZW52TmFtZSI6InRlc3QtY2xvd2RhcHAtd2F0Y2hlci1sb2dnaW5nLWFwcC1pbnRlcmZhY2UtY2xvd2R3YXRjaCIsIm5hbWUiOiJwdXB0b28ifSwibWV0cmljc1BhdGgiOiIvbWV0cmljcyIsIm1ldHJpY3NQb3J0Ijo5MDAwLCJwcml2YXRlUG9ydCI6MTAwMDAsInB1YmxpY1BvcnQiOjgwMDAsIndlYlBvcnQiOjgwMDB9 |
12 changes: 12 additions & 0 deletions
12
tests/kuttl/test-clowdapp-watcher-logging-app-interface-cloudwatch/03-pods.yaml
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,12 @@ | ||
--- | ||
apiVersion: v1 | ||
data: | ||
aws_access_key_id: YWNjZXNzLWtleS1pZA== # access-key-id | ||
aws_secret_access_key: c3Ryb25nLXRvcC1zZWNyZXQ= # strong-top-secret | ||
aws_region: ZXUtY2VudHJhbC0x # eu-central-1 | ||
log_group_name: TG9nc19TdGFnZQ== # Logs_Stage | ||
kind: Secret | ||
metadata: | ||
name: cloudwatch | ||
namespace: test-clowdapp-watcher-logging-app-interface-clowdwatch | ||
type: Opaque |
16 changes: 16 additions & 0 deletions
16
tests/kuttl/test-clowdapp-watcher-logging-app-interface-cloudwatch/04-json-asserts.yaml
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,16 @@ | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: kubectl get secret --namespace=test-clowdapp-watcher-logging-app-interface-clowdwatch puptoo -o json > /tmp/test-clowdapp-watcher-logging-app-interface-clowdwatch2 | ||
- script: jq -r '.data["cdappconfig.json"]' < /tmp/test-clowdapp-watcher-logging-app-interface-clowdwatch2 | base64 -d > /tmp/test-clowdapp-watcher-logging-app-interface-clowdwatch2-json | ||
|
||
- script: cat /tmp/test-clowdapp-watcher-logging-app-interface-clowdwatch-json | ||
- script: cat /tmp/test-clowdapp-watcher-logging-app-interface-clowdwatch2-json | ||
|
||
- script: jq -r '.logging.cloudwatch.secretAccessKey == "strong-top-secret"' -e < /tmp/test-clowdapp-watcher-logging-app-interface-clowdwatch2-json | ||
|
||
- script: jq -r '.hashCache' -e < /tmp/test-clowdapp-watcher-logging-app-interface-clowdwatch-json > /tmp/test-clowdapp-watcher-logging-app-interface-clowdwatch-hash-cache | ||
- script: jq -r '.hashCache' -e < /tmp/test-clowdapp-watcher-logging-app-interface-clowdwatch2-json > /tmp/test-clowdapp-watcher-logging-app-interface-clowdwatch-hash-cache2 | ||
|
||
- script: diff /tmp/test-clowdapp-watcher-logging-app-interface-clowdwatch-hash-cache /tmp/test-clowdapp-watcher-logging-app-interface-clowdwatch-hash-cache2 > /dev/null || exit 0 && exit 1 |
10 changes: 10 additions & 0 deletions
10
tests/kuttl/test-clowdapp-watcher-logging-app-interface-cloudwatch/05-delete.yaml
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,10 @@ | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
delete: | ||
- apiVersion: v1 | ||
kind: Namespace | ||
name: test-clowdapp-watcher-logging-app-interface-clowdwatch | ||
- apiVersion: cloud.redhat.com/v1alpha1 | ||
kind: ClowdEnvironment | ||
name: test-clowdapp-watcher-logging-app-interface-clowdwatch |