Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sort imports using goimports #19

Merged
merged 2 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
![GitHub go.mod Go version (subdirectory of monorepo)](https://img.shields.io/github/go-mod/go-version/yonahd/kor)
![GitHub release (with filter)](https://img.shields.io/github/v/release/yonahd/kor?color=green&link=https://github.com/yonahd/kor/releases)

# Kor - Kubernetes Orphaned Resources Finder

Kor is a tool to discover unused Kubernetes resources. Currently, Kor can identify and list unused:
Expand Down
7 changes: 5 additions & 2 deletions cmd/kor/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package kor

import (
"fmt"
"github.com/spf13/cobra"
"os"

"github.com/spf13/cobra"
)

var rootCmd = &cobra.Command{
Expand All @@ -12,7 +13,9 @@ var rootCmd = &cobra.Command{
Long: `kor is a CLI to to discover unused Kubernetes resources
kor can currently discover unused configmaps and secrets`,
Run: func(cmd *cobra.Command, args []string) {

if len(args) == 0 {
cmd.Help()
}
},
}

Expand Down
3 changes: 2 additions & 1 deletion pkg/kor/all.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package kor
import (
"encoding/json"
"fmt"
"k8s.io/client-go/kubernetes"
"os"

"k8s.io/client-go/kubernetes"
)

type GetUnusedResourceJSONResponse struct {
Expand Down
3 changes: 2 additions & 1 deletion pkg/kor/confimgmaps.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import (
"context"
"encoding/json"
"fmt"
"os"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
"os"
)

var exceptionconfigmaps = []ExceptionResource{
Expand Down
3 changes: 2 additions & 1 deletion pkg/kor/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"context"
"encoding/json"
"fmt"
"os"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"os"
)

func getDeploymentsWithoutReplicas(kubeClient *kubernetes.Clientset, namespace string) ([]string, error) {
Expand Down
7 changes: 4 additions & 3 deletions pkg/kor/kor.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import (
"bytes"
"context"
"fmt"
"os"
"path/filepath"
"sort"

"github.com/olekukonko/tablewriter"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/util/homedir"
"os"
"path/filepath"
"sort"
)

type ExceptionResource struct {
Expand Down
3 changes: 2 additions & 1 deletion pkg/kor/roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import (
"context"
"encoding/json"
"fmt"
"os"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
"os"
)

func retrieveUsedRoles(clientset *kubernetes.Clientset, namespace string) ([]string, error) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/kor/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import (
"context"
"encoding/json"
"fmt"
"os"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
"os"
)

func getSATokens(clientset *kubernetes.Clientset, namespace string) ([]string, error) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/kor/serviceaccounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"context"
"encoding/json"
"fmt"
"os"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"os"
)

var exceptionServiceAccounts = []ExceptionResource{
Expand Down
3 changes: 2 additions & 1 deletion pkg/kor/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"context"
"encoding/json"
"fmt"
"os"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"os"
)

func getEndpointsWithoutSubsets(kubeClient *kubernetes.Clientset, namespace string) ([]string, error) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/kor/statefulsets.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"context"
"encoding/json"
"fmt"
"os"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"os"
)

func getStatefulsetsWithoutReplicas(kubeClient *kubernetes.Clientset, namespace string) ([]string, error) {
Expand Down
Loading