Skip to content

Commit

Permalink
✨ adding k8s access...
Browse files Browse the repository at this point in the history
  • Loading branch information
budougumi0617 committed Sep 19, 2019
1 parent 4fcbbab commit 3bf8775
Show file tree
Hide file tree
Showing 4 changed files with 214 additions and 23 deletions.
28 changes: 14 additions & 14 deletions dkl.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package dkl

import (
"context"
"flag"
"fmt"
"io"
"os/exec"
)

const (
Expand Down Expand Up @@ -33,16 +31,18 @@ func Run(args []string, inStream io.Reader, outStream, errStream io.Writer) erro
return nil
}

container, err := show()
if err != nil {
return err
}

cmd := []string{"/bin/bash"}
execCmd := execCmd(container.ID, cmd)
dcmd := exec.CommandContext(context.Background(), execCmd[0], execCmd[1:]...)
dcmd.Stdin = inStream
dcmd.Stdout = outStream
dcmd.Stderr = errStream
return dcmd.Run()
getPods()
// container, err := show()
// if err != nil {
// return err
// }

// cmd := []string{"/bin/bash"}
// execCmd := execCmd(container.ID, cmd)
// dcmd := exec.CommandContext(context.Background(), execCmd[0], execCmd[1:]...)
// dcmd.Stdin = inStream
// dcmd.Stdout = outStream
// dcmd.Stderr = errStream
// return dcmd.Run()
return nil
}
11 changes: 8 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,23 @@ require (
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/gogo/protobuf v1.3.0 // indirect
github.com/googleapis/gnostic v0.3.1 // indirect
github.com/gorilla/mux v1.7.3 // indirect
github.com/imdario/mergo v0.3.7 // indirect
github.com/manifoldco/promptui v0.3.2
github.com/nicksnyder/go-i18n v1.10.1 // indirect
github.com/nicksnyder/go-i18n/v2 v2.0.2 // indirect
github.com/opencontainers/go-digest v1.0.0-rc1 // indirect
github.com/opencontainers/image-spec v1.0.1 // indirect
github.com/sirupsen/logrus v1.4.2 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.0.0-20190912160710-24e19bdeb0f2 // indirect
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
google.golang.org/grpc v1.23.1 // indirect
gopkg.in/alecthomas/kingpin.v3-unstable v3.0.0-20180810215634-df19058c872c // indirect
gotest.tools v2.2.0+incompatible // indirect
k8s.io/api v0.0.0-20190919035539-41700d9d0c5b // indirect
k8s.io/apimachinery v0.0.0-20190917163033-a891081239f5
// kubernetes v12.0
k8s.io/client-go v0.0.0-20190918035823-297c8350f5d7
k8s.io/utils v0.0.0-20190907131718-3d4f5b7dea0b // indirect
)

replace github.com/nicksnyder/go-i18n v1.10.1 => github.com/nicksnyder/go-i18n/v2 v2.0.2

0 comments on commit 3bf8775

Please sign in to comment.