Skip to content

Commit 74ed8e6

Browse files
committed
wip: resolve conflicts
1 parent c42b4fb commit 74ed8e6

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

cmd/ghalistener/config/config.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,8 @@ func (c *Config) Validate() error {
109109
return fmt.Errorf(`MinRunners "%d" cannot be greater than MaxRunners "%d"`, c.MinRunners, c.MaxRunners)
110110
}
111111

112-
hasToken := len(c.Token) > 0
113-
hasPrivateKeyConfig := len(c.AppID) > 0 && c.AppPrivateKey != ""
114-
115-
if !hasToken && !hasPrivateKeyConfig {
116-
return fmt.Errorf(`GitHub auth credential is missing, token length: "%d", appId: %q, installationId: "%d", private key length: "%d"`, len(c.Token), c.AppID, c.AppInstallationID, len(c.AppPrivateKey))
117-
}
118-
119-
if hasToken && hasPrivateKeyConfig {
120-
return fmt.Errorf(`only one GitHub auth method supported at a time. Have both PAT and App auth: token length: "%d", appId: %q, installationId: "%d", private key length: "%d"`, len(c.Token), c.AppID, c.AppInstallationID, len(c.AppPrivateKey))
112+
if err := c.AppConfig.Validate(); err != nil {
113+
return fmt.Errorf("AppConfig validation failed: %w", err)
121114
}
122115

123116
return nil

controllers/actions.github.com/autoscalingrunnerset_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ func (r *AutoscalingRunnerSetReconciler) createRunnerScaleSet(ctx context.Contex
399399
autoscalingRunnerSet.Spec.RunnerScaleSetName = autoscalingRunnerSet.Name
400400
}
401401
if err != nil {
402-
logger.Error(err, "Failed to initialize Actions service client for creating a new runner scale set")
402+
logger.Error(err, "Failed to initialize Actions service client for creating a new runner scale set", "error", err.Error())
403403
return ctrl.Result{}, err
404404
}
405405

github/actions/multi_client.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package actions
22

33
import (
44
"context"
5+
"fmt"
56
"sync"
67

78
"github.com/actions/actions-runner-controller/apis/actions.github.com/v1alpha1/appconfig"
@@ -52,7 +53,7 @@ func (m *multiClient) GetClientFor(ctx context.Context, githubConfigURL string,
5253
m.logger.Info("retrieve actions client", "githubConfigURL", githubConfigURL, "namespace", namespace)
5354

5455
if err := appConfig.Validate(); err != nil {
55-
return nil, err
56+
return nil, fmt.Errorf("failed to validate app config: %w", err)
5657
}
5758

5859
var creds ActionsAuth
@@ -74,7 +75,7 @@ func (m *multiClient) GetClientFor(ctx context.Context, githubConfigURL string,
7475
}, options...)...,
7576
)
7677
if err != nil {
77-
return nil, err
78+
return nil, fmt.Errorf("failed to instantiate new client: %w", err)
7879
}
7980

8081
m.mu.Lock()

0 commit comments

Comments
 (0)