airbyte-platform
airbyte-platform copied to clipboard
🐛 Fix ENV VAR kv parsing to handle JSON values
trafficstars
What
JOB_KUBE_ANNOTATIONS environment variable can be used to define one or more Job pod annotations. The valid value can be a JSON value (see example below). Current logic to process the key:value pairs is not allowing to pass the JSON value.
- JOB_KUBE_ANNOTATIONS can have JSON as values
- This PR fixes the parsing of such values
Before fix:
Example of a valid istio k8s annotation that is incorrectly parsed without a fix:
proxy.istio.io/config={
"holdApplicationUntilProxyStarts": true,
"proxyMetadata": {
"EXIT_ON_ZERO_ACTIVE_CONNECTIONS": "true"
}
}
How
- Parse ENV VAR value with Regex Pattern that checks for JSON values
- Fallback to Regex Pattern that extracts k:v as it was done before with
Splitterstream.
Recommended reading order
airbyte-commons-with-dependencies/src/main/java/io/airbyte/commons/workers/config/EnvUtils.javaairbyte-commons-with-dependencies/src/main/java/io/airbyte/commons/workers/config/WorkerConfigsProvider.javaairbyte-commons-with-dependencies/src/test/java/io/airbyte/commons/workers/config/EnvUtilsTest.java
Can this PR be safely reverted and rolled back?
- [x] YES 💚
- [ ] NO ❌