Skip to content

Commit

Permalink
Stop tailing provider log
Browse files Browse the repository at this point in the history
Its not our duty to trail anything, we already passing a logfile for it
to use, we log our stuff and dont pollute the standar output

Signed-off-by: Itxaka <[email protected]>
  • Loading branch information
Itxaka committed Oct 17, 2023
1 parent 8785c5e commit f611afb
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions internal/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@ package agent

import (
"fmt"
v1 "github.com/kairos-io/kairos-agent/v2/pkg/types/v1"
"os"
"path/filepath"

v1 "github.com/kairos-io/kairos-agent/v2/pkg/types/v1"

hook "github.com/kairos-io/kairos-agent/v2/internal/agent/hooks"
"github.com/kairos-io/kairos-agent/v2/internal/bus"
config "github.com/kairos-io/kairos-agent/v2/pkg/config"
events "github.com/kairos-io/kairos-sdk/bus"
"github.com/kairos-io/kairos-sdk/collector"
"github.com/kairos-io/kairos-sdk/machine"
"github.com/kairos-io/kairos-sdk/utils"
"github.com/nxadm/tail"
)

// Run starts the agent provider emitting the bootstrap event.
Expand Down Expand Up @@ -52,18 +50,6 @@ func Run(opts ...Option) error {
}
}

// Tail to the log
t, err := tail.TailFile(fileName, tail.Config{Follow: true})
if err != nil {
return err
}

go func() {
for line := range t.Lines {
fmt.Println(line.Text)
}
}()

if !machine.SentinelExist("firstboot") {
spec := v1.EmptySpec{}
if err := hook.Run(*c, &spec, hook.FirstBoot...); err != nil {
Expand Down

0 comments on commit f611afb

Please sign in to comment.