Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Feature: Consume piped content when --interactive #558

Closed
taqtiqa-mark opened this issue Mar 10, 2020 · 2 comments · Fixed by #572
Closed

Feature: Consume piped content when --interactive #558

taqtiqa-mark opened this issue Mar 10, 2020 · 2 comments · Fixed by #572

Comments

@taqtiqa-mark
Copy link

taqtiqa-mark commented Mar 10, 2020

Perhaps I've missed some Ignite-fu:

When using containers its common to find variations on this pattern in use:

echo piped content | docker run -i ubuntu:18.04 cat -

In Ignite (with autologin configured):

$ echo param here | sudo ignite start podman --interactive
INFO[0001] Networking is handled by "cni"               
INFO[0001] Started Firecracker VM "66b3b12ddabee624" in a container with ID "ignite-66b3b12ddabee624" 
66b3b12ddabee624
panic: provided file is not a console

goroutine 1 [running]:
github.com/containerd/console.Current(...)
        /go/src/github.com/weaveworks/ignite/vendor/github.com/containerd/console/console.go:67
github.com/weaveworks/ignite/pkg/runtime/containerd.(*ctdClient).AttachContainer(0xc0001e3bc0, 0xc000039480, 0x17, 0x0, 0x0)
        /go/src/github.com/weaveworks/ignite/pkg/runtime/containerd/client.go:318 +0xa01
github.com/weaveworks/ignite/cmd/ignite/run.Attach(0xc000081be0, 0xc0004b9c00, 0x0)
        /go/src/github.com/weaveworks/ignite/cmd/ignite/run/attach.go:34 +0x1c0
github.com/weaveworks/ignite/cmd/ignite/run.Start(0xc0000407f0, 0x7ffd1d8f3808, 0x6)
        /go/src/github.com/weaveworks/ignite/cmd/ignite/run/start.go:64 +0x2a1
github.com/weaveworks/ignite/cmd/ignite/cmd/vmcmd.NewCmdStart.func1.1(0xc0001e3260, 0xc0001e3540, 0x1, 0x2, 0x0, 0x0)
        /go/src/github.com/weaveworks/ignite/cmd/ignite/cmd/vmcmd/start.go:33 +0x80
github.com/weaveworks/ignite/cmd/ignite/cmd/vmcmd.NewCmdStart.func1(0xc00033cc80, 0xc0001e3540, 0x1, 0x2)
        /go/src/github.com/weaveworks/ignite/cmd/ignite/cmd/vmcmd/start.go:34 +0x48
github.com/spf13/cobra.(*Command).execute(0xc00033cc80, 0xc0001e34e0, 0x2, 0x2, 0xc00033cc80, 0xc0001e34e0)
        /go/src/github.com/weaveworks/ignite/vendor/github.com/spf13/cobra/command.go:830 +0x2ae
github.com/spf13/cobra.(*Command).ExecuteC(0xc0002c9b80, 0xc000096000, 0x12a5420, 0xc000096008)
        /go/src/github.com/weaveworks/ignite/vendor/github.com/spf13/cobra/command.go:914 +0x2fc
github.com/spf13/cobra.(*Command).Execute(...)
        /go/src/github.com/weaveworks/ignite/vendor/github.com/spf13/cobra/command.go:864
main.Run(0xc0004b9f88, 0xc00007e058)
        /go/src/github.com/weaveworks/ignite/cmd/ignite/ignite.go:24 +0xb5
main.main()
        /go/src/github.com/weaveworks/ignite/cmd/ignite/ignite.go:13 +0x22

Note in the above example /root/.profile contains:

if [ "$(tty)" == "/dev/ttyS0" ]; then
  echo 'Execute when login via ttyS0'
  cat -
fi
@taqtiqa-mark
Copy link
Author

taqtiqa-mark commented Mar 11, 2020

Just a note that the exec workaround requires SSH be installed and configured:

$ echo param here | sudo ignite exec podman cat -
[sudo] password for <user>: 
FATA[0000] no private key found for VM "66b3b12ddabee624"

@stealthybox
Copy link
Contributor

@darkowlzz will take a look at this soon.
He made some previous attempts before and knows the code better now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants