From 1ae2cc2051e9b7b7f4815a21eef99e6dc4d289f7 Mon Sep 17 00:00:00 2001 From: Jared Rhizor Date: Fri, 16 Apr 2021 16:22:24 -0700 Subject: [PATCH] make postgres ssl optional in spec (#2923) --- .../decd338e-5647-4c0b-adf4-da0e75f5a750.json | 2 +- .../init/src/main/resources/seed/source_definitions.yaml | 2 +- airbyte-integrations/connectors/source-postgres/Dockerfile | 2 +- .../io/airbyte/integrations/source/postgres/PostgresSource.java | 2 +- .../connectors/source-postgres/src/main/resources/spec.json | 2 +- .../sources/CdcPostgresSourceStandardTest.java | 1 - 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/decd338e-5647-4c0b-adf4-da0e75f5a750.json b/airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/decd338e-5647-4c0b-adf4-da0e75f5a750.json index a19a58836687..5f95d292821b 100644 --- a/airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/decd338e-5647-4c0b-adf4-da0e75f5a750.json +++ b/airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/decd338e-5647-4c0b-adf4-da0e75f5a750.json @@ -2,6 +2,6 @@ "sourceDefinitionId": "decd338e-5647-4c0b-adf4-da0e75f5a750", "name": "Postgres", "dockerRepository": "airbyte/source-postgres", - "dockerImageTag": "0.2.6", + "dockerImageTag": "0.2.7", "documentationUrl": "https://hub.docker.com/r/airbyte/source-postgres" } diff --git a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml index 931633b011c5..ff0c7f8c3cbc 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -26,7 +26,7 @@ - sourceDefinitionId: decd338e-5647-4c0b-adf4-da0e75f5a750 name: Postgres dockerRepository: airbyte/source-postgres - dockerImageTag: 0.2.6 + dockerImageTag: 0.2.7 documentationUrl: https://hub.docker.com/r/airbyte/source-postgres - sourceDefinitionId: cd42861b-01fc-4658-a8ab-5d11d0510f01 name: Recurly diff --git a/airbyte-integrations/connectors/source-postgres/Dockerfile b/airbyte-integrations/connectors/source-postgres/Dockerfile index f1cdf3b1f810..9a62d52f6b4e 100644 --- a/airbyte-integrations/connectors/source-postgres/Dockerfile +++ b/airbyte-integrations/connectors/source-postgres/Dockerfile @@ -8,5 +8,5 @@ COPY build/distributions/${APPLICATION}*.tar ${APPLICATION}.tar RUN tar xf ${APPLICATION}.tar --strip-components=1 -LABEL io.airbyte.version=0.2.6 +LABEL io.airbyte.version=0.2.7 LABEL io.airbyte.name=airbyte/source-postgres diff --git a/airbyte-integrations/connectors/source-postgres/src/main/java/io/airbyte/integrations/source/postgres/PostgresSource.java b/airbyte-integrations/connectors/source-postgres/src/main/java/io/airbyte/integrations/source/postgres/PostgresSource.java index 36bc3a593271..8e1cd3e429a5 100644 --- a/airbyte-integrations/connectors/source-postgres/src/main/java/io/airbyte/integrations/source/postgres/PostgresSource.java +++ b/airbyte-integrations/connectors/source-postgres/src/main/java/io/airbyte/integrations/source/postgres/PostgresSource.java @@ -91,7 +91,7 @@ public JsonNode toJdbcConfig(JsonNode config) { config.get("port").asText(), config.get("database").asText())); - if (config.get("ssl").asBoolean()) { + if (config.has("ssl") && config.get("ssl").asBoolean()) { additionalParameters.add("ssl=true"); additionalParameters.add("sslmode=require"); } diff --git a/airbyte-integrations/connectors/source-postgres/src/main/resources/spec.json b/airbyte-integrations/connectors/source-postgres/src/main/resources/spec.json index 793a3da67213..2ef20318d543 100644 --- a/airbyte-integrations/connectors/source-postgres/src/main/resources/spec.json +++ b/airbyte-integrations/connectors/source-postgres/src/main/resources/spec.json @@ -4,7 +4,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Postgres Source Spec", "type": "object", - "required": ["host", "port", "database", "username", "ssl"], + "required": ["host", "port", "database", "username"], "additionalProperties": false, "properties": { "host": { diff --git a/airbyte-integrations/connectors/source-postgres/src/test-integration/java/io/airbyte/integrations/io/airbyte/integration_tests/sources/CdcPostgresSourceStandardTest.java b/airbyte-integrations/connectors/source-postgres/src/test-integration/java/io/airbyte/integrations/io/airbyte/integration_tests/sources/CdcPostgresSourceStandardTest.java index a35878da0f16..b757effd354e 100644 --- a/airbyte-integrations/connectors/source-postgres/src/test-integration/java/io/airbyte/integrations/io/airbyte/integration_tests/sources/CdcPostgresSourceStandardTest.java +++ b/airbyte-integrations/connectors/source-postgres/src/test-integration/java/io/airbyte/integrations/io/airbyte/integration_tests/sources/CdcPostgresSourceStandardTest.java @@ -72,7 +72,6 @@ protected void setup(TestDestinationEnv testEnv) throws Exception { .put("database", container.getDatabaseName()) .put("username", container.getUsername()) .put("password", container.getPassword()) - .put("ssl", false) .put("replication_method", ImmutableMap.of("replication_slot", SLOT_NAME_BASE)) .build());