Skip to content

Commit 725764e

Browse files
committed
address comment
1 parent 69cb3cc commit 725764e

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

cmd/privateactionrunner/subcommands/ensureenrollment/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ go_library(
1414
"//comp/core/hostname",
1515
"//comp/core/hostname/hostnameimpl",
1616
"//comp/core/log/def",
17-
"//pkg/config/setup",
17+
"//comp/privateactionrunner/def",
1818
"//pkg/privateactionrunner/enrollment",
1919
"//pkg/privateactionrunner/util",
2020
"//pkg/util/fxutil",

cmd/privateactionrunner/subcommands/ensureenrollment/command.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"github.com/DataDog/datadog-agent/comp/core/hostname"
2323
"github.com/DataDog/datadog-agent/comp/core/hostname/hostnameimpl"
2424
log "github.com/DataDog/datadog-agent/comp/core/log/def"
25-
pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup"
25+
par "github.com/DataDog/datadog-agent/comp/privateactionrunner/def"
2626
"github.com/DataDog/datadog-agent/pkg/privateactionrunner/enrollment"
2727
parutil "github.com/DataDog/datadog-agent/pkg/privateactionrunner/util"
2828
"github.com/DataDog/datadog-agent/pkg/util/fxutil"
@@ -57,7 +57,7 @@ func run(logger log.Component, cfg config.Component, hostnameComp hostname.Compo
5757
}
5858

5959
func ensureEnrollment(ctx context.Context, logger log.Component, cfg config.Component, hostnameComp hostname.Component, enrollAndPersist enrollAndPersistFunc) error {
60-
if !cfg.GetBool(pkgconfigsetup.PAREnabled) {
60+
if !cfg.GetBool(par.PAREnabled) {
6161
return errors.New("private_action_runner.enabled is false - set it to true before ensuring enrollment")
6262
}
6363

@@ -88,8 +88,8 @@ func ensureEnrollment(ctx context.Context, logger log.Component, cfg config.Comp
8888
}
8989
}
9090

91-
configuredURN := cfg.GetString(pkgconfigsetup.PARUrn)
92-
configuredPrivateKey := cfg.GetString(pkgconfigsetup.PARPrivateKey)
91+
configuredURN := cfg.GetString(par.PARUrn)
92+
configuredPrivateKey := cfg.GetString(par.PARPrivateKey)
9393
if err := validateConfiguredIdentity(configuredURN, configuredPrivateKey); err != nil {
9494
return err
9595
}
@@ -105,7 +105,7 @@ func ensureEnrollment(ctx context.Context, logger log.Component, cfg config.Comp
105105
return nil
106106
}
107107

108-
if !cfg.GetBool(pkgconfigsetup.PARSelfEnroll) {
108+
if !cfg.GetBool(par.PARSelfEnroll) {
109109
return errors.New("no valid Private Action Runner identity is available and private_action_runner.self_enroll is false; configure a URN and private key or enable self-enrollment")
110110
}
111111

0 commit comments

Comments
 (0)