|
| 1 | +suite: Test integration of outputs from Argo Project templates with components that use them in the runtime chart |
| 2 | +templates: |
| 3 | + - app-proxy/deployment.yaml |
| 4 | + - app-proxy/config.yaml |
| 5 | + - app-proxy/enrichment/sa.yaml |
| 6 | + - app-proxy/enrichment/rbac.yaml |
| 7 | + - app-proxy/enrichment/enforce-workflows-enabled.yaml |
| 8 | +tests: |
| 9 | +- it: Fail template if enrichment is enabled and workflows disabled |
| 10 | + template: 'app-proxy/enrichment/enforce-workflows-enabled.yaml' |
| 11 | + values: |
| 12 | + - ./values/mandatory-values.yaml |
| 13 | + set: |
| 14 | + argo-workflows.enabled: false |
| 15 | + app-proxy.image-enrichment.enabled: true |
| 16 | + asserts: |
| 17 | + - failedTemplate: |
| 18 | + errorMessage: 'app-proxy.image-enrichment is enabled but argo-workflows is disabled. This is not suppurted. Either disable erichment or enable workflows' |
| 19 | + |
| 20 | +- it: Set correct values in app-proxy configmap |
| 21 | + template: 'app-proxy/config.yaml' |
| 22 | + values: |
| 23 | + - ./values/mandatory-values.yaml |
| 24 | + set: |
| 25 | + app-proxy.image-enrichment.enabled: true |
| 26 | + app-proxy.image-enrichment.config.concurrencyCmName: test |
| 27 | + app-proxy.image-enrichment.config.concurrencyCmKey: test |
| 28 | + app-proxy.image-enrichment.config.podGcStrategy: test |
| 29 | + app-proxy.image-enrichment.config.ttlAfterCompletionInSeconds: 1 |
| 30 | + app-proxy.image-enrichment.config.ttlActiveInSeconds: 1 |
| 31 | + app-proxy.image-enrichment.config.clientHeartbeatIntervalInSeconds: 1 |
| 32 | + app-proxy.image-enrichment.serviceAccount.name: test |
| 33 | + asserts: |
| 34 | + - equal: |
| 35 | + path: data.enrichmentConcurrencyCmName |
| 36 | + value: test |
| 37 | + - equal: |
| 38 | + path: data.enrichmentConcurrencyCmKey |
| 39 | + value: test |
| 40 | + - equal: |
| 41 | + path: data.enrichmentPodGcStrategy |
| 42 | + value: test |
| 43 | + - equal: |
| 44 | + path: data.enrichmentTtlAfterCompletionInSeconds |
| 45 | + value: 1 |
| 46 | + - equal: |
| 47 | + path: data.enrichmentTtlActiveInSeconds |
| 48 | + value: 1 |
| 49 | + - equal: |
| 50 | + path: data.enrichmentClientHeartbeatIntervalInSeconds |
| 51 | + value: 1 |
| 52 | + - equal: |
| 53 | + path: data.enrichmentServiceAccountName |
| 54 | + value: test |
| 55 | + |
| 56 | +- it: app proxy environment variables set for enrichemnt and match the values in the configmap |
| 57 | + template: 'app-proxy/deployment.yaml' |
| 58 | + values: |
| 59 | + - ./values/mandatory-values.yaml |
| 60 | + set: |
| 61 | + app-proxy.image-enrichment.enabled: true |
| 62 | + asserts: |
| 63 | + - contains: |
| 64 | + path: spec.template.spec.containers[0].env |
| 65 | + content: |
| 66 | + name: IRW_CONCURRENCY_CM_NAME |
| 67 | + valueFrom: |
| 68 | + configMapKeyRef: |
| 69 | + name: cap-app-proxy-cm |
| 70 | + key: enrichmentConcurrencyCmName |
| 71 | + optional: true |
| 72 | + - contains: |
| 73 | + path: spec.template.spec.containers[0].env |
| 74 | + content: |
| 75 | + name: IRW_CONCURRENCY_CM_KEY |
| 76 | + valueFrom: |
| 77 | + configMapKeyRef: |
| 78 | + name: cap-app-proxy-cm |
| 79 | + key: enrichmentConcurrencyCmKey |
| 80 | + optional: true |
| 81 | + - contains: |
| 82 | + path: spec.template.spec.containers[0].env |
| 83 | + content: |
| 84 | + name: IRW_POD_GC_STRATEGY |
| 85 | + valueFrom: |
| 86 | + configMapKeyRef: |
| 87 | + name: cap-app-proxy-cm |
| 88 | + key: enrichmentPodGcStrategy |
| 89 | + optional: true |
| 90 | + - contains: |
| 91 | + path: spec.template.spec.containers[0].env |
| 92 | + content: |
| 93 | + name: IRW_TTL_AFTER_COMPLETION_IN_SECONDS |
| 94 | + valueFrom: |
| 95 | + configMapKeyRef: |
| 96 | + name: cap-app-proxy-cm |
| 97 | + key: enrichmentTtlAfterCompletionInSeconds |
| 98 | + optional: true |
| 99 | + - contains: |
| 100 | + path: spec.template.spec.containers[0].env |
| 101 | + content: |
| 102 | + name: IRW_TTL_ACTIVE_IN_SECONDS |
| 103 | + valueFrom: |
| 104 | + configMapKeyRef: |
| 105 | + name: cap-app-proxy-cm |
| 106 | + key: enrichmentTtlActiveInSeconds |
| 107 | + optional: true |
| 108 | + - contains: |
| 109 | + path: spec.template.spec.containers[0].env |
| 110 | + content: |
| 111 | + name: IRW_HEARTBEAT_INTERVAL_IN_SECONDS |
| 112 | + valueFrom: |
| 113 | + configMapKeyRef: |
| 114 | + name: cap-app-proxy-cm |
| 115 | + key: enrichmentClientHeartbeatIntervalInSeconds |
| 116 | + optional: true |
| 117 | + - contains: |
| 118 | + path: spec.template.spec.containers[0].env |
| 119 | + content: |
| 120 | + name: IRW_SERVICE_ACCOUNT |
| 121 | + valueFrom: |
| 122 | + configMapKeyRef: |
| 123 | + name: cap-app-proxy-cm |
| 124 | + key: enrichmentServiceAccountName |
| 125 | + optional: true |
| 126 | + |
| 127 | +- it: Verify correct name of serviceAccount |
| 128 | + template: 'app-proxy/enrichment/sa.yaml' |
| 129 | + values: |
| 130 | + - ./values/mandatory-values.yaml |
| 131 | + set: |
| 132 | + app-proxy.image-enrichment.serviceAccount.name: test |
| 133 | + asserts: |
| 134 | + - equal: |
| 135 | + path: metadata.name |
| 136 | + value: test |
| 137 | + |
| 138 | +- it: Correct serviceaccount is set in role binding |
| 139 | + template: 'app-proxy/enrichment/rbac.yaml' |
| 140 | + documentIndex: 1 |
| 141 | + values: |
| 142 | + - ./values/mandatory-values.yaml |
| 143 | + set: |
| 144 | + app-proxy.image-enrichment.serviceAccount.name: test |
| 145 | + asserts: |
| 146 | + - contains: |
| 147 | + path: subjects |
| 148 | + content: |
| 149 | + kind: ServiceAccount |
| 150 | + name: test |
| 151 | + - equal: |
| 152 | + path: roleRef.name |
| 153 | + value: cap-app-proxy-enrichment |
| 154 | + |
| 155 | + |
| 156 | + |
| 157 | + |
| 158 | + |
0 commit comments