Skip to content

Commit

Permalink
feat(agent): fix options on go-cmd.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luiz Pegoraro committed Oct 16, 2023
1 parent eded89d commit 086d465
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions agent/backend/otel/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ type runningPolicy struct {
processId int
}

var defaultCmdOptions = cmd.Options{
Buffered: false,
Streaming: true,
}

func (o *openTelemetryBackend) ApplyPolicy(newPolicyData policies.PolicyData, updatePolicy bool) error {
if !updatePolicy || !o.policyRepo.Exists(newPolicyData.ID) {
temporaryFile, err := os.CreateTemp(o.policyConfigDirectory, fmt.Sprintf(tempFileNamePattern, newPolicyData.ID))
Expand Down Expand Up @@ -74,7 +69,7 @@ func (o *openTelemetryBackend) ApplyPolicy(newPolicyData policies.PolicyData, up

func (o *openTelemetryBackend) addRunner(policyData policies.PolicyData, policyFilePath string) error {
policyContext, policyCancel := context.WithCancel(context.WithValue(o.mainContext, "policy_id", policyData.ID))
command := cmd.NewCmdOptions(defaultCmdOptions, o.otelExecutablePath, "--config", policyFilePath)
command := cmd.NewCmd(o.otelExecutablePath, "--config", policyFilePath)
var PID chan int
go func(ctx context.Context, logger *zap.Logger) {
status := command.Start()
Expand Down

0 comments on commit 086d465

Please sign in to comment.