wip: resolve conflicts

This commit is contained in:
Nikola Jokic 2025-06-04 20:07:43 +02:00
parent c42b4fb2d2
commit 74ed8e6838
No known key found for this signature in database
GPG Key ID: E4104494F9B8DDF6
3 changed files with 6 additions and 12 deletions

View File

@ -109,15 +109,8 @@ func (c *Config) Validate() error {
return fmt.Errorf(`MinRunners "%d" cannot be greater than MaxRunners "%d"`, c.MinRunners, c.MaxRunners)
}
hasToken := len(c.Token) > 0
hasPrivateKeyConfig := len(c.AppID) > 0 && c.AppPrivateKey != ""
if !hasToken && !hasPrivateKeyConfig {
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))
}
if hasToken && hasPrivateKeyConfig {
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))
if err := c.AppConfig.Validate(); err != nil {
return fmt.Errorf("AppConfig validation failed: %w", err)
}
return nil

View File

@ -399,7 +399,7 @@ func (r *AutoscalingRunnerSetReconciler) createRunnerScaleSet(ctx context.Contex
autoscalingRunnerSet.Spec.RunnerScaleSetName = autoscalingRunnerSet.Name
}
if err != nil {
logger.Error(err, "Failed to initialize Actions service client for creating a new runner scale set")
logger.Error(err, "Failed to initialize Actions service client for creating a new runner scale set", "error", err.Error())
return ctrl.Result{}, err
}

View File

@ -2,6 +2,7 @@ package actions
import (
"context"
"fmt"
"sync"
"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,
m.logger.Info("retrieve actions client", "githubConfigURL", githubConfigURL, "namespace", namespace)
if err := appConfig.Validate(); err != nil {
return nil, err
return nil, fmt.Errorf("failed to validate app config: %w", err)
}
var creds ActionsAuth
@ -74,7 +75,7 @@ func (m *multiClient) GetClientFor(ctx context.Context, githubConfigURL string,
}, options...)...,
)
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to instantiate new client: %w", err)
}
m.mu.Lock()