Skip to content

Commit ccd453f

Browse files
authored
Handle blank Google application credentials (#16896)
* Handle blank Google application credentials * Use pattern to avoid case issues with conditional beans
1 parent dc328ca commit ccd453f

24 files changed

+77
-71
lines changed

airbyte-workers/src/main/java/io/airbyte/workers/config/ActivityBeanFactory.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class ActivityBeanFactory {
4343

4444
@Singleton
4545
@Requires(property = "airbyte.worker.plane",
46-
notEquals = "DATA_PLANE")
46+
pattern = "(?i)^(?!data_plane).*")
4747
@Named("checkConnectionActivities")
4848
public List<Object> checkConnectionActivities(
4949
final CheckConnectionActivity checkConnectionActivity) {
@@ -52,7 +52,7 @@ public List<Object> checkConnectionActivities(
5252

5353
@Singleton
5454
@Requires(property = "airbyte.worker.plane",
55-
notEquals = "DATA_PLANE")
55+
pattern = "(?i)^(?!data_plane).*")
5656
@Named("connectionManagerActivities")
5757
public List<Object> connectionManagerActivities(
5858
final GenerateInputActivity generateInputActivity,
@@ -79,7 +79,7 @@ public List<Object> connectionManagerActivities(
7979

8080
@Singleton
8181
@Requires(property = "airbyte.worker.plane",
82-
notEquals = "DATA_PLANE")
82+
pattern = "(?i)^(?!data_plane).*")
8383
@Named("discoverActivities")
8484
public List<Object> discoverActivities(
8585
final DiscoverCatalogActivity discoverCatalogActivity) {
@@ -88,7 +88,7 @@ public List<Object> discoverActivities(
8888

8989
@Singleton
9090
@Requires(property = "airbyte.worker.plane",
91-
notEquals = "DATA_PLANE")
91+
pattern = "(?i)^(?!data_plane).*")
9292
@Named("specActivities")
9393
public List<Object> specActivities(
9494
final SpecActivity specActivity) {
@@ -153,7 +153,7 @@ public ActivityOptions shortActivityOptions(@Property(name = "airbyte.activity.m
153153

154154
@Singleton
155155
@Requires(property = "airbyte.worker.plane",
156-
notEquals = "DATA_PLANE")
156+
pattern = "(?i)^(?!data_plane).*")
157157
@Named("specActivityOptions")
158158
public ActivityOptions specActivityOptions() {
159159
return ActivityOptions.newBuilder()

airbyte-workers/src/main/java/io/airbyte/workers/config/ApplicationBeanFactory.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public FeatureFlags featureFlags() {
107107

108108
@Singleton
109109
@Requires(property = "airbyte.worker.plane",
110-
notEquals = "DATA_PLANE")
110+
pattern = "(?i)^(?!data_plane).*")
111111
public JobNotifier jobNotifier(
112112
final ConfigRepository configRepository,
113113
final TrackingClient trackingClient,
@@ -122,7 +122,7 @@ public JobNotifier jobNotifier(
122122

123123
@Singleton
124124
@Requires(property = "airbyte.worker.plane",
125-
notEquals = "DATA_PLANE")
125+
pattern = "(?i)^(?!data_plane).*")
126126
public JobTracker jobTracker(
127127
final ConfigRepository configRepository,
128128
final JobPersistence jobPersistence,
@@ -132,7 +132,7 @@ public JobTracker jobTracker(
132132

133133
@Singleton
134134
@Requires(property = "airbyte.worker.plane",
135-
notEquals = "DATA_PLANE")
135+
pattern = "(?i)^(?!data_plane).*")
136136
public JsonSecretsProcessor jsonSecretsProcessor(final FeatureFlags featureFlags) {
137137
return JsonSecretsProcessor.builder()
138138
.maskSecrets(!featureFlags.exposeSecretsInExport())
@@ -142,14 +142,14 @@ public JsonSecretsProcessor jsonSecretsProcessor(final FeatureFlags featureFlags
142142

143143
@Singleton
144144
@Requires(property = "airbyte.worker.plane",
145-
notEquals = "DATA_PLANE")
145+
pattern = "(?i)^(?!data_plane).*")
146146
public WebUrlHelper webUrlHelper(@Value("${airbyte.web-app.url}") final String webAppUrl) {
147147
return new WebUrlHelper(webAppUrl);
148148
}
149149

150150
@Singleton
151151
@Requires(property = "airbyte.worker.plane",
152-
notEquals = "DATA_PLANE")
152+
pattern = "(?i)^(?!data_plane).*")
153153
public WorkspaceHelper workspaceHelper(
154154
final ConfigRepository configRepository,
155155
final JobPersistence jobPersistence) {

airbyte-workers/src/main/java/io/airbyte/workers/config/CloudStorageBeanFactory.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class CloudStorageBeanFactory {
2323

2424
@Singleton
2525
@Requires(property = "airbyte.cloud.storage.logs.type",
26-
value = "GCS")
26+
pattern = "(?i)^gcs$")
2727
@Named("logStorageConfigs")
2828
public CloudStorageConfigs gcsLogStorageConfigs(
2929
@Value("${airbyte.cloud.storage.logs.gcs.bucket}") final String gcsLogBucket,
@@ -33,7 +33,7 @@ public CloudStorageConfigs gcsLogStorageConfigs(
3333

3434
@Singleton
3535
@Requires(property = "airbyte.cloud.storage.logs.type",
36-
value = "MINIO")
36+
pattern = "(?i)^minio$")
3737
@Named("logStorageConfigs")
3838
public CloudStorageConfigs minioLogStorageConfigs(
3939
@Value("${airbyte.cloud.storage.logs.minio.access-key}") final String awsAccessKeyId,
@@ -45,7 +45,7 @@ public CloudStorageConfigs minioLogStorageConfigs(
4545

4646
@Singleton
4747
@Requires(property = "airbyte.cloud.storage.logs.type",
48-
value = "S3")
48+
pattern = "(?i)^s3$")
4949
@Named("logStorageConfigs")
5050
public CloudStorageConfigs s3LogStorageConfigs(
5151
@Value("${airbyte.cloud.storage.logs.s3.access-key}") final String awsAccessKeyId,
@@ -57,7 +57,7 @@ public CloudStorageConfigs s3LogStorageConfigs(
5757

5858
@Singleton
5959
@Requires(property = "airbyte.cloud.storage.state.type",
60-
value = "GCS")
60+
pattern = "(?i)^gcs$")
6161
@Named("stateStorageConfigs")
6262
public CloudStorageConfigs gcsStateStorageConfiguration(
6363
@Value("${airbyte.cloud.storage.state.gcs.bucket}") final String gcsBucketName,
@@ -67,7 +67,7 @@ public CloudStorageConfigs gcsStateStorageConfiguration(
6767

6868
@Singleton
6969
@Requires(property = "airbyte.cloud.storage.state.type",
70-
value = "MINIO")
70+
pattern = "(?i)^minio$")
7171
@Named("stateStorageConfigs")
7272
public CloudStorageConfigs minioStateStorageConfiguration(
7373
@Value("${airbyte.cloud.storage.state.minio.bucket}") final String bucketName,
@@ -79,7 +79,7 @@ public CloudStorageConfigs minioStateStorageConfiguration(
7979

8080
@Singleton
8181
@Requires(property = "airbyte.cloud.storage.state.type",
82-
value = "S3")
82+
pattern = "(?i)^s3$")
8383
@Named("stateStorageConfigs")
8484
public CloudStorageConfigs s3StateStorageConfiguration(
8585
@Value("${airbyte.cloud.storage.state.s3.bucket}") final String bucketName,

airbyte-workers/src/main/java/io/airbyte/workers/config/DatabaseBeanFactory.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,23 @@ public class DatabaseBeanFactory {
4343

4444
@Singleton
4545
@Requires(property = "airbyte.worker.plane",
46-
notEquals = "DATA_PLANE")
46+
pattern = "(?i)^(?!data_plane).*")
4747
@Named("configDatabase")
4848
public Database configDatabase(@Named("config") final DSLContext dslContext) throws IOException {
4949
return new Database(dslContext);
5050
}
5151

5252
@Singleton
5353
@Requires(property = "airbyte.worker.plane",
54-
notEquals = "DATA_PLANE")
54+
pattern = "(?i)^(?!data_plane).*")
5555
@Named("jobsDatabase")
5656
public Database jobsDatabase(@Named("jobs") final DSLContext dslContext) throws IOException {
5757
return new Database(dslContext);
5858
}
5959

6060
@Singleton
6161
@Requires(property = "airbyte.worker.plane",
62-
notEquals = "DATA_PLANE")
62+
pattern = "(?i)^(?!data_plane).*")
6363
@Named("configFlyway")
6464
public Flyway configFlyway(@Named("config") final FlywayConfigurationProperties configFlywayConfigurationProperties,
6565
@Named("config") final DataSource configDataSource,
@@ -76,7 +76,7 @@ public Flyway configFlyway(@Named("config") final FlywayConfigurationProperties
7676

7777
@Singleton
7878
@Requires(property = "airbyte.worker.plane",
79-
notEquals = "DATA_PLANE")
79+
pattern = "(?i)^(?!data_plane).*")
8080
@Named("jobsFlyway")
8181
public Flyway jobsFlyway(@Named("jobs") final FlywayConfigurationProperties jobsFlywayConfigurationProperties,
8282
@Named("jobs") final DataSource jobsDataSource,
@@ -93,44 +93,44 @@ public Flyway jobsFlyway(@Named("jobs") final FlywayConfigurationProperties jobs
9393

9494
@Singleton
9595
@Requires(property = "airbyte.worker.plane",
96-
notEquals = "DATA_PLANE")
96+
pattern = "(?i)^(?!data_plane).*")
9797
public ConfigPersistence configPersistence(@Named("configDatabase") final Database configDatabase,
9898
final JsonSecretsProcessor jsonSecretsProcessor) {
9999
return DatabaseConfigPersistence.createWithValidation(configDatabase, jsonSecretsProcessor);
100100
}
101101

102102
@Singleton
103103
@Requires(property = "airbyte.worker.plane",
104-
notEquals = "DATA_PLANE")
104+
pattern = "(?i)^(?!data_plane).*")
105105
public ConfigRepository configRepository(@Named("configPersistence") final ConfigPersistence configPersistence,
106106
@Named("configDatabase") final Database configDatabase) {
107107
return new ConfigRepository(configPersistence, configDatabase);
108108
}
109109

110110
@Singleton
111111
@Requires(property = "airbyte.worker.plane",
112-
notEquals = "DATA_PLANE")
112+
pattern = "(?i)^(?!data_plane).*")
113113
public JobPersistence jobPersistence(@Named("jobsDatabase") final Database jobDatabase) {
114114
return new DefaultJobPersistence(jobDatabase);
115115
}
116116

117117
@Singleton
118118
@Requires(property = "airbyte.worker.plane",
119-
notEquals = "DATA_PLANE")
119+
pattern = "(?i)^(?!data_plane).*")
120120
public StatePersistence statePersistence(@Named("configDatabase") final Database configDatabase) {
121121
return new StatePersistence(configDatabase);
122122
}
123123

124124
@Singleton
125125
@Requires(property = "airbyte.worker.plane",
126-
notEquals = "DATA_PLANE")
126+
pattern = "(?i)^(?!data_plane).*")
127127
public StreamResetPersistence streamResetPersistence(@Named("configDatabase") final Database configDatabase) {
128128
return new StreamResetPersistence(configDatabase);
129129
}
130130

131131
@Singleton
132132
@Requires(property = "airbyte.worker.plane",
133-
notEquals = "DATA_PLANE")
133+
pattern = "(?i)^(?!data_plane).*")
134134
@Named("configsDatabaseMigrationCheck")
135135
public DatabaseMigrationCheck configsDatabaseMigrationCheck(@Named("config") final DSLContext dslContext,
136136
@Named("configFlyway") final Flyway configsFlyway,
@@ -144,7 +144,7 @@ public DatabaseMigrationCheck configsDatabaseMigrationCheck(@Named("config") fin
144144

145145
@Singleton
146146
@Requires(property = "airbyte.worker.plane",
147-
notEquals = "DATA_PLANE")
147+
pattern = "(?i)^(?!data_plane).*")
148148
@Named("jobsDatabaseMigrationCheck")
149149
public DatabaseMigrationCheck jobsDatabaseMigrationCheck(@Named("jobs") final DSLContext dslContext,
150150
@Named("jobsFlyway") final Flyway jobsFlyway,
@@ -157,7 +157,7 @@ public DatabaseMigrationCheck jobsDatabaseMigrationCheck(@Named("jobs") final DS
157157

158158
@Singleton
159159
@Requires(property = "airbyte.worker.plane",
160-
notEquals = "DATA_PLANE")
160+
pattern = "(?i)^(?!data_plane).*")
161161
@Named("jobsDatabaseAvailabilityCheck")
162162
public JobsDatabaseAvailabilityCheck jobsDatabaseAvailabilityCheck(@Named("jobs") final DSLContext dslContext) {
163163
return new JobsDatabaseAvailabilityCheck(dslContext, DatabaseConstants.DEFAULT_ASSERT_DATABASE_TIMEOUT_MS);

airbyte-workers/src/main/java/io/airbyte/workers/config/JobErrorReportingBeanFactory.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ public class JobErrorReportingBeanFactory {
2929

3030
@Singleton
3131
@Requires(property = "airbyte.worker.job.error-reporting.strategy",
32-
value = "SENTRY")
32+
pattern = "(?i)^sentry$")
3333
@Requires(property = "airbyte.worker.plane",
34-
notEquals = "DATA_PLANE")
34+
pattern = "(?i)^(?!data_plane).*")
3535
@Named("jobErrorReportingClient")
3636
public JobErrorReportingClient sentryJobErrorReportingClient(
3737
@Value("${airbyte.worker.job.error-reporting.sentry.dsn}") final String sentryDsn) {
@@ -40,17 +40,17 @@ public JobErrorReportingClient sentryJobErrorReportingClient(
4040

4141
@Singleton
4242
@Requires(property = "airbyte.worker.job.error-reporting.strategy",
43-
value = "LOGGING")
43+
pattern = "(?i)^logging$")
4444
@Requires(property = "airbyte.worker.plane",
45-
notEquals = "DATA_PLANE")
45+
pattern = "(?i)^(?!data_plane).*")
4646
@Named("jobErrorReportingClient")
4747
public JobErrorReportingClient loggingJobErrorReportingClient() {
4848
return new LoggingJobErrorReportingClient();
4949
}
5050

5151
@Singleton
5252
@Requires(property = "airbyte.worker.plane",
53-
notEquals = "DATA_PLANE")
53+
pattern = "(?i)^(?!data_plane).*")
5454
public JobErrorReporter jobErrorReporter(
5555
@Value("${airbyte.version}") final String airbyteVersion,
5656
final ConfigRepository configRepository,

airbyte-workers/src/main/java/io/airbyte/workers/config/ProcessFactoryBeanFactory.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class ProcessFactoryBeanFactory {
3131
@Requires(property = "airbyte.worker.env",
3232
pattern = "(?i)^(?!kubernetes$).*")
3333
@Requires(property = "airbyte.worker.plane",
34-
notEquals = "DATA_PLANE")
34+
pattern = "(?i)^(?!data_plane).*")
3535
@Named("checkProcessFactory")
3636
public ProcessFactory checkDockerProcessFactory(
3737
@Named("checkWorkerConfigs") final WorkerConfigs workerConfigs,
@@ -53,7 +53,7 @@ public ProcessFactory checkDockerProcessFactory(
5353
@Requires(property = "airbyte.worker.env",
5454
pattern = "(?i)^kubernetes$")
5555
@Requires(property = "airbyte.worker.plane",
56-
notEquals = "DATA_PLANE")
56+
pattern = "(?i)^(?!data_plane).*")
5757
@Named("checkProcessFactory")
5858
public ProcessFactory checkKubernetesProcessFactory(
5959
@Named("checkWorkerConfigs") final WorkerConfigs workerConfigs,
@@ -103,7 +103,7 @@ public ProcessFactory defaultKubernetesProcessFactory(
103103
@Requires(property = "airbyte.worker.env",
104104
pattern = "(?i)^(?!kubernetes$).*")
105105
@Requires(property = "airbyte.worker.plane",
106-
notEquals = "DATA_PLANE")
106+
pattern = "(?i)^(?!data_plane).*")
107107
@Named("discoverProcessFactory")
108108
public ProcessFactory discoverDockerProcessFactory(
109109
@Named("discoverWorkerConfigs") final WorkerConfigs workerConfigs,
@@ -125,7 +125,7 @@ public ProcessFactory discoverDockerProcessFactory(
125125
@Requires(property = "airbyte.worker.env",
126126
pattern = "(?i)^kubernetes$")
127127
@Requires(property = "airbyte.worker.plane",
128-
notEquals = "DATA_PLANE")
128+
pattern = "(?i)^(?!data_plane).*")
129129
@Named("discoverProcessFactory")
130130
public ProcessFactory discoverKubernetesProcessFactory(
131131
@Named("discoverWorkerConfigs") final WorkerConfigs workerConfigs,
@@ -175,7 +175,7 @@ public ProcessFactory replicationKubernetesProcessFactory(
175175
@Requires(property = "airbyte.worker.env",
176176
pattern = "(?i)^(?!kubernetes$).*")
177177
@Requires(property = "airbyte.worker.plane",
178-
notEquals = "DATA_PLANE")
178+
pattern = "(?i)^(?!data_plane).*")
179179
@Named("specProcessFactory")
180180
public ProcessFactory specDockerProcessFactory(
181181
@Named("specWorkerConfigs") final WorkerConfigs workerConfigs,
@@ -197,7 +197,7 @@ public ProcessFactory specDockerProcessFactory(
197197
@Requires(property = "airbyte.worker.env",
198198
pattern = "(?i)^kubernetes$")
199199
@Requires(property = "airbyte.worker.plane",
200-
notEquals = "DATA_PLANE")
200+
pattern = "(?i)^(?!data_plane).*")
201201
@Named("specProcessFactory")
202202
public ProcessFactory specKubernetesProcessFactory(
203203
@Named("specWorkerConfigs") final WorkerConfigs workerConfigs,

0 commit comments

Comments
 (0)