Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Nov 9, 2023
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
2 changes: 0 additions & 2 deletions config/crds/troubleshoot.sh_hostcollectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1389,8 +1389,6 @@ spec:
required:
- args
- command
- ignoreParentEnvs
- inheritEnvs
type: object
subnetAvailable:
properties:
Expand Down
2 changes: 0 additions & 2 deletions config/crds/troubleshoot.sh_hostpreflights.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1389,8 +1389,6 @@ spec:
required:
- args
- command
- ignoreParentEnvs
- inheritEnvs
type: object
subnetAvailable:
properties:
Expand Down
2 changes: 0 additions & 2 deletions config/crds/troubleshoot.sh_supportbundles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11720,8 +11720,6 @@ spec:
required:
- args
- command
- ignoreParentEnvs
- inheritEnvs
type: object
subnetAvailable:
properties:
Expand Down
4 changes: 2 additions & 2 deletions examples/collect/host/run-and-save-output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,7 +23,7 @@ spec:
dummy.conf: |-
[hello]
hello = 1

[bye]
bye = 2
dummy.yaml: |-
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/troubleshoot/v1beta2/hostcollector_shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/collect/host_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/collect/host_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
4 changes: 1 addition & 3 deletions schemas/supportbundle-troubleshoot-v1beta2.json
Original file line number Diff line number Diff line change
Expand Up @@ -11472,9 +11472,7 @@
"type": "object",
"required": [
"args",
"command",
"ignoreParentEnvs",
"inheritEnvs"
"command"
],
"properties": {
"args": {
Expand Down
Loading