mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-07-15 11:29:27 -04:00
bootstrapper: ignore "journald" not in $PATH in constructor
In unit tests, NewCollector may be called on systems that do not have "journalctl" in $PATH. We can defer checking if the command can work by not checking cmd.Err in the constructor.
This commit is contained in:
parent
22d82a59ed
commit
bf06a014a4
1 changed files with 0 additions and 3 deletions
|
@ -30,9 +30,6 @@ type Collector struct {
|
|||
// NewCollector creates a new Collector for journald logs.
|
||||
func NewCollector(ctx context.Context) (*Collector, error) {
|
||||
cmd := exec.CommandContext(ctx, "journalctl")
|
||||
if cmd.Err != nil {
|
||||
return nil, cmd.Err
|
||||
}
|
||||
stdoutPipe, err := cmd.StdoutPipe()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue