From 8595e847a33486eaa62e46462b0662a0eb30b048 Mon Sep 17 00:00:00 2001 From: Emily Casey Date: Thu, 28 May 2020 18:24:33 -0400 Subject: [PATCH 1/3] Support r2dbc Adds r2dbc properties for mysql, postgres, sqlserver, oracle, and db2 bindings. This allow bindings to be used with reactive drivers. Signed-off-by: Emily Casey --- .../boot/Db2BindingsPropertiesProcessor.java | 7 +++++++ .../boot/MySqlBindingsPropertiesProcessor.java | 10 +++++++--- .../boot/OracleBindingsPropertiesProcessor.java | 7 +++++++ .../PostgreSqlBindingsPropertiesProcessor.java | 7 +++++++ .../boot/SqlServerBindingsPropertiesProcessor.java | 7 +++++++ ...indingSpecificEnvironmentPostProcessorTest.java | 2 +- .../boot/Db2BindingsPropertiesProcessorTest.java | 13 +++++++++++-- .../boot/MySqlBindingsPropertiesProcessorTest.java | 14 ++++++++++++-- .../OracleBindingsPropertiesProcessorTest.java | 14 ++++++++++++-- .../PostgreSqlBindingsPropertiesProcessorTest.java | 14 ++++++++++++-- .../SqlServerBindingsPropertiesProcessorTest.java | 14 ++++++++++++-- 11 files changed, 95 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/springframework/cloud/bindings/boot/Db2BindingsPropertiesProcessor.java b/src/main/java/org/springframework/cloud/bindings/boot/Db2BindingsPropertiesProcessor.java index 9d41147..e0abe0e 100644 --- a/src/main/java/org/springframework/cloud/bindings/boot/Db2BindingsPropertiesProcessor.java +++ b/src/main/java/org/springframework/cloud/bindings/boot/Db2BindingsPropertiesProcessor.java @@ -45,12 +45,19 @@ public final class Db2BindingsPropertiesProcessor implements BindingsPropertiesP bindings.filterBindings(KIND).forEach(binding -> { MapMapper map = new MapMapper(binding.getSecret(), properties); + //jdbc properties map.from("password").to("spring.datasource.password"); map.from("host", "port", "database").to("spring.datasource.url", (host, port, database) -> String.format("jdbc:db2://%s:%s/%s", host, port, database)); map.from("username").to("spring.datasource.username"); properties.put("spring.datasource.driver-class-name", "com.ibm.db2.jcc.DB2Driver"); + + //r2dbc properties + map.from("password").to("spring.r2dbc.password"); + map.from("host", "port", "database").to("spring.r2dbc.url", + (host, port, database) -> String.format("r2dbc:db2://%s:%s/%s", host, port, database)); + map.from("username").to("spring.r2dbc.username"); }); } diff --git a/src/main/java/org/springframework/cloud/bindings/boot/MySqlBindingsPropertiesProcessor.java b/src/main/java/org/springframework/cloud/bindings/boot/MySqlBindingsPropertiesProcessor.java index 00c511f..dbf3f1e 100644 --- a/src/main/java/org/springframework/cloud/bindings/boot/MySqlBindingsPropertiesProcessor.java +++ b/src/main/java/org/springframework/cloud/bindings/boot/MySqlBindingsPropertiesProcessor.java @@ -45,14 +45,12 @@ public final class MySqlBindingsPropertiesProcessor implements BindingsPropertie bindings.filterBindings(KIND).forEach(binding -> { MapMapper map = new MapMapper(binding.getSecret(), properties); + //jdbc properties map.from("password").to("spring.datasource.password"); map.from("host", "port", "database").to("spring.datasource.url", (host, port, database) -> String.format("jdbc:mysql://%s:%s/%s", host, port, database)); map.from("username").to("spring.datasource.username"); - - Map secret = binding.getSecret(); - try { Class.forName("org.mariadb.jdbc.Driver", false, getClass().getClassLoader()); properties.put("spring.datasource.driver-class-name", "org.mariadb.jdbc.Driver"); @@ -63,6 +61,12 @@ public final class MySqlBindingsPropertiesProcessor implements BindingsPropertie } catch (ClassNotFoundException ignored) { } } + + //r2dbc properties + map.from("password").to("spring.r2dbc.password"); + map.from("host", "port", "database").to("spring.r2dbc.url", + (host, port, database) -> String.format("r2dbc:mysql://%s:%s/%s", host, port, database)); + map.from("username").to("spring.r2dbc.username"); }); } diff --git a/src/main/java/org/springframework/cloud/bindings/boot/OracleBindingsPropertiesProcessor.java b/src/main/java/org/springframework/cloud/bindings/boot/OracleBindingsPropertiesProcessor.java index 694727d..e4544eb 100644 --- a/src/main/java/org/springframework/cloud/bindings/boot/OracleBindingsPropertiesProcessor.java +++ b/src/main/java/org/springframework/cloud/bindings/boot/OracleBindingsPropertiesProcessor.java @@ -45,12 +45,19 @@ public final class OracleBindingsPropertiesProcessor implements BindingsProperti bindings.filterBindings(KIND).forEach(binding -> { MapMapper map = new MapMapper(binding.getSecret(), properties); + //jdbc properties map.from("password").to("spring.datasource.password"); map.from("host", "port", "database").to("spring.datasource.url", (host, port, database) -> String.format("jdbc:oracle://%s:%s/%s", host, port, database)); map.from("username").to("spring.datasource.username"); properties.put("spring.datasource.driver-class-name", "oracle.jdbc.OracleDriver"); + + //r2dbc properties + map.from("password").to("spring.r2dbc.password"); + map.from("host", "port", "database").to("spring.r2dbc.url", + (host, port, database) -> String.format("r2dbc:oracle://%s:%s/%s", host, port, database)); + map.from("username").to("spring.r2dbc.username"); }); } diff --git a/src/main/java/org/springframework/cloud/bindings/boot/PostgreSqlBindingsPropertiesProcessor.java b/src/main/java/org/springframework/cloud/bindings/boot/PostgreSqlBindingsPropertiesProcessor.java index 8f57bfc..4fb26e5 100644 --- a/src/main/java/org/springframework/cloud/bindings/boot/PostgreSqlBindingsPropertiesProcessor.java +++ b/src/main/java/org/springframework/cloud/bindings/boot/PostgreSqlBindingsPropertiesProcessor.java @@ -45,12 +45,19 @@ public final class PostgreSqlBindingsPropertiesProcessor implements BindingsProp bindings.filterBindings(KIND).forEach(binding -> { MapMapper map = new MapMapper(binding.getSecret(), properties); + //jdbc properties map.from("password").to("spring.datasource.password"); map.from("host", "port", "database").to("spring.datasource.url", (host, port, database) -> String.format("jdbc:postgres://%s:%s/%s", host, port, database)); map.from("username").to("spring.datasource.username"); properties.put("spring.datasource.driver-class-name", "org.postgresql.Driver"); + + //r2dbc properties + map.from("password").to("spring.r2dbc.password"); + map.from("host", "port", "database").to("spring.r2dbc.url", + (host, port, database) -> String.format("r2dbc:postgres://%s:%s/%s", host, port, database)); + map.from("username").to("spring.r2dbc.username"); }); } diff --git a/src/main/java/org/springframework/cloud/bindings/boot/SqlServerBindingsPropertiesProcessor.java b/src/main/java/org/springframework/cloud/bindings/boot/SqlServerBindingsPropertiesProcessor.java index fc667f8..553eb71 100644 --- a/src/main/java/org/springframework/cloud/bindings/boot/SqlServerBindingsPropertiesProcessor.java +++ b/src/main/java/org/springframework/cloud/bindings/boot/SqlServerBindingsPropertiesProcessor.java @@ -45,12 +45,19 @@ public final class SqlServerBindingsPropertiesProcessor implements BindingsPrope bindings.filterBindings(KIND).forEach(binding -> { MapMapper map = new MapMapper(binding.getSecret(), properties); + //jdbc properties map.from("password").to("spring.datasource.password"); map.from("host", "port", "database").to("spring.datasource.url", (host, port, database) -> String.format("jdbc:sqlserver://%s:%s/%s", host, port, database)); map.from("username").to("spring.datasource.username"); properties.put("spring.datasource.driver-class-name", "com.microsoft.sqlserver.jdbc.SQLServerDriver"); + + //r2dbc properties + map.from("password").to("spring.r2dbc.password"); + map.from("host", "port", "database").to("spring.r2dbc.url", + (host, port, database) -> String.format("r2dbc:sqlserver://%s:%s/%s", host, port, database)); + map.from("username").to("spring.r2dbc.username"); }); } diff --git a/src/test/java/org/springframework/cloud/bindings/boot/BindingSpecificEnvironmentPostProcessorTest.java b/src/test/java/org/springframework/cloud/bindings/boot/BindingSpecificEnvironmentPostProcessorTest.java index f1df2eb..3b36200 100644 --- a/src/test/java/org/springframework/cloud/bindings/boot/BindingSpecificEnvironmentPostProcessorTest.java +++ b/src/test/java/org/springframework/cloud/bindings/boot/BindingSpecificEnvironmentPostProcessorTest.java @@ -98,7 +98,7 @@ final class BindingSpecificEnvironmentPostProcessorTest { @Test @DisplayName("included implementations are registered") void includedImplementations() { - assertThat(new BindingSpecificEnvironmentPostProcessor().processors).hasSize(14); + assertThat(new BindingSpecificEnvironmentPostProcessor().processors).hasSize(15); } } diff --git a/src/test/java/org/springframework/cloud/bindings/boot/Db2BindingsPropertiesProcessorTest.java b/src/test/java/org/springframework/cloud/bindings/boot/Db2BindingsPropertiesProcessorTest.java index 297d8f5..3bfa8df 100644 --- a/src/test/java/org/springframework/cloud/bindings/boot/Db2BindingsPropertiesProcessorTest.java +++ b/src/test/java/org/springframework/cloud/bindings/boot/Db2BindingsPropertiesProcessorTest.java @@ -50,8 +50,8 @@ final class Db2BindingsPropertiesProcessorTest { private final HashMap properties = new HashMap<>(); @Test - @DisplayName("contributes properties") - void test() { + @DisplayName("contributes jdbc properties") + void testJdbc() { new Db2BindingsPropertiesProcessor().process(environment, bindings, properties); assertThat(properties) .containsEntry("spring.datasource.driver-class-name", "com.ibm.db2.jcc.DB2Driver") @@ -60,6 +60,15 @@ final class Db2BindingsPropertiesProcessorTest { .containsEntry("spring.datasource.username", "test-username"); } + @Test + @DisplayName("contributes r2dbc properties") + void testR2dbc() { + new Db2BindingsPropertiesProcessor().process(environment, bindings, properties); + assertThat(properties) + .containsEntry("spring.r2dbc.password", "test-password") + .containsEntry("spring.r2dbc.url", "r2dbc:db2://test-host:test-port/test-database") + .containsEntry("spring.r2dbc.username", "test-username"); } + @Test @DisplayName("can be disabled") void disabled() { diff --git a/src/test/java/org/springframework/cloud/bindings/boot/MySqlBindingsPropertiesProcessorTest.java b/src/test/java/org/springframework/cloud/bindings/boot/MySqlBindingsPropertiesProcessorTest.java index 0549950..3eadb69 100644 --- a/src/test/java/org/springframework/cloud/bindings/boot/MySqlBindingsPropertiesProcessorTest.java +++ b/src/test/java/org/springframework/cloud/bindings/boot/MySqlBindingsPropertiesProcessorTest.java @@ -50,8 +50,8 @@ final class MySqlBindingsPropertiesProcessorTest { private final HashMap properties = new HashMap<>(); @Test - @DisplayName("contributes properties") - void test() { + @DisplayName("contributes jdbc properties") + void testJdbc() { new MySqlBindingsPropertiesProcessor().process(environment, bindings, properties); assertThat(properties) .containsEntry("spring.datasource.driver-class-name", "org.mariadb.jdbc.Driver") @@ -60,6 +60,16 @@ final class MySqlBindingsPropertiesProcessorTest { .containsEntry("spring.datasource.username", "test-username"); } + @Test + @DisplayName("contributes r2dbc properties") + void testR2dbc() { + new MySqlBindingsPropertiesProcessor().process(environment, bindings, properties); + assertThat(properties) + .containsEntry("spring.r2dbc.password", "test-password") + .containsEntry("spring.r2dbc.url", "r2dbc:mysql://test-host:test-port/test-database") + .containsEntry("spring.r2dbc.username", "test-username"); + } + @Test @DisplayName("can be disabled") void disabled() { diff --git a/src/test/java/org/springframework/cloud/bindings/boot/OracleBindingsPropertiesProcessorTest.java b/src/test/java/org/springframework/cloud/bindings/boot/OracleBindingsPropertiesProcessorTest.java index 58a8be8..adb3829 100644 --- a/src/test/java/org/springframework/cloud/bindings/boot/OracleBindingsPropertiesProcessorTest.java +++ b/src/test/java/org/springframework/cloud/bindings/boot/OracleBindingsPropertiesProcessorTest.java @@ -50,8 +50,8 @@ final class OracleBindingsPropertiesProcessorTest { private final HashMap properties = new HashMap<>(); @Test - @DisplayName("contributes properties") - void test() { + @DisplayName("contributes jdbc properties") + void testJdbc() { new OracleBindingsPropertiesProcessor().process(environment, bindings, properties); assertThat(properties) .containsEntry("spring.datasource.driver-class-name", "oracle.jdbc.OracleDriver") @@ -60,6 +60,16 @@ final class OracleBindingsPropertiesProcessorTest { .containsEntry("spring.datasource.username", "test-username"); } + @Test + @DisplayName("contributes r2dbc properties") + void testR2dbc() { + new OracleBindingsPropertiesProcessor().process(environment, bindings, properties); + assertThat(properties) + .containsEntry("spring.r2dbc.password", "test-password") + .containsEntry("spring.r2dbc.url", "r2dbc:oracle://test-host:test-port/test-database") + .containsEntry("spring.r2dbc.username", "test-username"); + } + @Test @DisplayName("can be disabled") void disabled() { diff --git a/src/test/java/org/springframework/cloud/bindings/boot/PostgreSqlBindingsPropertiesProcessorTest.java b/src/test/java/org/springframework/cloud/bindings/boot/PostgreSqlBindingsPropertiesProcessorTest.java index 920cbb2..87f7ae6 100644 --- a/src/test/java/org/springframework/cloud/bindings/boot/PostgreSqlBindingsPropertiesProcessorTest.java +++ b/src/test/java/org/springframework/cloud/bindings/boot/PostgreSqlBindingsPropertiesProcessorTest.java @@ -50,8 +50,8 @@ final class PostgreSqlBindingsPropertiesProcessorTest { private final HashMap properties = new HashMap<>(); @Test - @DisplayName("contributes properties") - void test() { + @DisplayName("contributes jdbc properties") + void testJdbc() { new PostgreSqlBindingsPropertiesProcessor().process(environment, bindings, properties); assertThat(properties) .containsEntry("spring.datasource.driver-class-name", "org.postgresql.Driver") @@ -60,6 +60,16 @@ final class PostgreSqlBindingsPropertiesProcessorTest { .containsEntry("spring.datasource.username", "test-username"); } + @Test + @DisplayName("contributes r2dbc properties") + void testR2dbc() { + new PostgreSqlBindingsPropertiesProcessor().process(environment, bindings, properties); + assertThat(properties) + .containsEntry("spring.r2dbc.password", "test-password") + .containsEntry("spring.r2dbc.url", "r2dbc:postgres://test-host:test-port/test-database") + .containsEntry("spring.r2dbc.username", "test-username"); + } + @Test @DisplayName("can be disabled") void disabled() { diff --git a/src/test/java/org/springframework/cloud/bindings/boot/SqlServerBindingsPropertiesProcessorTest.java b/src/test/java/org/springframework/cloud/bindings/boot/SqlServerBindingsPropertiesProcessorTest.java index 41049a7..73ca1ee 100644 --- a/src/test/java/org/springframework/cloud/bindings/boot/SqlServerBindingsPropertiesProcessorTest.java +++ b/src/test/java/org/springframework/cloud/bindings/boot/SqlServerBindingsPropertiesProcessorTest.java @@ -50,8 +50,8 @@ final class SqlServerBindingsPropertiesProcessorTest { private final HashMap properties = new HashMap<>(); @Test - @DisplayName("contributes properties") - void test() { + @DisplayName("contributes jdbc properties") + void testJdbc() { new SqlServerBindingsPropertiesProcessor().process(environment, bindings, properties); assertThat(properties) .containsEntry("spring.datasource.driver-class-name", "com.microsoft.sqlserver.jdbc.SQLServerDriver") @@ -60,6 +60,16 @@ final class SqlServerBindingsPropertiesProcessorTest { .containsEntry("spring.datasource.username", "test-username"); } + @Test + @DisplayName("contributes r2dbc properties") + void testR2dbc() { + new SqlServerBindingsPropertiesProcessor().process(environment, bindings, properties); + assertThat(properties) + .containsEntry("spring.r2dbc.password", "test-password") + .containsEntry("spring.r2dbc.url", "r2dbc:sqlserver://test-host:test-port/test-database") + .containsEntry("spring.r2dbc.username", "test-username"); + } + @Test @DisplayName("can be disabled") void disabled() { From 704a9d38a6aa5b181dd1a587e5287e85740568ad Mon Sep 17 00:00:00 2001 From: Emily Casey Date: Fri, 29 May 2020 11:47:34 -0400 Subject: [PATCH 2/3] Handles k8s style bindings When a binding is provided as a mounted ConfigMap/Secret pair (containing metadata and secret values respectively) the files within the metadata and secret directories will be symlinks to files in a colocated hidden directory that contains the content. In order to handle bindings presented in this format a Binding object will ignore hidden files and directories when it is contructed using a path. This prevents errors that previously occured when the Binding assumed all metadata and secret entries were regular files, and attempted to read the content of those directories directly. Resolves #40 Signed-off-by: Emily Casey --- .../org/springframework/cloud/bindings/Binding.java | 3 +++ .../springframework/cloud/bindings/BindingTest.java | 13 +++++++++++++ .../cloud/bindings/BindingsTests.java | 3 +-- src/test/resources/test-k8s/metadata/.hidden-data | 1 + .../test-k8s/metadata/.hidden-data-1/.gitkeep | 0 .../resources/test-k8s/metadata/.hidden-data-1/kind | 1 + .../test-k8s/metadata/.hidden-data-1/provider | 1 + src/test/resources/test-k8s/metadata/kind | 1 + src/test/resources/test-k8s/metadata/provider | 1 + src/test/resources/test-k8s/secret/.hidden-data | 1 + .../test-k8s/secret/.hidden-data-1/.gitkeep | 0 .../test-k8s/secret/.hidden-data-1/test-key | 1 + src/test/resources/test-k8s/secret/test-key | 1 + 13 files changed, 25 insertions(+), 2 deletions(-) create mode 120000 src/test/resources/test-k8s/metadata/.hidden-data create mode 100644 src/test/resources/test-k8s/metadata/.hidden-data-1/.gitkeep create mode 100644 src/test/resources/test-k8s/metadata/.hidden-data-1/kind create mode 100644 src/test/resources/test-k8s/metadata/.hidden-data-1/provider create mode 120000 src/test/resources/test-k8s/metadata/kind create mode 120000 src/test/resources/test-k8s/metadata/provider create mode 120000 src/test/resources/test-k8s/secret/.hidden-data create mode 100644 src/test/resources/test-k8s/secret/.hidden-data-1/.gitkeep create mode 100644 src/test/resources/test-k8s/secret/.hidden-data-1/test-key create mode 120000 src/test/resources/test-k8s/secret/test-key diff --git a/src/main/java/org/springframework/cloud/bindings/Binding.java b/src/main/java/org/springframework/cloud/bindings/Binding.java index 9f3f3db..5cfe378 100644 --- a/src/main/java/org/springframework/cloud/bindings/Binding.java +++ b/src/main/java/org/springframework/cloud/bindings/Binding.java @@ -15,6 +15,7 @@ */ package org.springframework.cloud.bindings; +import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; @@ -141,6 +142,8 @@ public final class Binding { private Map createFilePerEntryMap(Path path) { try { return Files.list(path) + .filter(p -> !p.getFileName().toString().startsWith(".")) + .filter(p -> !new File(p.toString()).isDirectory()) .collect(Collectors.toMap( p -> p.getFileName().toString(), p -> { diff --git a/src/test/java/org/springframework/cloud/bindings/BindingTest.java b/src/test/java/org/springframework/cloud/bindings/BindingTest.java index 3d14dbb..228c67c 100644 --- a/src/test/java/org/springframework/cloud/bindings/BindingTest.java +++ b/src/test/java/org/springframework/cloud/bindings/BindingTest.java @@ -39,4 +39,17 @@ final class BindingTest { .isEqualTo(Paths.get("src/test/resources/test-name-1/secret/test-key")); } + @Test + @DisplayName("populates k8s style content from filesystem") + void testK8s() { + //When bindings are provided as a k8s configmap secret pairs data files will be symlinks to hidden directories + Binding binding = new Binding(Paths.get("src/test/resources/test-k8s")); + + assertThat(binding.getKind()).isEqualTo("test-kind-1"); + assertThat(binding.getProvider()).isEqualTo("test-provider-1"); + assertThat(binding.getMetadataFilePath("test-key")) + .isEqualTo(Paths.get("src/test/resources/test-k8s/metadata/test-key")); + assertThat(binding.getSecretFilePath("test-key")) + .isEqualTo(Paths.get("src/test/resources/test-k8s/secret/test-key")); + } } diff --git a/src/test/java/org/springframework/cloud/bindings/BindingsTests.java b/src/test/java/org/springframework/cloud/bindings/BindingsTests.java index 7e40eb5..67b943c 100644 --- a/src/test/java/org/springframework/cloud/bindings/BindingsTests.java +++ b/src/test/java/org/springframework/cloud/bindings/BindingsTests.java @@ -65,7 +65,7 @@ final class BindingsTests { String path = "src/test/resources"; Bindings b = new Bindings(path); - assertThat(b.getBindings()).hasSize(2); + assertThat(b.getBindings()).hasSize(3); } } @@ -102,5 +102,4 @@ final class BindingsTests { } } - } diff --git a/src/test/resources/test-k8s/metadata/.hidden-data b/src/test/resources/test-k8s/metadata/.hidden-data new file mode 120000 index 0000000..b4901b5 --- /dev/null +++ b/src/test/resources/test-k8s/metadata/.hidden-data @@ -0,0 +1 @@ +.hidden-data-1 \ No newline at end of file diff --git a/src/test/resources/test-k8s/metadata/.hidden-data-1/.gitkeep b/src/test/resources/test-k8s/metadata/.hidden-data-1/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/test/resources/test-k8s/metadata/.hidden-data-1/kind b/src/test/resources/test-k8s/metadata/.hidden-data-1/kind new file mode 100644 index 0000000..d08f71b --- /dev/null +++ b/src/test/resources/test-k8s/metadata/.hidden-data-1/kind @@ -0,0 +1 @@ +test-kind-1 diff --git a/src/test/resources/test-k8s/metadata/.hidden-data-1/provider b/src/test/resources/test-k8s/metadata/.hidden-data-1/provider new file mode 100644 index 0000000..0036389 --- /dev/null +++ b/src/test/resources/test-k8s/metadata/.hidden-data-1/provider @@ -0,0 +1 @@ +test-provider-1 diff --git a/src/test/resources/test-k8s/metadata/kind b/src/test/resources/test-k8s/metadata/kind new file mode 120000 index 0000000..d90b3e5 --- /dev/null +++ b/src/test/resources/test-k8s/metadata/kind @@ -0,0 +1 @@ +.hidden-data/kind \ No newline at end of file diff --git a/src/test/resources/test-k8s/metadata/provider b/src/test/resources/test-k8s/metadata/provider new file mode 120000 index 0000000..7ba8004 --- /dev/null +++ b/src/test/resources/test-k8s/metadata/provider @@ -0,0 +1 @@ +.hidden-data/provider \ No newline at end of file diff --git a/src/test/resources/test-k8s/secret/.hidden-data b/src/test/resources/test-k8s/secret/.hidden-data new file mode 120000 index 0000000..b4901b5 --- /dev/null +++ b/src/test/resources/test-k8s/secret/.hidden-data @@ -0,0 +1 @@ +.hidden-data-1 \ No newline at end of file diff --git a/src/test/resources/test-k8s/secret/.hidden-data-1/.gitkeep b/src/test/resources/test-k8s/secret/.hidden-data-1/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/test/resources/test-k8s/secret/.hidden-data-1/test-key b/src/test/resources/test-k8s/secret/.hidden-data-1/test-key new file mode 100644 index 0000000..2278763 --- /dev/null +++ b/src/test/resources/test-k8s/secret/.hidden-data-1/test-key @@ -0,0 +1 @@ +test-value diff --git a/src/test/resources/test-k8s/secret/test-key b/src/test/resources/test-k8s/secret/test-key new file mode 120000 index 0000000..c8d4599 --- /dev/null +++ b/src/test/resources/test-k8s/secret/test-key @@ -0,0 +1 @@ +.hidden-data/test-key \ No newline at end of file From cf71d0851535e20d562b675b1c68e0b634c19b5a Mon Sep 17 00:00:00 2001 From: Emily Casey Date: Mon, 1 Jun 2020 18:19:10 -0400 Subject: [PATCH 3/3] Documents r2dbc properties in README Signed-off-by: Emily Casey --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 00d1298..3acd610 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,9 @@ Disable Property: `org.springframework.cloud.bindings.boot.db2.enable` | `spring.datasource.password` | `{secret/password}` | `spring.datasource.url` | `jdbc:db2://{secret/host}:{secret/port}/{secret/database}` | `spring.datasource.username` | `{secret/username}` +| `spring.r2dbc.url` | `r2dbc:db2://{secret/host}:{secret/port}/{secret/database}` +| `spring.r2dbc.password` | `{secret/password}` +| `spring.r2dbc.username` | `{secret/username}` ### Elasticsearch @@ -127,6 +130,9 @@ Disable Property: `org.springframework.cloud.bindings.boot.mysql.enable` | `spring.datasource.password` | `{secret/password}` | `spring.datasource.url` | `jdbc:mysql://{secret/host}:{secret/port}/{secret/database}` | `spring.datasource.username` | `{secret/username}` +| `spring.r2dbc.url` | `r2dbc:mysql://{secret/host}:{secret/port}/{secret/database}` +| `spring.r2dbc.password` | `{secret/password}` +| `spring.r2dbc.username` | `{secret/username}` ### Neo4J Kind: `Neo4J` @@ -148,6 +154,9 @@ Disable Property: `org.springframework.cloud.bindings.boot.oracle.enable` | `spring.datasource.password` | `{secret/password}` | `spring.datasource.url` | `jdbc:oracle://{secret/host}:{secret/port}/{secret/database}` | `spring.datasource.username` | `{secret/username}` +| `spring.r2dbc.url` | `r2dbc:oracle://{secret/host}:{secret/port}/{secret/database}` +| `spring.r2dbc.password` | `{secret/password}` +| `spring.r2dbc.username` | `{secret/username}` ### PostgreSQL RDBMS Kind: `PostgreSQL` @@ -159,6 +168,9 @@ Disable Property: `org.springframework.cloud.bindings.boot.postgresql.enable` | `spring.datasource.password` | `{secret/password}` | `spring.datasource.url` | `jdbc:postgres://{secret/host}:{secret/port}/{secret/database}` | `spring.datasource.username` | `{secret/username}` +| `spring.r2dbc.url` | `r2dbc:postgres://{secret/host}:{secret/port}/{secret/database}` +| `spring.r2dbc.password` | `{secret/password}` +| `spring.r2dbc.username` | `{secret/username}` ### RabbitMQ RDBMS Kind: `RabbitMQ` @@ -201,6 +213,9 @@ Disable Property: `org.springframework.cloud.bindings.boot.sqlserver.enable` | `spring.datasource.password` | `{secret/password}` | `spring.datasource.url` | `jdbc:sqlserver://{secret/host}:{secret/port}/{secret/database}` | `spring.datasource.username` | `{secret/username}` +| `spring.r2dbc.url` | `r2dbc:sqlserver://{secret/host}:{secret/port}/{secret/database}` +| `spring.r2dbc.password` | `{secret/password}` +| `spring.r2dbc.username` | `{secret/username}` ### Wavefront