You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get rid of Linux specific scripts as much as possible (#1072)
If we are to support Windows nodes, we want to avoid using bash scripts
so that we don't have to duplicate the logic and translate it into a
powershell script.
Changes include:
- remove the run_master.sh script and instead rely on the Dockerfile
to have the proper aggregator invocation. This way, regardless of the
underlying OS, the image knows the right command to use.
- remove the script for running the worker in single-node mode. This
only served to run Sonobuoy and then sleep for some amount of time to
avoid restarting the container. Instead, a flag was added to the
single-node command and golang handles the sleep functionality now. By
default it sleeps 0 seconds, consistent with the existing logic.
- Slight modifications to command structure so that the subcommands
can use the cobra RunE method and logging can be done at the top level
only. This helps avoid using `os.Exit` which hinders testability.
xref #732
Signed-off-by: John Schnake <[email protected]>
Short: "Submit results scoped to the whole cluster",
62
-
Run: runGatherGlobal,
63
-
Args: cobra.ExactArgs(0),
59
+
funcnewGlobalCmd() *cobra.Command {
60
+
cmd:=&cobra.Command{
61
+
Use: "global",
62
+
Short: "Submit results scoped to the whole cluster",
63
+
RunE: runGatherGlobal,
64
+
Args: cobra.ExactArgs(0),
65
+
}
66
+
67
+
returncmd
64
68
}
65
69
66
-
varsingleNodeCmd=&cobra.Command{
67
-
Use: "single-node",
68
-
Short: "Submit results scoped to a single node",
69
-
Run: runGatherSingleNode,
70
-
Args: cobra.ExactArgs(0),
70
+
funcnewSingleNodeCmd() *cobra.Command {
71
+
varsleepint64
72
+
cmd:=&cobra.Command{
73
+
Use: "single-node",
74
+
Short: "Submit results scoped to a single node",
75
+
RunE: runGatherSingleNode(&sleep),
76
+
Args: cobra.ExactArgs(0),
77
+
}
78
+
79
+
cmd.Flags().Int64Var(&sleep, "sleep", 0, "After sending results, keeps the process alive for N seconds to avoid restarting the container. If N<0, Sonobuoy sleeps forever.")
80
+
returncmd
71
81
}
72
82
73
83
// sigHandler returns a channel that will receive a message after the timeout
0 commit comments