Clean up import list (#645)

Resolves #644
This commit is contained in:
Yusuke Kuoka
2021-06-22 17:55:06 +09:00
committed by GitHub
parent a277489003
commit 8b90b0f0e3
35 changed files with 75 additions and 73 deletions

View File

@@ -1,5 +1,5 @@
domain: summerwind.dev domain: summerwind.dev
repo: github.com/summerwind/actions-runner-controller repo: github.com/actions-runner-controller/actions-runner-controller
resources: resources:
- group: actions - group: actions
kind: Runner kind: Runner

View File

@@ -222,7 +222,7 @@ kind: Runner
metadata: metadata:
name: example-runner name: example-runner
spec: spec:
repository: summerwind/actions-runner-controller repository: actions-runner-controller/actions-runner-controller
env: [] env: []
``` ```
@@ -238,7 +238,7 @@ You can see that the Runner resource has been created.
```shell ```shell
$ kubectl get runners $ kubectl get runners
NAME REPOSITORY STATUS NAME REPOSITORY STATUS
example-runner summerwind/actions-runner-controller Running example-runner actions-runner-controller/actions-runner-controller Running
``` ```
You can also see that the runner pod has been running. You can also see that the runner pod has been running.
@@ -390,7 +390,7 @@ metadata:
spec: spec:
template: template:
spec: spec:
repository: summerwind/actions-runner-controller repository: actions-runner-controller/actions-runner-controller
--- ---
apiVersion: actions.summerwind.dev/v1alpha1 apiVersion: actions.summerwind.dev/v1alpha1
kind: HorizontalRunnerAutoscaler kind: HorizontalRunnerAutoscaler
@@ -404,7 +404,7 @@ spec:
metrics: metrics:
- type: TotalNumberOfQueuedAndInProgressWorkflowRuns - type: TotalNumberOfQueuedAndInProgressWorkflowRuns
repositoryNames: repositoryNames:
- summerwind/actions-runner-controller - actions-runner-controller/actions-runner-controller
``` ```
Additionally, the `HorizontalRunnerAutoscaler` also has an anti-flapping option that prevents periodic loop of scaling up and down. Additionally, the `HorizontalRunnerAutoscaler` also has an anti-flapping option that prevents periodic loop of scaling up and down.
@@ -866,7 +866,7 @@ spec:
replicas: 1 replicas: 1
template: template:
spec: spec:
repository: summerwind/actions-runner-controller repository: actions-runner-controller/actions-runner-controller
labels: labels:
- custom-runner - custom-runner
``` ```
@@ -971,7 +971,7 @@ kind: Runner
metadata: metadata:
name: custom-runner name: custom-runner
spec: spec:
repository: summerwind/actions-runner-controller repository: actions-runner-controller/actions-runner-controller
image: YOUR_CUSTOM_DOCKER_IMAGE image: YOUR_CUSTOM_DOCKER_IMAGE
``` ```
@@ -1170,7 +1170,7 @@ If you don't want to use `make`, like when you're running tests from your IDE, i
sudo mkdir -p /usr/local/kubebuilder/bin sudo mkdir -p /usr/local/kubebuilder/bin
make kube-apiserver etcd make kube-apiserver etcd
sudo mv test-assets/{etcd,kube-apiserver} /usr/local/kubebuilder/bin/ sudo mv test-assets/{etcd,kube-apiserver} /usr/local/kubebuilder/bin/
go test -v -run TestAPIs github.com/summerwind/actions-runner-controller/controllers go test -v -run TestAPIs github.com/actions-runner-controller/actions-runner-controller/controllers
``` ```
To run Ginkgo tests selectively, set the pattern of target test names to `GINKGO_FOCUS`. To run Ginkgo tests selectively, set the pattern of target test names to `GINKGO_FOCUS`.
@@ -1178,5 +1178,5 @@ All the Ginkgo test that matches `GINKGO_FOCUS` will be run.
```bash ```bash
GINKGO_FOCUS='[It] should create a new Runner resource from the specified template, add a another Runner on replicas increased, and removes all the replicas when set to 0' \ GINKGO_FOCUS='[It] should create a new Runner resource from the specified template, add a another Runner on replicas increased, and removes all the replicas when set to 0' \
go test -v -run TestAPIs github.com/summerwind/actions-runner-controller/controllers go test -v -run TestAPIs github.com/actions-runner-controller/actions-runner-controller/controllers
``` ```

View File

@@ -21,7 +21,7 @@ _Default values are the defaults set in the charts values.yaml, some properties
| `authSecret.github_app_installation_id` | The ID of your GitHub App installation. **This can't be set at the same time as `authSecret.github_token`** | | | `authSecret.github_app_installation_id` | The ID of your GitHub App installation. **This can't be set at the same time as `authSecret.github_token`** | |
| `authSecret.github_app_private_key` | The multiline string of your GitHub App's private key. **This can't be set at the same time as `authSecret.github_token`** | | | `authSecret.github_app_private_key` | The multiline string of your GitHub App's private key. **This can't be set at the same time as `authSecret.github_token`** | |
| `authSecret.github_token` | Your chosen GitHub PAT token. **This can't be set at the same time as the `authSecret.github_app_*`** | | | `authSecret.github_token` | Your chosen GitHub PAT token. **This can't be set at the same time as the `authSecret.github_app_*`** | |
| `image.repository` | The "repository/image" of the controller container | summerwind/actions-runner-controller | | `image.repository` | The "repository/image" of the controller container | actions-runner-controller/actions-runner-controller |
| `image.tag` | The tag of the controller container | | | `image.tag` | The tag of the controller container | |
| `image.dindSidecarRepositoryAndTag` | The "repository/image" of the dind sidecar container | docker:dind | | `image.dindSidecarRepositoryAndTag` | The "repository/image" of the dind sidecar container | docker:dind |
| `image.pullPolicy` | The pull policy of the controller image | IfNotPresent | | `image.pullPolicy` | The pull policy of the controller image | IfNotPresent |

View File

@@ -26,7 +26,7 @@ authSecret:
#github_token: "" #github_token: ""
image: image:
repository: summerwind/actions-runner-controller repository: actions-runner-controller/actions-runner-controller
dindSidecarRepositoryAndTag: "docker:dind" dindSidecarRepositoryAndTag: "docker:dind"
pullPolicy: IfNotPresent pullPolicy: IfNotPresent

View File

@@ -25,8 +25,8 @@ import (
"sync" "sync"
"time" "time"
actionsv1alpha1 "github.com/summerwind/actions-runner-controller/api/v1alpha1" actionsv1alpha1 "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/summerwind/actions-runner-controller/controllers" "github.com/actions-runner-controller/actions-runner-controller/controllers"
zaplib "go.uber.org/zap" zaplib "go.uber.org/zap"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme" clientgoscheme "k8s.io/client-go/kubernetes/scheme"

View File

@@ -3,4 +3,4 @@ kind: Runner
metadata: metadata:
name: summerwind-actions-runner-controller name: summerwind-actions-runner-controller
spec: spec:
repository: summerwind/actions-runner-controller repository: actions-runner-controller/actions-runner-controller

View File

@@ -6,4 +6,4 @@ spec:
replicas: 2 replicas: 2
template: template:
spec: spec:
repository: summerwind/actions-runner-controller repository: actions-runner-controller/actions-runner-controller

View File

@@ -6,4 +6,4 @@ spec:
replicas: 2 replicas: 2
template: template:
spec: spec:
repository: summerwind/actions-runner-controller repository: actions-runner-controller/actions-runner-controller

View File

@@ -9,7 +9,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/summerwind/actions-runner-controller/api/v1alpha1" "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
kerrors "k8s.io/apimachinery/pkg/api/errors" kerrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client"
@@ -142,7 +142,7 @@ func (r *HorizontalRunnerAutoscalerReconciler) suggestReplicasByQueuedAndInProgr
// In case it's an organizational runners deployment without any scaling metrics defined, // In case it's an organizational runners deployment without any scaling metrics defined,
// we assume that the desired replicas should always be `minReplicas + capacityReservedThroughWebhook`. // we assume that the desired replicas should always be `minReplicas + capacityReservedThroughWebhook`.
// See https://github.com/summerwind/actions-runner-controller/issues/377#issuecomment-793372693 // See https://github.com/actions-runner-controller/actions-runner-controller/issues/377#issuecomment-793372693
if metrics == nil { if metrics == nil {
return nil, nil return nil, nil
} }

View File

@@ -6,9 +6,9 @@ import (
"net/url" "net/url"
"testing" "testing"
"github.com/summerwind/actions-runner-controller/api/v1alpha1" "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/summerwind/actions-runner-controller/github" "github.com/actions-runner-controller/actions-runner-controller/github"
"github.com/summerwind/actions-runner-controller/github/fake" "github.com/actions-runner-controller/actions-runner-controller/github/fake"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme" clientgoscheme "k8s.io/client-go/kubernetes/scheme"

View File

@@ -35,7 +35,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime" ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client"
"github.com/summerwind/actions-runner-controller/api/v1alpha1" "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
) )
const ( const (

View File

@@ -1,9 +1,9 @@
package controllers package controllers
import ( import (
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/actions-runner-controller/actions-runner-controller/pkg/actionsglob"
"github.com/google/go-github/v33/github" "github.com/google/go-github/v33/github"
"github.com/summerwind/actions-runner-controller/api/v1alpha1"
"github.com/summerwind/actions-runner-controller/pkg/actionsglob"
) )
func (autoscaler *HorizontalRunnerAutoscalerGitHubWebhook) MatchCheckRunEvent(event *github.CheckRunEvent) func(scaleUpTrigger v1alpha1.ScaleUpTrigger) bool { func (autoscaler *HorizontalRunnerAutoscalerGitHubWebhook) MatchCheckRunEvent(event *github.CheckRunEvent) func(scaleUpTrigger v1alpha1.ScaleUpTrigger) bool {

View File

@@ -1,8 +1,8 @@
package controllers package controllers
import ( import (
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/google/go-github/v33/github" "github.com/google/go-github/v33/github"
"github.com/summerwind/actions-runner-controller/api/v1alpha1"
) )
func (autoscaler *HorizontalRunnerAutoscalerGitHubWebhook) MatchPullRequestEvent(event *github.PullRequestEvent) func(scaleUpTrigger v1alpha1.ScaleUpTrigger) bool { func (autoscaler *HorizontalRunnerAutoscalerGitHubWebhook) MatchPullRequestEvent(event *github.PullRequestEvent) func(scaleUpTrigger v1alpha1.ScaleUpTrigger) bool {

View File

@@ -1,8 +1,8 @@
package controllers package controllers
import ( import (
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/google/go-github/v33/github" "github.com/google/go-github/v33/github"
"github.com/summerwind/actions-runner-controller/api/v1alpha1"
) )
func (autoscaler *HorizontalRunnerAutoscalerGitHubWebhook) MatchPushEvent(event *github.PushEvent) func(scaleUpTrigger v1alpha1.ScaleUpTrigger) bool { func (autoscaler *HorizontalRunnerAutoscalerGitHubWebhook) MatchPushEvent(event *github.PushEvent) func(scaleUpTrigger v1alpha1.ScaleUpTrigger) bool {

View File

@@ -4,21 +4,22 @@ import (
"bytes" "bytes"
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/go-logr/logr"
"github.com/google/go-github/v33/github"
actionsv1alpha1 "github.com/summerwind/actions-runner-controller/api/v1alpha1"
"io" "io"
"io/ioutil" "io/ioutil"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
"net/http" "net/http"
"net/http/httptest" "net/http/httptest"
"net/url" "net/url"
"os" "os"
"sigs.k8s.io/controller-runtime/pkg/client/fake"
"testing" "testing"
"time" "time"
actionsv1alpha1 "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/go-logr/logr"
"github.com/google/go-github/v33/github"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
"sigs.k8s.io/controller-runtime/pkg/client/fake"
) )
var ( var (

View File

@@ -24,7 +24,7 @@ import (
corev1 "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1"
"github.com/summerwind/actions-runner-controller/github" "github.com/actions-runner-controller/actions-runner-controller/github"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
"github.com/go-logr/logr" "github.com/go-logr/logr"
@@ -35,8 +35,8 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/summerwind/actions-runner-controller/api/v1alpha1" "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/summerwind/actions-runner-controller/controllers/metrics" "github.com/actions-runner-controller/actions-runner-controller/controllers/metrics"
) )
const ( const (

View File

@@ -1,11 +1,12 @@
package controllers package controllers
import ( import (
"github.com/google/go-cmp/cmp"
actionsv1alpha1 "github.com/summerwind/actions-runner-controller/api/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"testing" "testing"
"time" "time"
actionsv1alpha1 "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/google/go-cmp/cmp"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
) )
func TestGetValidCacheEntries(t *testing.T) { func TestGetValidCacheEntries(t *testing.T) {

View File

@@ -7,10 +7,10 @@ import (
"net/http/httptest" "net/http/httptest"
"time" "time"
github2 "github.com/actions-runner-controller/actions-runner-controller/github"
"github.com/google/go-github/v33/github" "github.com/google/go-github/v33/github"
github2 "github.com/summerwind/actions-runner-controller/github"
"github.com/summerwind/actions-runner-controller/github/fake" "github.com/actions-runner-controller/actions-runner-controller/github/fake"
corev1 "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
@@ -23,7 +23,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client"
actionsv1alpha1 "github.com/summerwind/actions-runner-controller/api/v1alpha1" actionsv1alpha1 "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
) )
type testEnvironment struct { type testEnvironment struct {

View File

@@ -1,8 +1,8 @@
package metrics package metrics
import ( import (
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
"github.com/summerwind/actions-runner-controller/api/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
) )

View File

@@ -1,8 +1,8 @@
package metrics package metrics
import ( import (
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
"github.com/summerwind/actions-runner-controller/api/v1alpha1"
) )
const ( const (

View File

@@ -1,8 +1,8 @@
package metrics package metrics
import ( import (
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
"github.com/summerwind/actions-runner-controller/api/v1alpha1"
) )
const ( const (

View File

@@ -6,8 +6,8 @@ import (
"net/http" "net/http"
"time" "time"
"github.com/actions-runner-controller/actions-runner-controller/github"
"github.com/go-logr/logr" "github.com/go-logr/logr"
"github.com/summerwind/actions-runner-controller/github"
"gomodules.xyz/jsonpatch/v2" "gomodules.xyz/jsonpatch/v2"
admissionv1 "k8s.io/api/admission/v1" admissionv1 "k8s.io/api/admission/v1"
corev1 "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1"

View File

@@ -23,8 +23,8 @@ import (
"strings" "strings"
"time" "time"
"github.com/actions-runner-controller/actions-runner-controller/hash"
gogithub "github.com/google/go-github/v33/github" gogithub "github.com/google/go-github/v33/github"
"github.com/summerwind/actions-runner-controller/hash"
"k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/util/wait"
"github.com/go-logr/logr" "github.com/go-logr/logr"
@@ -37,8 +37,8 @@ import (
corev1 "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/summerwind/actions-runner-controller/api/v1alpha1" "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/summerwind/actions-runner-controller/github" "github.com/actions-runner-controller/actions-runner-controller/github"
) )
const ( const (
@@ -395,7 +395,7 @@ func (r *RunnerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr
"Runner failed to register itself to GitHub in timely manner. "+ "Runner failed to register itself to GitHub in timely manner. "+
"Recreating the pod to see if it resolves the issue. "+ "Recreating the pod to see if it resolves the issue. "+
"CAUTION: If you see this a lot, you should investigate the root cause. "+ "CAUTION: If you see this a lot, you should investigate the root cause. "+
"See https://github.com/summerwind/actions-runner-controller/issues/288", "See https://github.com/actions-runner-controller/actions-runner-controller/issues/288",
"podCreationTimestamp", pod.CreationTimestamp, "podCreationTimestamp", pod.CreationTimestamp,
"currentTime", currentTime, "currentTime", currentTime,
"configuredRegistrationTimeout", registrationTimeout, "configuredRegistrationTimeout", registrationTimeout,
@@ -588,7 +588,7 @@ func (r *RunnerReconciler) newPod(runner v1alpha1.Runner) (corev1.Pod, error) {
// A registered runner's session and the a registration token seem to have two different and independent // A registered runner's session and the a registration token seem to have two different and independent
// lifecycles. // lifecycles.
// //
// See https://github.com/summerwind/actions-runner-controller/issues/143 for more context. // See https://github.com/actions-runner-controller/actions-runner-controller/issues/143 for more context.
labels[LabelKeyPodTemplateHash] = hash.FNVHashStringObjects( labels[LabelKeyPodTemplateHash] = hash.FNVHashStringObjects(
filterLabels(runner.ObjectMeta.Labels, LabelKeyRunnerTemplateHash), filterLabels(runner.ObjectMeta.Labels, LabelKeyRunnerTemplateHash),
runner.ObjectMeta.Annotations, runner.ObjectMeta.Annotations,
@@ -937,7 +937,7 @@ func newRunnerPod(template corev1.Pod, runnerSpec v1alpha1.RunnerConfig, default
}...) }...)
// Determine the volume mounts assigned to the docker sidecar. In case extra mounts are included in the RunnerSpec, append them to the standard // Determine the volume mounts assigned to the docker sidecar. In case extra mounts are included in the RunnerSpec, append them to the standard
// set of mounts. See https://github.com/summerwind/actions-runner-controller/issues/435 for context. // set of mounts. See https://github.com/actions-runner-controller/actions-runner-controller/issues/435 for context.
dockerVolumeMounts := []corev1.VolumeMount{ dockerVolumeMounts := []corev1.VolumeMount{
{ {
Name: "work", Name: "work",

View File

@@ -37,8 +37,8 @@ import (
corev1 "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/summerwind/actions-runner-controller/api/v1alpha1" "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/summerwind/actions-runner-controller/controllers/metrics" "github.com/actions-runner-controller/actions-runner-controller/controllers/metrics"
) )
const ( const (
@@ -154,7 +154,7 @@ func (r *RunnerDeploymentReconciler) Reconcile(ctx context.Context, req ctrl.Req
// A selector update change doesn't trigger replicaset replacement, // A selector update change doesn't trigger replicaset replacement,
// but we still need to update the existing replicaset with it. // but we still need to update the existing replicaset with it.
// Otherwise selector-based runner query will never work on replicasets created before the controller v0.17.0 // Otherwise selector-based runner query will never work on replicasets created before the controller v0.17.0
// See https://github.com/summerwind/actions-runner-controller/pull/355#discussion_r585379259 // See https://github.com/actions-runner-controller/actions-runner-controller/pull/355#discussion_r585379259
if err := r.Client.Update(ctx, updateSet); err != nil { if err := r.Client.Update(ctx, updateSet); err != nil {
log.Error(err, "Failed to update runnerreplicaset resource") log.Error(err, "Failed to update runnerreplicaset resource")

View File

@@ -20,7 +20,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client"
actionsv1alpha1 "github.com/summerwind/actions-runner-controller/api/v1alpha1" actionsv1alpha1 "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
) )
func TestNewRunnerReplicaSet(t *testing.T) { func TestNewRunnerReplicaSet(t *testing.T) {

View File

@@ -35,8 +35,8 @@ import (
corev1 "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/summerwind/actions-runner-controller/api/v1alpha1" "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/summerwind/actions-runner-controller/github" "github.com/actions-runner-controller/actions-runner-controller/github"
) )
// RunnerReplicaSetReconciler reconciles a Runner object // RunnerReplicaSetReconciler reconciles a Runner object
@@ -231,7 +231,7 @@ func (r *RunnerReplicaSetReconciler) Reconcile(ctx context.Context, req ctrl.Req
"Runner failed to register itself to GitHub in timely manner. "+ "Runner failed to register itself to GitHub in timely manner. "+
"Marking the runner for scale down. "+ "Marking the runner for scale down. "+
"CAUTION: If you see this a lot, you should investigate the root cause. "+ "CAUTION: If you see this a lot, you should investigate the root cause. "+
"See https://github.com/summerwind/actions-runner-controller/issues/288", "See https://github.com/actions-runner-controller/actions-runner-controller/issues/288",
"runnerCreationTimestamp", runner.CreationTimestamp, "runnerCreationTimestamp", runner.CreationTimestamp,
"currentTime", currentTime, "currentTime", currentTime,
"configuredRegistrationTimeout", registrationTimeout, "configuredRegistrationTimeout", registrationTimeout,

View File

@@ -18,8 +18,8 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client"
actionsv1alpha1 "github.com/summerwind/actions-runner-controller/api/v1alpha1" actionsv1alpha1 "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/summerwind/actions-runner-controller/github/fake" "github.com/actions-runner-controller/actions-runner-controller/github/fake"
) )
var ( var (

View File

@@ -34,8 +34,8 @@ import (
corev1 "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/summerwind/actions-runner-controller/api/v1alpha1" "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/summerwind/actions-runner-controller/controllers/metrics" "github.com/actions-runner-controller/actions-runner-controller/controllers/metrics"
) )
const ( const (

View File

@@ -26,7 +26,7 @@ import (
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
actionsv1alpha1 "github.com/summerwind/actions-runner-controller/api/v1alpha1" actionsv1alpha1 "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest" "k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client"

View File

@@ -6,7 +6,7 @@ import (
"net/http/httptest" "net/http/httptest"
"strconv" "strconv"
"github.com/summerwind/actions-runner-controller/api/v1alpha1" "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/google/go-github/v33/github" "github.com/google/go-github/v33/github"
"github.com/gorilla/mux" "github.com/gorilla/mux"

View File

@@ -10,9 +10,9 @@ import (
"sync" "sync"
"time" "time"
"github.com/actions-runner-controller/actions-runner-controller/github/metrics"
"github.com/bradleyfalzon/ghinstallation" "github.com/bradleyfalzon/ghinstallation"
"github.com/google/go-github/v33/github" "github.com/google/go-github/v33/github"
"github.com/summerwind/actions-runner-controller/github/metrics"
"golang.org/x/oauth2" "golang.org/x/oauth2"
) )

View File

@@ -7,8 +7,8 @@ import (
"testing" "testing"
"time" "time"
"github.com/actions-runner-controller/actions-runner-controller/github/fake"
"github.com/google/go-github/v33/github" "github.com/google/go-github/v33/github"
"github.com/summerwind/actions-runner-controller/github/fake"
) )
var server *httptest.Server var server *httptest.Server

2
go.mod
View File

@@ -1,4 +1,4 @@
module github.com/summerwind/actions-runner-controller module github.com/actions-runner-controller/actions-runner-controller
go 1.15 go 1.15

View File

@@ -23,10 +23,10 @@ import (
"strings" "strings"
"time" "time"
actionsv1alpha1 "github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/actions-runner-controller/actions-runner-controller/controllers"
"github.com/actions-runner-controller/actions-runner-controller/github"
"github.com/kelseyhightower/envconfig" "github.com/kelseyhightower/envconfig"
actionsv1alpha1 "github.com/summerwind/actions-runner-controller/api/v1alpha1"
"github.com/summerwind/actions-runner-controller/controllers"
"github.com/summerwind/actions-runner-controller/github"
zaplib "go.uber.org/zap" zaplib "go.uber.org/zap"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme" clientgoscheme "k8s.io/client-go/kubernetes/scheme"
@@ -94,7 +94,7 @@ func main() {
flag.StringVar(&c.AppPrivateKey, "github-app-private-key", c.AppPrivateKey, "The path of a private key file to authenticate as a GitHub App") flag.StringVar(&c.AppPrivateKey, "github-app-private-key", c.AppPrivateKey, "The path of a private key file to authenticate as a GitHub App")
flag.DurationVar(&gitHubAPICacheDuration, "github-api-cache-duration", 0, "The duration until the GitHub API cache expires. Setting this to e.g. 10m results in the controller tries its best not to make the same API call within 10m to reduce the chance of being rate-limited. Defaults to mostly the same value as sync-period. If you're tweaking this in order to make autoscaling more responsive, you'll probably want to tweak sync-period, too") flag.DurationVar(&gitHubAPICacheDuration, "github-api-cache-duration", 0, "The duration until the GitHub API cache expires. Setting this to e.g. 10m results in the controller tries its best not to make the same API call within 10m to reduce the chance of being rate-limited. Defaults to mostly the same value as sync-period. If you're tweaking this in order to make autoscaling more responsive, you'll probably want to tweak sync-period, too")
flag.DurationVar(&syncPeriod, "sync-period", 10*time.Minute, "Determines the minimum frequency at which K8s resources managed by this controller are reconciled. When you use autoscaling, set to a lower value like 10 minute, because this corresponds to the minimum time to react on demand change. . If you're tweaking this in order to make autoscaling more responsive, you'll probably want to tweak github-api-cache-duration, too") flag.DurationVar(&syncPeriod, "sync-period", 10*time.Minute, "Determines the minimum frequency at which K8s resources managed by this controller are reconciled. When you use autoscaling, set to a lower value like 10 minute, because this corresponds to the minimum time to react on demand change. . If you're tweaking this in order to make autoscaling more responsive, you'll probably want to tweak github-api-cache-duration, too")
flag.Var(&commonRunnerLabels, "common-runner-labels", "Runner labels in the K1=V1,K2=V2,... format that are inherited all the runners created by the controller. See https://github.com/summerwind/actions-runner-controller/issues/321 for more information") flag.Var(&commonRunnerLabels, "common-runner-labels", "Runner labels in the K1=V1,K2=V2,... format that are inherited all the runners created by the controller. See https://github.com/actions-runner-controller/actions-runner-controller/issues/321 for more information")
flag.StringVar(&namespace, "watch-namespace", "", "The namespace to watch for custom resources. Set to empty for letting it watch for all namespaces.") flag.StringVar(&namespace, "watch-namespace", "", "The namespace to watch for custom resources. Set to empty for letting it watch for all namespaces.")
flag.StringVar(&logLevel, "log-level", logLevelDebug, `The verbosity of the logging. Valid values are "debug", "info", "warn", "error". Defaults to "debug".`) flag.StringVar(&logLevel, "log-level", logLevelDebug, `The verbosity of the logging. Valid values are "debug", "info", "warn", "error". Defaults to "debug".`)
flag.Parse() flag.Parse()

View File

@@ -43,7 +43,7 @@ if [ -z "${RUNNER_REPO}" ] && [ -n "${RUNNER_GROUP}" ];then
RUNNER_GROUPS=${RUNNER_GROUP} RUNNER_GROUPS=${RUNNER_GROUP}
fi fi
# Hack due to https://github.com/summerwind/actions-runner-controller/issues/252#issuecomment-758338483 # Hack due to https://github.com/actions-runner-controller/actions-runner-controller/issues/252#issuecomment-758338483
if [ ! -d /runner ]; then if [ ! -d /runner ]; then
echo "/runner should be an emptyDir mount. Please fix the pod spec." 1>&2 echo "/runner should be an emptyDir mount. Please fix the pod spec." 1>&2
exit 1 exit 1