Skip to content

Commit

Permalink
feat(pkg): reorganize packages
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Fontana <lo@linux.com>
  • Loading branch information
fntlnz committed Nov 21, 2018
1 parent 984d884 commit 20c6f71
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 202 deletions.
14 changes: 7 additions & 7 deletions cmd/kubectl-trace/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
"fmt"
"io/ioutil"

"github.com/fntlnz/kubectl-trace/attacher"
"github.com/fntlnz/kubectl-trace/tracejob"
"github.com/influxdata/platform/kit/signals"
"github.com/influxdata/platform/snowflake"
"github.com/fntlnz/kubectl-trace/pkg/attacher"
"github.com/fntlnz/kubectl-trace/pkg/signals"
"github.com/fntlnz/kubectl-trace/pkg/tracejob"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"go.uber.org/zap"
"k8s.io/apimachinery/pkg/util/uuid"

apiv1 "k8s.io/api/core/v1"
"k8s.io/client-go/kubernetes"
Expand Down Expand Up @@ -64,8 +64,6 @@ func run(cmd *cobra.Command, args []string) {
}
node = args[0]

idgen := snowflake.NewIDGenerator()

ctx := context.Background()
ctx = signals.WithStandardSignals(ctx)

Expand All @@ -83,9 +81,11 @@ func run(cmd *cobra.Command, args []string) {

jobsClient := clientset.BatchV1().Jobs(namespace)

juid := uuid.NewUUID()
tj := &tracejob.TraceJob{
Name: fmt.Sprintf("kubectl-trace-%s", idgen.ID()),
Name: fmt.Sprintf("kubectl-trace-%s", string(juid)),
Namespace: namespace,
ID: string(juid),
Hostname: node,
JobClient: jobsClient,
ConfigClient: clientset.CoreV1().ConfigMaps(namespace),
Expand Down
17 changes: 16 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
module github.com/fntlnz/kubectl-trace

require (
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96 // indirect
github.com/elazarl/goproxy v0.0.0-20181111060418-2ce16c963a8a // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/gogo/protobuf v1.1.1 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c // indirect
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf // indirect
github.com/googleapis/gnostic v0.2.0 // indirect
github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f // indirect
github.com/influxdata/platform v0.0.0-20181121005014-21e6c7bdce0d
github.com/imdario/mergo v0.3.6 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/json-iterator/go v1.1.5 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/mitchellh/go-homedir v1.0.0
github.com/mitchellh/mapstructure v1.1.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/pborman/uuid v1.2.0 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pkg/errors v0.8.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/cobra v0.0.3
github.com/spf13/pflag v1.0.3 // indirect
github.com/spf13/viper v1.2.1
github.com/stretchr/testify v1.2.2 // indirect
go.uber.org/atomic v1.3.2 // indirect
go.uber.org/multierr v1.1.0 // indirect
go.uber.org/zap v1.9.1
golang.org/x/crypto v0.0.0-20181112202954-3d3f9f413869 // indirect
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a // indirect
Expand All @@ -23,6 +37,7 @@ require (
golang.org/x/sys v0.0.0-20181116161606-93218def8b18 // indirect
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c // indirect
google.golang.org/appengine v1.3.0 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
k8s.io/api v0.0.0-20181004124137-fd83cbc87e76
k8s.io/apimachinery v0.0.0-20180913025736-6dd46049f395
Expand Down
Loading

0 comments on commit 20c6f71

Please sign in to comment.