diff --git a/util/github/scalesets/runners.go b/util/github/scalesets/runners.go index 252d7e94..79c321bc 100644 --- a/util/github/scalesets/runners.go +++ b/util/github/scalesets/runners.go @@ -45,14 +45,8 @@ func (s *ScaleSetClient) GenerateJitRunnerConfig(ctx context.Context, runnerName return params.RunnerScaleSetJitRunnerConfig{}, fmt.Errorf("failed to ensure admin info: %w", err) } - serviceURL, err := s.actionsServiceInfo.GetURL() - if err != nil { - return params.RunnerScaleSetJitRunnerConfig{}, fmt.Errorf("failed to get pipeline URL: %w", err) - } - jitConfigPath := fmt.Sprintf("/%s/%d/generatejitconfig", scaleSetEndpoint, scaleSetID) - jitConfigURL := serviceURL.JoinPath(jitConfigPath) - - req, err := s.newActionsRequest(ctx, http.MethodPost, jitConfigURL.String(), bytes.NewBuffer(body)) + jitConfigPath := fmt.Sprintf("%s/%d/generatejitconfig", scaleSetEndpoint, scaleSetID) + req, err := s.newActionsRequest(ctx, http.MethodPost, jitConfigPath, bytes.NewBuffer(body)) if err != nil { return params.RunnerScaleSetJitRunnerConfig{}, fmt.Errorf("failed to create request: %w", err) } diff --git a/util/github/scalesets/util.go b/util/github/scalesets/util.go index 15c3a5cf..ac5468bf 100644 --- a/util/github/scalesets/util.go +++ b/util/github/scalesets/util.go @@ -31,11 +31,7 @@ func (s *ScaleSetClient) newActionsRequest(ctx context.Context, method, path str return nil, fmt.Errorf("failed to get pipeline URL: %w", err) } - uri, err := actionsURI.Parse(path) - if err != nil { - return nil, fmt.Errorf("failed to parse path: %w", err) - } - + uri := actionsURI.JoinPath(path) q := uri.Query() if q.Get("api-version") == "" { q.Set("api-version", "6.0-preview") diff --git a/workers/scaleset/scaleset.go b/workers/scaleset/scaleset.go index 5022217a..5226d981 100644 --- a/workers/scaleset/scaleset.go +++ b/workers/scaleset/scaleset.go @@ -671,14 +671,11 @@ Loop: slog.ErrorContext(w.ctx, "error starting listener", "error", err, "consumer_id", w.consumerID) if canceled := w.sleepWithCancel(2 * time.Second); canceled { slog.InfoContext(w.ctx, "worker is stopped; exiting keepListenerAlive") - w.mux.Unlock() return } // we failed to start the listener. Try again. - w.mux.Unlock() continue } - w.mux.Unlock() select { case <-w.quit: