Skip to content

Commit

Permalink
Empty init config map check fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
kazhamiakin committed Aug 21, 2024
1 parent 53e57c1 commit 54553a0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ public V1Deployment build(K8sDeploymentRunnable runnable) throws K8sFrameworkExc
List<String> args = buildArgs(runnable);

//check if context build is required
if (runnable.getContextRefs() != null || runnable.getContextSources() != null) {
if (runnable.getContextRefs() != null && !runnable.getContextRefs().isEmpty() ||
runnable.getContextSources() != null && !runnable.getContextSources().isEmpty()) {
// Create sharedVolume
CoreVolume sharedVolume = new CoreVolume(
CoreVolume.VolumeType.empty_dir,
Expand Down Expand Up @@ -308,7 +309,8 @@ public V1Deployment build(K8sDeploymentRunnable runnable) throws K8sFrameworkExc
.imagePullSecrets(buildImagePullSecrets(runnable));

//check if context build is required
if (runnable.getContextRefs() != null || runnable.getContextSources() != null) {
if (runnable.getContextRefs() != null && !runnable.getContextRefs().isEmpty() ||
runnable.getContextSources() != null && !runnable.getContextSources().isEmpty()) {
// Add Init container to the PodTemplateSpec
// Build the Init Container
V1Container initContainer = new V1Container()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ public V1Job build(K8sJobRunnable runnable) throws K8sFrameworkException {
List<String> args = buildArgs(runnable);

//check if context build is required
if (runnable.getContextRefs() != null || runnable.getContextSources() != null) {
if (runnable.getContextRefs() != null && !runnable.getContextRefs().isEmpty() ||
runnable.getContextSources() != null && !runnable.getContextSources().isEmpty()) {
// Create sharedVolume
CoreVolume sharedVolume = new CoreVolume(
CoreVolume.VolumeType.empty_dir,
Expand Down Expand Up @@ -317,7 +318,8 @@ public V1Job build(K8sJobRunnable runnable) throws K8sFrameworkException {
.imagePullSecrets(buildImagePullSecrets(runnable));

//check if context build is required
if (runnable.getContextRefs() != null || runnable.getContextSources() != null) {
if (runnable.getContextRefs() != null && !runnable.getContextRefs().isEmpty() ||
runnable.getContextSources() != null && !runnable.getContextSources().isEmpty()) {
// Add Init container to the PodTemplateSpec
// Build the Init Container
V1Container initContainer = new V1Container()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,8 @@ public V1Deployment buildDeployment(K8sServeRunnable runnable) throws K8sFramewo
List<String> args = buildArgs(runnable);

//check if context build is required
if (runnable.getContextRefs() != null || runnable.getContextSources() != null) {
if (runnable.getContextRefs() != null && !runnable.getContextRefs().isEmpty() ||
runnable.getContextSources() != null && !runnable.getContextSources().isEmpty()) {
// Create sharedVolume
CoreVolume sharedVolume = new CoreVolume(
CoreVolume.VolumeType.empty_dir,
Expand Down Expand Up @@ -502,7 +503,8 @@ public V1Deployment buildDeployment(K8sServeRunnable runnable) throws K8sFramewo
.imagePullSecrets(buildImagePullSecrets(runnable));

//check if context build is required
if (runnable.getContextRefs() != null || runnable.getContextSources() != null) {
if (runnable.getContextRefs() != null && !runnable.getContextRefs().isEmpty() ||
runnable.getContextSources() != null && !runnable.getContextSources().isEmpty()) {
// Add Init container to the PodTemplateSpec
// Build the Init Container
V1Container initContainer = new V1Container()
Expand Down

0 comments on commit 54553a0

Please sign in to comment.