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

Parse NULL as empty for TaskSpec env map #3184

Merged
merged 2 commits into from
Sep 17, 2019
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
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 @@ -21,6 +21,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