diff --git a/.github/workflows/go-test.yaml b/.github/workflows/go-test.yaml index a11711e1..7a661b1b 100644 --- a/.github/workflows/go-test.yaml +++ b/.github/workflows/go-test.yaml @@ -7,6 +7,11 @@ defaults: # reference: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell shell: bash --noprofile --norc -eo pipefail -x {0} +# cancel the in-progress workflow when PR is refreshed. +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + jobs: go-test: runs-on: ubuntu-20.04 @@ -111,5 +116,3 @@ jobs: - name: consider debugging if: failure() uses: mxschmitt/action-tmate@v3 - with: - use-tmate: ${{ secrets.USE_TMATE }} diff --git a/cmd/commands/mons.go b/cmd/commands/mons.go index 40cce1cc..e6b3f116 100644 --- a/cmd/commands/mons.go +++ b/cmd/commands/mons.go @@ -20,7 +20,6 @@ import ( "fmt" "github.com/rook/kubectl-rook-ceph/pkg/mons" - "github.com/spf13/cobra" ) diff --git a/cmd/commands/operator.go b/cmd/commands/operator.go index fb4e89fd..538e4998 100644 --- a/cmd/commands/operator.go +++ b/cmd/commands/operator.go @@ -18,7 +18,6 @@ package command import ( k8sutil "github.com/rook/kubectl-rook-ceph/pkg/k8sutil" - "github.com/spf13/cobra" ) @@ -34,7 +33,7 @@ var restartCmd = &cobra.Command{ Use: "restart", Short: "Restart rook-ceph-operator pod", Args: cobra.NoArgs, - Run: func(cmd *cobra.Command, args []string) { + Run: func(cmd *cobra.Command, _ []string) { clientsets := GetClientsets(cmd.Context()) k8sutil.RestartDeployment(cmd.Context(), clientsets.Kube, OperatorNamespace, "rook-ceph-operator") }, diff --git a/cmd/commands/rbd.go b/cmd/commands/rbd.go index 36006086..1ee4db22 100644 --- a/cmd/commands/rbd.go +++ b/cmd/commands/rbd.go @@ -18,7 +18,6 @@ package command import ( "github.com/rook/kubectl-rook-ceph/pkg/exec" - "github.com/spf13/cobra" ) diff --git a/go.mod b/go.mod index 9d0b934c..eabe98ff 100644 --- a/go.mod +++ b/go.mod @@ -5,13 +5,11 @@ go 1.19 require ( github.com/fatih/color v1.13.0 github.com/rook/rook v1.11.5 - github.com/sirupsen/logrus v1.9.0 github.com/spf13/cobra v1.6.1 github.com/stretchr/testify v1.8.1 k8s.io/api v0.26.4 k8s.io/apimachinery v0.26.4 k8s.io/client-go v0.26.4 - sigs.k8s.io/controller-runtime v0.14.5 ) require ( @@ -77,6 +75,7 @@ require ( github.com/prometheus/common v0.37.0 // indirect github.com/prometheus/procfs v0.8.0 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect + github.com/sirupsen/logrus v1.9.0 // indirect github.com/spf13/pflag v1.0.5 // indirect golang.org/x/crypto v0.6.0 // indirect golang.org/x/net v0.7.0 // indirect @@ -95,6 +94,7 @@ require ( k8s.io/klog/v2 v2.90.0 // indirect k8s.io/kube-openapi v0.0.0-20230202010329-39b3636cbaa3 // indirect k8s.io/utils v0.0.0-20230202215443-34013725500c // indirect + sigs.k8s.io/controller-runtime v0.14.5 // indirect sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect sigs.k8s.io/yaml v1.3.0 // indirect diff --git a/pkg/debug/start_debug.go b/pkg/debug/start_debug.go index b3e2a05b..21bb7827 100644 --- a/pkg/debug/start_debug.go +++ b/pkg/debug/start_debug.go @@ -23,6 +23,7 @@ import ( "github.com/rook/kubectl-rook-ceph/pkg/k8sutil" "github.com/rook/kubectl-rook-ceph/pkg/logging" + appsv1 "k8s.io/api/apps/v1" autoscalingv1 "k8s.io/api/autoscaling/v1" kerrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/pkg/debug/stop_debug.go b/pkg/debug/stop_debug.go index bd362bc6..f2c3f532 100644 --- a/pkg/debug/stop_debug.go +++ b/pkg/debug/stop_debug.go @@ -22,6 +22,7 @@ import ( "strings" "github.com/rook/kubectl-rook-ceph/pkg/logging" + kerrors "k8s.io/apimachinery/pkg/api/errors" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" diff --git a/pkg/dr/health.go b/pkg/dr/health.go index f5c3dedf..cabe3edb 100644 --- a/pkg/dr/health.go +++ b/pkg/dr/health.go @@ -10,6 +10,7 @@ import ( "github.com/rook/kubectl-rook-ceph/pkg/k8sutil" "github.com/rook/kubectl-rook-ceph/pkg/logging" rookv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" ) diff --git a/pkg/exec/exec.go b/pkg/exec/exec.go index e847ed67..049b8106 100644 --- a/pkg/exec/exec.go +++ b/pkg/exec/exec.go @@ -25,6 +25,7 @@ import ( "github.com/rook/kubectl-rook-ceph/pkg/k8sutil" "github.com/rook/kubectl-rook-ceph/pkg/logging" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" diff --git a/pkg/health/health.go b/pkg/health/health.go index 987ec589..d24484b2 100644 --- a/pkg/health/health.go +++ b/pkg/health/health.go @@ -26,6 +26,7 @@ import ( "github.com/rook/kubectl-rook-ceph/pkg/exec" "github.com/rook/kubectl-rook-ceph/pkg/k8sutil" "github.com/rook/kubectl-rook-ceph/pkg/logging" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" diff --git a/pkg/logging/log.go b/pkg/logging/log.go index 2739f106..989b6b2e 100644 --- a/pkg/logging/log.go +++ b/pkg/logging/log.go @@ -54,4 +54,3 @@ func Fatal(err error, args ...interface{}) { fmt.Println() os.Exit(1) } - diff --git a/pkg/mons/mon_endpoints.go b/pkg/mons/mon_endpoints.go index d94a8b81..b314f77b 100644 --- a/pkg/mons/mon_endpoints.go +++ b/pkg/mons/mon_endpoints.go @@ -21,6 +21,7 @@ import ( "regexp" "github.com/rook/kubectl-rook-ceph/pkg/logging" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" ) diff --git a/pkg/mons/mon_endpoints_test.go b/pkg/mons/mon_endpoints_test.go index f2ab76dc..3a3c5c51 100644 --- a/pkg/mons/mon_endpoints_test.go +++ b/pkg/mons/mon_endpoints_test.go @@ -21,6 +21,7 @@ import ( "github.com/rook/kubectl-rook-ceph/pkg/k8sutil" "github.com/stretchr/testify/assert" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/fake" diff --git a/pkg/rook/purge_osd.go b/pkg/rook/purge_osd.go index 31827e10..d85ec36c 100644 --- a/pkg/rook/purge_osd.go +++ b/pkg/rook/purge_osd.go @@ -24,6 +24,7 @@ import ( "github.com/rook/kubectl-rook-ceph/pkg/k8sutil" "github.com/rook/kubectl-rook-ceph/pkg/logging" "github.com/rook/kubectl-rook-ceph/pkg/mons" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" )