Refactor actions.Client with options to help extensibility (#2193)

This commit is contained in:
Francesco Renzi
2023-01-23 11:50:14 +00:00
committed by GitHub
parent 282f2dd09c
commit 3327f620fb
11 changed files with 642 additions and 1285 deletions

View File

@@ -84,7 +84,13 @@ func run(rc RunnerScaleSetListenerConfig, logger logr.Logger) error {
}
}
actionsServiceClient, err := actions.NewClient(ctx, rc.ConfigureUrl, creds, fmt.Sprintf("actions-runner-controller/%s", build.Version), logger)
actionsServiceClient, err := actions.NewClient(
ctx,
rc.ConfigureUrl,
creds,
actions.WithUserAgent(fmt.Sprintf("actions-runner-controller/%s", build.Version)),
actions.WithLogger(logger),
)
if err != nil {
return fmt.Errorf("failed to create an Actions Service client: %w", err)
}