diff options
author | baude <bbaude@redhat.com> | 2019-04-07 13:38:58 -0500 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2019-04-12 12:05:09 -0500 |
commit | 80b2c097fe333fd43634753b574d4b5bdf155b82 (patch) | |
tree | bfb3e032c0b6b4e7f08d087fa00d3919cdf62751 /pkg/adapter/runtime.go | |
parent | 4596c39655f7ff5e741adbc97aaa49bb3a9d453e (diff) | |
download | podman-80b2c097fe333fd43634753b574d4b5bdf155b82.tar.gz podman-80b2c097fe333fd43634753b574d4b5bdf155b82.tar.bz2 podman-80b2c097fe333fd43634753b574d4b5bdf155b82.zip |
podman-remote generate kube
Allow the ability to generate kube YAML from the podman remote-client.
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/adapter/runtime.go')
-rw-r--r-- | pkg/adapter/runtime.go | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/pkg/adapter/runtime.go b/pkg/adapter/runtime.go index d45bdb56d..6aafed550 100644 --- a/pkg/adapter/runtime.go +++ b/pkg/adapter/runtime.go @@ -7,6 +7,7 @@ import ( "context" "io" "io/ioutil" + "k8s.io/api/core/v1" "os" "text/template" @@ -404,27 +405,7 @@ func (r *LocalRuntime) Diff(c *cliconfig.DiffValues, to string) ([]archive.Chang return r.Runtime.GetDiff("", to) } -// func (r *LocalRuntime) joinContainerOrCreateRootlessUserNS(ctr *libpod.Container) (bool, int, error) { -// if os.Geteuid() == 0 { -// return false, 0, nil -// } -// s, err := ctr.State() -// if err != nil { -// return false, -1, err -// } -// opts := rootless.Opts{ -// Argument: ctr.ID(), -// } -// if s == libpod.ContainerStateRunning || s == libpod.ContainerStatePaused { -// data, err := ioutil.ReadFile(ctr.Config().ConmonPidFile) -// if err != nil { -// return false, -1, errors.Wrapf(err, "Container %s cannot read conmon PID file %q", ctr.ID(), ctr.Config().ConmonPidFile) -// } -// conmonPid, err := strconv.Atoi(string(data)) -// if err != nil { -// return false, -1, errors.Wrapf(err, "Container %s cannot parse PID %q", ctr.ID(), data) -// } -// return rootless.JoinDirectUserAndMountNSWithOpts(uint(conmonPid), &opts) -// } -// return rootless.BecomeRootInUserNSWithOpts(&opts) -// } +// GenerateKube creates kubernetes email from containers and pods +func (r *LocalRuntime) GenerateKube(c *cliconfig.GenerateKubeValues) (*v1.Pod, *v1.Service, error) { + return shared.GenerateKube(c.InputArgs[0], c.Service, r.Runtime) +} |