Skip to content

Commit f659f1e

Browse files
authored
[ACTP] align all par configs with the new private_action_runner prefix (#46058)
### What does this PR do? As the title says, aligning PAR configs to follow `private_action_runner` prefix instead of legacy `privateactionrunner`. ### Motivation ### Describe how you validated your changes ``` # tests dda inv test --targets=./pkg/privateactionrunner/... # build and run dda inv privateactionrunner.build go run ./cmd/privateactionrunner run -c dev/dist/datadog.yaml ``` ### Additional Notes Co-authored-by: asiya.shakhmametova <[email protected]>
1 parent 425143c commit f659f1e

File tree

5 files changed

+19
-6
lines changed

5 files changed

+19
-6
lines changed

cmd/privateactionrunner/subcommands/run/command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func runPrivateActionRunner(ctx context.Context, confPath string, extraConfFiles
5252
}),
5353
fx.Supply(core.BundleParams{
5454
ConfigParams: config.NewAgentParams(confPath, config.WithExtraConfFiles(extraConfFiles)),
55-
LogParams: log.ForDaemon(command.LoggerName, "privateactionrunner.log_file", pkgconfigsetup.DefaultPrivateActionRunnerLogFile)}),
55+
LogParams: log.ForDaemon(command.LoggerName, pkgconfigsetup.PARLogFile, pkgconfigsetup.DefaultPrivateActionRunnerLogFile)}),
5656
core.Bundle(),
5757
secretsnoopfx.Module(),
5858
fx.Provide(func(c config.Component) settings.Params {

comp/privateactionrunner/impl/privateactionrunner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ type PrivateActionRunner struct {
6969
func NewComponent(reqs Requires) (Provides, error) {
7070
ctx := context.Background()
7171
if !isEnabled(reqs.Config) {
72-
reqs.Log.Info("private-action-runner is not enabled. Set privateactionrunner.enabled: true in your datadog.yaml file or set the environment variable DD_PRIVATEACTIONRUNNER_ENABLED=true.")
72+
reqs.Log.Info("private-action-runner is not enabled. Set private_action_runner.enabled: true in your datadog.yaml file or set the environment variable DD_PRIVATE_ACTION_RUNNER_ENABLED=true.")
7373
return Provides{}, privateactionrunner.ErrNotEnabled
7474
}
7575

pkg/privateactionrunner/adapters/config/transform.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ const (
4444

4545
func FromDDConfig(config config.Component) (*Config, error) {
4646
ddSite := config.GetString("site")
47-
encodedPrivateKey := config.GetString("privateactionrunner.private_key")
48-
urn := config.GetString("privateactionrunner.urn")
47+
encodedPrivateKey := config.GetString(setup.PARPrivateKey)
48+
urn := config.GetString(setup.PARUrn)
4949

5050
var privateKey *ecdsa.PrivateKey
5151
if encodedPrivateKey != "" {
5252
jwk, err := util.Base64ToJWK(encodedPrivateKey)
5353
if err != nil {
54-
return nil, fmt.Errorf("failed to decode privateactionrunner.private_key: %w", err)
54+
return nil, fmt.Errorf("failed to decode %s: %w", setup.PARPrivateKey, err)
5555
}
5656
privateKey = jwk.Key.(*ecdsa.PrivateKey)
5757
}

releasenotes/notes/add-par-binary-and-run-linux-0d05dcecf3ea2226.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ features:
1010
- |
1111
Add ``privateactionrunner`` binary in Agent artifacts to allow running actions using the Agent,
1212
and enable running it on Linux. The binary is disabled by default. To enable it, set
13-
``privateactionrunner.enabled: true`` in your configuration file.
13+
``private_action_runner.enabled: true`` in your configuration file.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Each section from every release note are combined when the
2+
# CHANGELOG.rst is rendered. So the text needs to be worded so that
3+
# it does not depend on any information only available in another
4+
# section. This may mean repeating some details, but each section
5+
# must be readable independently of the other.
6+
#
7+
# Each section note must be formatted as reStructuredText.
8+
---
9+
fixes:
10+
- |
11+
Align Private Action Runner configuration keys and log guidance to the
12+
``private_action_runner.*`` snake-case names.
13+

0 commit comments

Comments
 (0)