fix: missing omitempty on 2 of the new fields (#1389)

* fix: missing omitempty on 2 of the new fields

* fix: Rename TS_WORKSPACE_DIR to TS_OUTPUT_DIR

---------

Co-authored-by: Evans Mungai <evans@replicated.com>
This commit is contained in:
Weiyanli Chen(York)
2023-11-09 08:25:11 -05:00
committed by GitHub
parent f6373f3e36
commit bc4856869e
8 changed files with 7 additions and 15 deletions

View File

@@ -1389,8 +1389,6 @@ spec:
required:
- args
- command
- ignoreParentEnvs
- inheritEnvs
type: object
subnetAvailable:
properties:

View File

@@ -1389,8 +1389,6 @@ spec:
required:
- args
- command
- ignoreParentEnvs
- inheritEnvs
type: object
subnetAvailable:
properties:

View File

@@ -11720,8 +11720,6 @@ spec:
required:
- args
- command
- ignoreParentEnvs
- inheritEnvs
type: object
subnetAvailable:
properties:

View File

@@ -10,7 +10,7 @@ spec:
# this is for demonstration purpose only -- you probably don't want to drop your input to the bundle!
args:
- "-c"
- "cat $TS_INPUT_DIR/dummy.yaml > $TS_WORKSPACE_DIR/dummy_content.yaml"
- "cat $TS_INPUT_DIR/dummy.yaml > $TS_OUTPUT_DIR/dummy_content.yaml"
outputDir: "myCommandOutputs"
env:
- AWS_REGION=us-west-1
@@ -23,7 +23,7 @@ spec:
dummy.conf: |-
[hello]
hello = 1
[bye]
bye = 2
dummy.yaml: |-

View File

@@ -185,8 +185,8 @@ type HostRun struct {
OutputDir string `json:"outputDir,omitempty" yaml:"outputDir,omitempty"`
Input map[string]string `json:"input,omitempty" yaml:"input,omitempty"`
Env []string `json:"env,omitempty" yaml:"env,omitempty"`
InheritEnvs []string `json:"inheritEnvs" yaml:"inheritEnvs,omitempty"`
IgnoreParentEnvs bool `json:"ignoreParentEnvs" yaml:"ignoreParentEnvs,omitempty"`
InheritEnvs []string `json:"inheritEnvs,omitempty" yaml:"inheritEnvs,omitempty"`
IgnoreParentEnvs bool `json:"ignoreParentEnvs,omitempty" yaml:"ignoreParentEnvs,omitempty"`
}
type HostCollect struct {

View File

@@ -80,7 +80,7 @@ func (c *CollectHostRun) Collect(progressChan chan<- interface{}) (map[string][]
return nil, errors.New(fmt.Sprintf("failed to create dir for: %s", runHostCollector.OutputDir))
}
cmd.Env = append(cmd.Env,
fmt.Sprintf("TS_WORKSPACE_DIR=%s", cmdOutputTempDir),
fmt.Sprintf("TS_OUTPUT_DIR=%s", cmdOutputTempDir),
)
}

View File

@@ -117,7 +117,7 @@ func TestCollectHostRun_Collect(t *testing.T) {
CollectorName: "my-cmd-with-output",
},
Command: "sh",
Args: []string{"-c", "echo ${TS_INPUT_DIR}/dummy.conf > $TS_WORKSPACE_DIR/input-file.txt"},
Args: []string{"-c", "echo ${TS_INPUT_DIR}/dummy.conf > $TS_OUTPUT_DIR/input-file.txt"},
Input: map[string]string{
"dummy.conf": "[hello]\nhello = 1",
},

View File

@@ -11472,9 +11472,7 @@
"type": "object",
"required": [
"args",
"command",
"ignoreParentEnvs",
"inheritEnvs"
"command"
],
"properties": {
"args": {