Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect naming in application.yml #20494

Merged
merged 4 commits into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ public Map<String, String> isolatedNodeSelectors(@Value("${airbyte.worker.isolat
}

@Singleton
@Named("useIsolatedNodeSelector")
public boolean useIsolatedNodeSelector(@Value("${airbyte.worker.isolated.kube.use-isolated-node-selector}") final boolean kubeNodeSelectors) {
@Named("useCustomNodeSelector")
public boolean useCustomNodeSelector(@Value("${airbyte.worker.isolated.kube.use-custom-node-selector}") final boolean kubeNodeSelectors) {
return kubeNodeSelectors;
}

Expand Down Expand Up @@ -210,9 +210,9 @@ public ResourceRequirements replicationResourceRequirements(
.withMemoryLimit(memoryLimit);
}

void validateIsolatedPoolConfigInitialization(boolean useIsolatedNodeSelector, Map<String, String> isolatedNodeSelectors) {
if (useIsolatedNodeSelector && isolatedNodeSelectors.isEmpty()) {
throw new RuntimeException("Isolated Node selectors is empty while useIsolatedNodeSelector is set to true.");
void validateIsolatedPoolConfigInitialization(boolean useCustomNodeSelector, Map<String, String> isolatedNodeSelectors) {
if (useCustomNodeSelector && isolatedNodeSelectors.isEmpty()) {
throw new RuntimeException("Isolated Node selectors is empty while useCustomNodeSelector is set to true.");
}
}

Expand All @@ -225,7 +225,7 @@ public WorkerConfigs checkWorkerConfigs(
final List<TolerationPOJO> jobKubeTolerations,
@Named("checkJobKubeNodeSelectors") final Map<String, String> nodeSelectors,
@Named("isolatedNodeSelectors") final Map<String, String> isolatedNodeSelectors,
@Named("useIsolatedNodeSelector") final boolean useIsolatedNodeSelector,
@Named("useCustomNodeSelector") final boolean useCustomNodeSelector,
@Named("checkJobKubeAnnotations") final Map<String, String> annotations,
@Value("${airbyte.worker.job.kube.main.container.image-pull-secret}") final List<String> mainContainerImagePullSecret,
@Value("${airbyte.worker.job.kube.main.container.image-pull-policy}") final String mainContainerImagePullPolicy,
Expand All @@ -234,13 +234,13 @@ public WorkerConfigs checkWorkerConfigs(
@Value("${airbyte.worker.job.kube.images.busybox}") final String busyboxImage,
@Value("${airbyte.worker.job.kube.images.curl}") final String curlImage,
@Named("jobDefaultEnvMap") final Map<String, String> jobDefaultEnvMap) {
validateIsolatedPoolConfigInitialization(useIsolatedNodeSelector, isolatedNodeSelectors);
validateIsolatedPoolConfigInitialization(useCustomNodeSelector, isolatedNodeSelectors);
return new WorkerConfigs(
workerEnvironment,
resourceRequirements,
jobKubeTolerations,
nodeSelectors,
useIsolatedNodeSelector ? Optional.of(isolatedNodeSelectors) : Optional.empty(),
useCustomNodeSelector ? Optional.of(isolatedNodeSelectors) : Optional.empty(),
annotations,
mainContainerImagePullSecret,
mainContainerImagePullPolicy,
Expand All @@ -259,7 +259,7 @@ public WorkerConfigs defaultWorkerConfigs(
final List<TolerationPOJO> jobKubeTolerations,
@Named("defaultJobKubeNodeSelectors") final Map<String, String> nodeSelectors,
@Named("isolatedNodeSelectors") final Map<String, String> isolatedNodeSelectors,
@Named("useIsolatedNodeSelector") final boolean useIsolatedNodeSelector,
@Named("useCustomNodeSelector") final boolean useCustomNodeSelector,
@Named("defaultJobKubeAnnotations") final Map<String, String> annotations,
@Value("${airbyte.worker.job.kube.main.container.image-pull-secret}") final List<String> mainContainerImagePullSecret,
@Value("${airbyte.worker.job.kube.main.container.image-pull-policy}") final String mainContainerImagePullPolicy,
Expand All @@ -268,13 +268,13 @@ public WorkerConfigs defaultWorkerConfigs(
@Value("${airbyte.worker.job.kube.images.busybox}") final String busyboxImage,
@Value("${airbyte.worker.job.kube.images.curl}") final String curlImage,
@Named("jobDefaultEnvMap") final Map<String, String> jobDefaultEnvMap) {
validateIsolatedPoolConfigInitialization(useIsolatedNodeSelector, isolatedNodeSelectors);
validateIsolatedPoolConfigInitialization(useCustomNodeSelector, isolatedNodeSelectors);
return new WorkerConfigs(
workerEnvironment,
resourceRequirements,
jobKubeTolerations,
nodeSelectors,
useIsolatedNodeSelector ? Optional.of(isolatedNodeSelectors) : Optional.empty(),
useCustomNodeSelector ? Optional.of(isolatedNodeSelectors) : Optional.empty(),
annotations,
mainContainerImagePullSecret,
mainContainerImagePullPolicy,
Expand All @@ -294,7 +294,7 @@ public WorkerConfigs discoverWorkerConfigs(
final List<TolerationPOJO> jobKubeTolerations,
@Named("discoverJobKubeNodeSelectors") final Map<String, String> nodeSelectors,
@Named("isolatedNodeSelectors") final Map<String, String> isolatedNodeSelectors,
@Named("useIsolatedNodeSelector") final boolean useIsolatedNodeSelector,
@Named("useCustomNodeSelector") final boolean useCustomNodeSelector,
@Named("discoverJobKubeAnnotations") final Map<String, String> annotations,
@Value("${airbyte.worker.job.kube.main.container.image-pull-secret}") final List<String> mainContainerImagePullSecret,
@Value("${airbyte.worker.job.kube.main.container.image-pull-policy}") final String mainContainerImagePullPolicy,
Expand All @@ -303,13 +303,13 @@ public WorkerConfigs discoverWorkerConfigs(
@Value("${airbyte.worker.job.kube.images.busybox}") final String busyboxImage,
@Value("${airbyte.worker.job.kube.images.curl}") final String curlImage,
@Named("jobDefaultEnvMap") final Map<String, String> jobDefaultEnvMap) {
validateIsolatedPoolConfigInitialization(useIsolatedNodeSelector, isolatedNodeSelectors);
validateIsolatedPoolConfigInitialization(useCustomNodeSelector, isolatedNodeSelectors);
return new WorkerConfigs(
workerEnvironment,
resourceRequirements,
jobKubeTolerations,
nodeSelectors,
useIsolatedNodeSelector ? Optional.of(isolatedNodeSelectors) : Optional.empty(),
useCustomNodeSelector ? Optional.of(isolatedNodeSelectors) : Optional.empty(),
annotations,
mainContainerImagePullSecret,
mainContainerImagePullPolicy,
Expand All @@ -328,7 +328,7 @@ public WorkerConfigs replicationWorkerConfigs(
final List<TolerationPOJO> jobKubeTolerations,
@Named("defaultJobKubeNodeSelectors") final Map<String, String> nodeSelectors,
@Named("isolatedNodeSelectors") final Map<String, String> isolatedNodeSelectors,
@Named("useIsolatedNodeSelector") final boolean useIsolatedNodeSelector,
@Named("useCustomNodeSelector") final boolean useCustomNodeSelector,
@Named("defaultJobKubeAnnotations") final Map<String, String> annotations,
@Value("${airbyte.worker.job.kube.main.container.image-pull-secret}") final List<String> mainContainerImagePullSecret,
@Value("${airbyte.worker.job.kube.main.container.image-pull-policy}") final String mainContainerImagePullPolicy,
Expand All @@ -337,13 +337,13 @@ public WorkerConfigs replicationWorkerConfigs(
@Value("${airbyte.worker.job.kube.images.busybox}") final String busyboxImage,
@Value("${airbyte.worker.job.kube.images.curl}") final String curlImage,
@Named("jobDefaultEnvMap") final Map<String, String> jobDefaultEnvMap) {
validateIsolatedPoolConfigInitialization(useIsolatedNodeSelector, isolatedNodeSelectors);
validateIsolatedPoolConfigInitialization(useCustomNodeSelector, isolatedNodeSelectors);
return new WorkerConfigs(
workerEnvironment,
resourceRequirements,
jobKubeTolerations,
nodeSelectors,
useIsolatedNodeSelector ? Optional.of(isolatedNodeSelectors) : Optional.empty(),
useCustomNodeSelector ? Optional.of(isolatedNodeSelectors) : Optional.empty(),
annotations,
mainContainerImagePullSecret,
mainContainerImagePullPolicy,
Expand All @@ -363,7 +363,7 @@ public WorkerConfigs specWorkerConfigs(
final List<TolerationPOJO> jobKubeTolerations,
@Named("specJobKubeNodeSelectors") final Map<String, String> nodeSelectors,
@Named("isolatedNodeSelectors") final Map<String, String> isolatedNodeSelectors,
@Named("useIsolatedNodeSelector") final boolean useIsolatedNodeSelector,
@Named("useCustomNodeSelector") final boolean useCustomNodeSelector,
@Named("specJobKubeAnnotations") final Map<String, String> annotations,
@Value("${airbyte.worker.job.kube.main.container.image-pull-secret}") final List<String> mainContainerImagePullSecret,
@Value("${airbyte.worker.job.kube.main.container.image-pull-policy}") final String mainContainerImagePullPolicy,
Expand All @@ -372,13 +372,13 @@ public WorkerConfigs specWorkerConfigs(
@Value("${airbyte.worker.job.kube.images.busybox}") final String busyboxImage,
@Value("${airbyte.worker.job.kube.images.curl}") final String curlImage,
@Named("jobDefaultEnvMap") final Map<String, String> jobDefaultEnvMap) {
validateIsolatedPoolConfigInitialization(useIsolatedNodeSelector, isolatedNodeSelectors);
validateIsolatedPoolConfigInitialization(useCustomNodeSelector, isolatedNodeSelectors);
return new WorkerConfigs(
workerEnvironment,
resourceRequirements,
jobKubeTolerations,
nodeSelectors,
useIsolatedNodeSelector ? Optional.of(isolatedNodeSelectors) : Optional.empty(),
useCustomNodeSelector ? Optional.of(isolatedNodeSelectors) : Optional.empty(),
annotations,
mainContainerImagePullSecret,
mainContainerImagePullPolicy,
Expand Down
4 changes: 2 additions & 2 deletions airbyte-workers/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ airbyte:
request: ${CHECK_JOB_MAIN_CONTAINER_MEMORY_REQUEST:}
isolated:
kube:
use-isolated-node-selector: ${USE_ISOLATED_NODE_SELECTOR:false}
node-selectors: ${ISOLATED_JOB_KUBE_NODE_SELECTORS:}
use-custom-node-selector: ${USE_CUSTOM_NODE_SELECTOR:false}
node-selectors: ${JOB_ISOLATED_KUBE_NODE_SELECTORS:}
connection:
enabled: ${SHOULD_RUN_CONNECTION_MANAGER_WORKFLOWS:true}
discover:
Expand Down