Skip to content

Commit

Permalink
nit: this commit cleans the go-related codes.
Browse files Browse the repository at this point in the history
this commits clean the code like,
1. removing the unused var
2. formating the imports

Signed-off-by: subhamkrai <srai@redhat.com>
  • Loading branch information
subhamkrai committed Jun 16, 2023
1 parent 60cb3a9 commit aa0b271
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 9 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/go-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -111,5 +116,3 @@ jobs:
- name: consider debugging
if: failure()
uses: mxschmitt/action-tmate@v3
with:
use-tmate: ${{ secrets.USE_TMATE }}
1 change: 0 additions & 1 deletion cmd/commands/mons.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"fmt"

"github.com/rook/kubectl-rook-ceph/pkg/mons"

"github.com/spf13/cobra"
)

Expand Down
3 changes: 1 addition & 2 deletions cmd/commands/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package command

import (
k8sutil "github.com/rook/kubectl-rook-ceph/pkg/k8sutil"

"github.com/spf13/cobra"
)

Expand All @@ -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")
},
Expand Down
1 change: 0 additions & 1 deletion cmd/commands/rbd.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package command

import (
"github.com/rook/kubectl-rook-ceph/pkg/exec"

"github.com/spf13/cobra"
)

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions pkg/debug/start_debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions pkg/debug/stop_debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions pkg/dr/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
1 change: 1 addition & 0 deletions pkg/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions pkg/health/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion pkg/logging/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,3 @@ func Fatal(err error, args ...interface{}) {
fmt.Println()
os.Exit(1)
}

1 change: 1 addition & 0 deletions pkg/mons/mon_endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
1 change: 1 addition & 0 deletions pkg/mons/mon_endpoints_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions pkg/rook/purge_osd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down

0 comments on commit aa0b271

Please sign in to comment.