Skip to content

Commit bc48568

Browse files
cwyl02banjoh
andauthored
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 <[email protected]>
1 parent f6373f3 commit bc48568

File tree

8 files changed

+7
-15
lines changed

8 files changed

+7
-15
lines changed

config/crds/troubleshoot.sh_hostcollectors.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,8 +1389,6 @@ spec:
13891389
required:
13901390
- args
13911391
- command
1392-
- ignoreParentEnvs
1393-
- inheritEnvs
13941392
type: object
13951393
subnetAvailable:
13961394
properties:

config/crds/troubleshoot.sh_hostpreflights.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,8 +1389,6 @@ spec:
13891389
required:
13901390
- args
13911391
- command
1392-
- ignoreParentEnvs
1393-
- inheritEnvs
13941392
type: object
13951393
subnetAvailable:
13961394
properties:

config/crds/troubleshoot.sh_supportbundles.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11720,8 +11720,6 @@ spec:
1172011720
required:
1172111721
- args
1172211722
- command
11723-
- ignoreParentEnvs
11724-
- inheritEnvs
1172511723
type: object
1172611724
subnetAvailable:
1172711725
properties:

examples/collect/host/run-and-save-output.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spec:
1010
# this is for demonstration purpose only -- you probably don't want to drop your input to the bundle!
1111
args:
1212
- "-c"
13-
- "cat $TS_INPUT_DIR/dummy.yaml > $TS_WORKSPACE_DIR/dummy_content.yaml"
13+
- "cat $TS_INPUT_DIR/dummy.yaml > $TS_OUTPUT_DIR/dummy_content.yaml"
1414
outputDir: "myCommandOutputs"
1515
env:
1616
- AWS_REGION=us-west-1
@@ -23,7 +23,7 @@ spec:
2323
dummy.conf: |-
2424
[hello]
2525
hello = 1
26-
26+
2727
[bye]
2828
bye = 2
2929
dummy.yaml: |-

pkg/apis/troubleshoot/v1beta2/hostcollector_shared.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ type HostRun struct {
185185
OutputDir string `json:"outputDir,omitempty" yaml:"outputDir,omitempty"`
186186
Input map[string]string `json:"input,omitempty" yaml:"input,omitempty"`
187187
Env []string `json:"env,omitempty" yaml:"env,omitempty"`
188-
InheritEnvs []string `json:"inheritEnvs" yaml:"inheritEnvs,omitempty"`
189-
IgnoreParentEnvs bool `json:"ignoreParentEnvs" yaml:"ignoreParentEnvs,omitempty"`
188+
InheritEnvs []string `json:"inheritEnvs,omitempty" yaml:"inheritEnvs,omitempty"`
189+
IgnoreParentEnvs bool `json:"ignoreParentEnvs,omitempty" yaml:"ignoreParentEnvs,omitempty"`
190190
}
191191

192192
type HostCollect struct {

pkg/collect/host_run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (c *CollectHostRun) Collect(progressChan chan<- interface{}) (map[string][]
8080
return nil, errors.New(fmt.Sprintf("failed to create dir for: %s", runHostCollector.OutputDir))
8181
}
8282
cmd.Env = append(cmd.Env,
83-
fmt.Sprintf("TS_WORKSPACE_DIR=%s", cmdOutputTempDir),
83+
fmt.Sprintf("TS_OUTPUT_DIR=%s", cmdOutputTempDir),
8484
)
8585
}
8686

pkg/collect/host_run_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func TestCollectHostRun_Collect(t *testing.T) {
117117
CollectorName: "my-cmd-with-output",
118118
},
119119
Command: "sh",
120-
Args: []string{"-c", "echo ${TS_INPUT_DIR}/dummy.conf > $TS_WORKSPACE_DIR/input-file.txt"},
120+
Args: []string{"-c", "echo ${TS_INPUT_DIR}/dummy.conf > $TS_OUTPUT_DIR/input-file.txt"},
121121
Input: map[string]string{
122122
"dummy.conf": "[hello]\nhello = 1",
123123
},

schemas/supportbundle-troubleshoot-v1beta2.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11472,9 +11472,7 @@
1147211472
"type": "object",
1147311473
"required": [
1147411474
"args",
11475-
"command",
11476-
"ignoreParentEnvs",
11477-
"inheritEnvs"
11475+
"command"
1147811476
],
1147911477
"properties": {
1148011478
"args": {

0 commit comments

Comments
 (0)