From 21ebf5bfdf0678278d98ccfaa180a672b025708c Mon Sep 17 00:00:00 2001 From: Simon Smith Date: Sat, 28 Nov 2020 19:07:43 +0000 Subject: [PATCH] change to appsV1 --- pkg/cmd/daemonset.go | 7 ++++--- pkg/cmd/deployment.go | 7 ++++--- pkg/cmd/statefulset.go | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/pkg/cmd/daemonset.go b/pkg/cmd/daemonset.go index 12a080f..5c8d530 100644 --- a/pkg/cmd/daemonset.go +++ b/pkg/cmd/daemonset.go @@ -5,10 +5,11 @@ import ( "bytes" "errors" "fmt" - "github.com/spf13/cobra" + "os" + "github.com/controlplaneio/kubectl-kubesec/pkg/kubesec" + "github.com/spf13/cobra" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "os" ) var daemonsetCmd = &cobra.Command{ @@ -25,7 +26,7 @@ var daemonsetCmd = &cobra.Command{ writer := bufio.NewWriter(&buffer) fmt.Println("scanning daemonset", name, "in namespace", namespace) - ds, err := kubeClient.AppsV1beta2().DaemonSets(namespace).Get(name, metav1.GetOptions{}) + ds, err := kubeClient.AppsV1().DaemonSets(namespace).Get(name, metav1.GetOptions{}) if err != nil { fmt.Println(err) os.Exit(1) diff --git a/pkg/cmd/deployment.go b/pkg/cmd/deployment.go index ed77dc5..f1ede60 100644 --- a/pkg/cmd/deployment.go +++ b/pkg/cmd/deployment.go @@ -5,10 +5,11 @@ import ( "bytes" "errors" "fmt" - "github.com/spf13/cobra" + "os" + "github.com/controlplaneio/kubectl-kubesec/pkg/kubesec" + "github.com/spf13/cobra" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "os" ) var deploymentCmd = &cobra.Command{ @@ -25,7 +26,7 @@ var deploymentCmd = &cobra.Command{ writer := bufio.NewWriter(&buffer) fmt.Println("scanning deployment", name, "in namespace", namespace) - dep, err := kubeClient.AppsV1beta2().Deployments(namespace).Get(name, metav1.GetOptions{}) + dep, err := kubeClient.AppsV1().Deployments(namespace).Get(name, metav1.GetOptions{}) if err != nil { fmt.Println(err) os.Exit(1) diff --git a/pkg/cmd/statefulset.go b/pkg/cmd/statefulset.go index 8629326..137ceae 100644 --- a/pkg/cmd/statefulset.go +++ b/pkg/cmd/statefulset.go @@ -5,10 +5,11 @@ import ( "bytes" "errors" "fmt" - "github.com/spf13/cobra" + "os" + "github.com/controlplaneio/kubectl-kubesec/pkg/kubesec" + "github.com/spf13/cobra" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "os" ) var statefulsetCmd = &cobra.Command{ @@ -25,7 +26,7 @@ var statefulsetCmd = &cobra.Command{ writer := bufio.NewWriter(&buffer) fmt.Println("scanning statefulset", name, "in namespace", namespace) - ss, err := kubeClient.AppsV1beta2().StatefulSets(namespace).Get(name, metav1.GetOptions{}) + ss, err := kubeClient.AppsV1().StatefulSets(namespace).Get(name, metav1.GetOptions{}) if err != nil { fmt.Println(err) os.Exit(1)