Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
Parse NULL as empty for TaskSpec env map (#3184)
Browse files Browse the repository at this point in the history
  • Loading branch information
takirala committed Sep 30, 2019
1 parent 0780761 commit 093effc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions frameworks/helloworld/src/main/dist/svc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pods:
type: ROOT
size: {{HELLO_DISK}}
env:
PARSE_EMPTY_KEY_AS_BLANK_TEST:
SLEEP_DURATION: {{SLEEP_DURATION}}
health-check:
cmd: stat hello-container-path/output
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.mesosphere.sdk.specification.yaml;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import org.apache.mesos.Protos;

import java.util.Collections;
Expand All @@ -20,7 +22,8 @@ public final class RawTask {

private final String labelsCsv;

private final Map<String, String> env;
@JsonSetter(contentNulls = Nulls.AS_EMPTY)
private Map<String, String> env;

private final WriteOnceLinkedHashMap<String, RawConfig> configs;

Expand Down Expand Up @@ -57,7 +60,6 @@ private RawTask(
@JsonProperty("essential") Boolean essential,
@JsonProperty("cmd") String cmd,
@JsonProperty("labels") String labels,
@JsonProperty("env") Map<String, String> env,
@JsonProperty("configs") WriteOnceLinkedHashMap<String, RawConfig> configs,
@JsonProperty("cpus") Double cpus,
@JsonProperty("gpus") Double gpus,
Expand All @@ -78,7 +80,6 @@ private RawTask(
this.essential = essential;
this.cmd = cmd;
this.labelsCsv = labels;
this.env = env;
this.configs = configs;
this.cpus = cpus;
this.gpus = gpus;
Expand Down

0 comments on commit 093effc

Please sign in to comment.