From a4509cc99874d43e21957766356ad9c89bd1070c Mon Sep 17 00:00:00 2001 From: Daniel Henkel Date: Fri, 23 Oct 2020 07:31:20 +0200 Subject: [PATCH] rename src folder to pkg --- cmd/kubectl_dsh/main.go | 7 ++++--- cmd/pod_helper/main.go | 7 ++++--- go.sum | 8 ++++++++ {src => pkg}/config/create_config.go | 0 {src => pkg}/config/logs_config.go | 0 {src => pkg}/config/run_config.go | 0 {src => pkg}/config/types.go | 0 {src => pkg}/executor/create_pod_executor.go | 2 +- {src => pkg}/executor/execute.go | 8 ++++---- {src => pkg}/executor/logs_strategy.go | 4 ++-- {src => pkg}/executor/run_strategy.go | 4 ++-- {src => pkg}/executor/types.go | 4 ++-- {src => pkg}/kube/create_client.go | 0 {src => pkg}/kube/create_rest_client.go | 0 {src => pkg}/kube/list_pods.go | 2 +- {src => pkg}/log/log.go | 0 {src => pkg}/types/batch_results.go | 0 {src => pkg}/types/batch_results_test.go | 0 {src => pkg}/types/exec_result.go | 0 {src => pkg}/types/result.go | 2 +- {src => pkg}/utils/filter_containers.go | 2 +- {src => pkg}/utils/filter_containers_test.go | 2 +- 22 files changed, 31 insertions(+), 21 deletions(-) rename {src => pkg}/config/create_config.go (100%) rename {src => pkg}/config/logs_config.go (100%) rename {src => pkg}/config/run_config.go (100%) rename {src => pkg}/config/types.go (100%) rename {src => pkg}/executor/create_pod_executor.go (88%) rename {src => pkg}/executor/execute.go (87%) rename {src => pkg}/executor/logs_strategy.go (89%) rename {src => pkg}/executor/run_strategy.go (93%) rename {src => pkg}/executor/types.go (73%) rename {src => pkg}/kube/create_client.go (100%) rename {src => pkg}/kube/create_rest_client.go (100%) rename {src => pkg}/kube/list_pods.go (94%) rename {src => pkg}/log/log.go (100%) rename {src => pkg}/types/batch_results.go (100%) rename {src => pkg}/types/batch_results_test.go (100%) rename {src => pkg}/types/exec_result.go (100%) rename {src => pkg}/types/result.go (96%) rename {src => pkg}/utils/filter_containers.go (95%) rename {src => pkg}/utils/filter_containers_test.go (97%) diff --git a/cmd/kubectl_dsh/main.go b/cmd/kubectl_dsh/main.go index 9d32d1a..f1e6c17 100644 --- a/cmd/kubectl_dsh/main.go +++ b/cmd/kubectl_dsh/main.go @@ -6,13 +6,14 @@ import ( "path/filepath" "sort" - "github.com/dhenkel92/pod-helper/src/config" + "github.com/dhenkel92/pod-helper/pkg/config" - "github.com/dhenkel92/pod-helper/src/executor" + "github.com/dhenkel92/pod-helper/pkg/executor" + _ "k8s.io/client-go/plugin/pkg/client/auth" "k8s.io/client-go/util/homedir" - "github.com/dhenkel92/pod-helper/src/log" + "github.com/dhenkel92/pod-helper/pkg/log" "github.com/urfave/cli/v2" ) diff --git a/cmd/pod_helper/main.go b/cmd/pod_helper/main.go index 9c58a4f..df326f1 100644 --- a/cmd/pod_helper/main.go +++ b/cmd/pod_helper/main.go @@ -6,13 +6,14 @@ import ( "path/filepath" "sort" - "github.com/dhenkel92/pod-helper/src/config" + "github.com/dhenkel92/pod-helper/pkg/config" - "github.com/dhenkel92/pod-helper/src/executor" + "github.com/dhenkel92/pod-helper/pkg/executor" + _ "k8s.io/client-go/plugin/pkg/client/auth" "k8s.io/client-go/util/homedir" - "github.com/dhenkel92/pod-helper/src/log" + "github.com/dhenkel92/pod-helper/pkg/log" "github.com/urfave/cli/v2" ) diff --git a/go.sum b/go.sum index fa94518..a1da4d4 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,18 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0 h1:ROfEUZz+Gh5pa62DJWXSaonyu3StP6EA6lPEXPI6mCo= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +github.com/Azure/go-autorest/autorest v0.9.0 h1:MRvx8gncNaXJqOoLmhNjUAKh33JJF8LyxPhomEtOsjs= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest/adal v0.5.0 h1:q2gDruN08/guU9vAjuPWff0+QIrpH6ediguzdAzXAUU= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/date v0.1.0 h1:YGrhWfrgtFs84+h0o46rJrlmsZtyZRg470CqAXTZaGM= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/tracing v0.5.0 h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= @@ -19,6 +25,7 @@ github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96 h1:cenwrSVm+Z7QLSV/BsnenAOcDXdX4cMv4wP0B/5QbPg= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= @@ -60,6 +67,7 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/gophercloud/gophercloud v0.1.0 h1:P/nh25+rzXouhytV2pUHBb65fnds26Ghl8/391+sT5o= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= diff --git a/src/config/create_config.go b/pkg/config/create_config.go similarity index 100% rename from src/config/create_config.go rename to pkg/config/create_config.go diff --git a/src/config/logs_config.go b/pkg/config/logs_config.go similarity index 100% rename from src/config/logs_config.go rename to pkg/config/logs_config.go diff --git a/src/config/run_config.go b/pkg/config/run_config.go similarity index 100% rename from src/config/run_config.go rename to pkg/config/run_config.go diff --git a/src/config/types.go b/pkg/config/types.go similarity index 100% rename from src/config/types.go rename to pkg/config/types.go diff --git a/src/executor/create_pod_executor.go b/pkg/executor/create_pod_executor.go similarity index 88% rename from src/executor/create_pod_executor.go rename to pkg/executor/create_pod_executor.go index 3e088f1..a867659 100644 --- a/src/executor/create_pod_executor.go +++ b/pkg/executor/create_pod_executor.go @@ -1,7 +1,7 @@ package executor import ( - "github.com/dhenkel92/pod-helper/src/kube" + "github.com/dhenkel92/pod-helper/pkg/kube" ) func NewPodExecutor(kubeconfigPath string) (*PodExecutor, error) { diff --git a/src/executor/execute.go b/pkg/executor/execute.go similarity index 87% rename from src/executor/execute.go rename to pkg/executor/execute.go index 5b18b69..1f8dc17 100644 --- a/src/executor/execute.go +++ b/pkg/executor/execute.go @@ -1,10 +1,10 @@ package executor import ( - "github.com/dhenkel92/pod-helper/src/config" - "github.com/dhenkel92/pod-helper/src/kube" - "github.com/dhenkel92/pod-helper/src/types" - "github.com/dhenkel92/pod-helper/src/utils" + "github.com/dhenkel92/pod-helper/pkg/config" + "github.com/dhenkel92/pod-helper/pkg/kube" + "github.com/dhenkel92/pod-helper/pkg/types" + "github.com/dhenkel92/pod-helper/pkg/utils" v1 "k8s.io/api/core/v1" ) diff --git a/src/executor/logs_strategy.go b/pkg/executor/logs_strategy.go similarity index 89% rename from src/executor/logs_strategy.go rename to pkg/executor/logs_strategy.go index e7f3d09..806b65a 100644 --- a/src/executor/logs_strategy.go +++ b/pkg/executor/logs_strategy.go @@ -4,8 +4,8 @@ import ( "bytes" "io" - "github.com/dhenkel92/pod-helper/src/config" - "github.com/dhenkel92/pod-helper/src/types" + "github.com/dhenkel92/pod-helper/pkg/config" + "github.com/dhenkel92/pod-helper/pkg/types" v1 "k8s.io/api/core/v1" ) diff --git a/src/executor/run_strategy.go b/pkg/executor/run_strategy.go similarity index 93% rename from src/executor/run_strategy.go rename to pkg/executor/run_strategy.go index 2925aed..ef5d8f2 100644 --- a/src/executor/run_strategy.go +++ b/pkg/executor/run_strategy.go @@ -3,8 +3,8 @@ package executor import ( "bytes" - "github.com/dhenkel92/pod-helper/src/config" - "github.com/dhenkel92/pod-helper/src/types" + "github.com/dhenkel92/pod-helper/pkg/config" + "github.com/dhenkel92/pod-helper/pkg/types" v1 "k8s.io/api/core/v1" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/remotecommand" diff --git a/src/executor/types.go b/pkg/executor/types.go similarity index 73% rename from src/executor/types.go rename to pkg/executor/types.go index 6714262..efd2698 100644 --- a/src/executor/types.go +++ b/pkg/executor/types.go @@ -1,8 +1,8 @@ package executor import ( - "github.com/dhenkel92/pod-helper/src/config" - "github.com/dhenkel92/pod-helper/src/types" + "github.com/dhenkel92/pod-helper/pkg/config" + "github.com/dhenkel92/pod-helper/pkg/types" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" ) diff --git a/src/kube/create_client.go b/pkg/kube/create_client.go similarity index 100% rename from src/kube/create_client.go rename to pkg/kube/create_client.go diff --git a/src/kube/create_rest_client.go b/pkg/kube/create_rest_client.go similarity index 100% rename from src/kube/create_rest_client.go rename to pkg/kube/create_rest_client.go diff --git a/src/kube/list_pods.go b/pkg/kube/list_pods.go similarity index 94% rename from src/kube/list_pods.go rename to pkg/kube/list_pods.go index 6a79feb..44665f2 100644 --- a/src/kube/list_pods.go +++ b/pkg/kube/list_pods.go @@ -3,7 +3,7 @@ package kube import ( "strings" - "github.com/dhenkel92/pod-helper/src/log" + "github.com/dhenkel92/pod-helper/pkg/log" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" diff --git a/src/log/log.go b/pkg/log/log.go similarity index 100% rename from src/log/log.go rename to pkg/log/log.go diff --git a/src/types/batch_results.go b/pkg/types/batch_results.go similarity index 100% rename from src/types/batch_results.go rename to pkg/types/batch_results.go diff --git a/src/types/batch_results_test.go b/pkg/types/batch_results_test.go similarity index 100% rename from src/types/batch_results_test.go rename to pkg/types/batch_results_test.go diff --git a/src/types/exec_result.go b/pkg/types/exec_result.go similarity index 100% rename from src/types/exec_result.go rename to pkg/types/exec_result.go diff --git a/src/types/result.go b/pkg/types/result.go similarity index 96% rename from src/types/result.go rename to pkg/types/result.go index 0380cdb..dc5c31b 100644 --- a/src/types/result.go +++ b/pkg/types/result.go @@ -3,7 +3,7 @@ package types import ( "strings" - "github.com/dhenkel92/pod-helper/src/log" + "github.com/dhenkel92/pod-helper/pkg/log" "github.com/logrusorgru/aurora" v1 "k8s.io/api/core/v1" ) diff --git a/src/utils/filter_containers.go b/pkg/utils/filter_containers.go similarity index 95% rename from src/utils/filter_containers.go rename to pkg/utils/filter_containers.go index 0bf320a..6a18c27 100644 --- a/src/utils/filter_containers.go +++ b/pkg/utils/filter_containers.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/dhenkel92/pod-helper/src/config" + "github.com/dhenkel92/pod-helper/pkg/config" v1 "k8s.io/api/core/v1" ) diff --git a/src/utils/filter_containers_test.go b/pkg/utils/filter_containers_test.go similarity index 97% rename from src/utils/filter_containers_test.go rename to pkg/utils/filter_containers_test.go index f551abc..34a214a 100644 --- a/src/utils/filter_containers_test.go +++ b/pkg/utils/filter_containers_test.go @@ -3,7 +3,7 @@ package utils import ( "testing" - "github.com/dhenkel92/pod-helper/src/config" + "github.com/dhenkel92/pod-helper/pkg/config" v1 "k8s.io/api/core/v1" )