diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-06-02 04:20:06 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-02 04:20:06 -0400 |
commit | f27f9de5e668afb50073f125f25f8f61618a5742 (patch) | |
tree | 2f754256eec22b716dd74a34414fb7341833d8ca /pkg/machine/config.go | |
parent | 516c95526ab68e4a6e13008d60d0156178c8571c (diff) | |
parent | 8291b51ceb50ca3230aeeeb27930111a27a31290 (diff) | |
download | podman-f27f9de5e668afb50073f125f25f8f61618a5742.tar.gz podman-f27f9de5e668afb50073f125f25f8f61618a5742.tar.bz2 podman-f27f9de5e668afb50073f125f25f8f61618a5742.zip |
Merge pull request #14448 from baude/issue14231
expose podman.sock in machine inspect
Diffstat (limited to 'pkg/machine/config.go')
-rw-r--r-- | pkg/machine/config.go | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/pkg/machine/config.go b/pkg/machine/config.go index d34776714..abbebc9f9 100644 --- a/pkg/machine/config.go +++ b/pkg/machine/config.go @@ -138,14 +138,15 @@ type DistributionDownload interface { Get() *Download } type InspectInfo struct { - ConfigPath VMFile - Created time.Time - Image ImageConfig - LastUp time.Time - Name string - Resources ResourceConfig - SSHConfig SSHConfig - State Status + ConfigPath VMFile + ConnectionInfo ConnectionConfig + Created time.Time + Image ImageConfig + LastUp time.Time + Name string + Resources ResourceConfig + SSHConfig SSHConfig + State Status } func (rc RemoteConnectionType) MakeSSHURL(host, path, port, userName string) url.URL { @@ -286,11 +287,11 @@ func NewMachineFile(path string, symlink *string) (*VMFile, error) { // makeSymlink for macOS creates a symlink in $HOME/.podman/ // for a machinefile like a socket func (m *VMFile) makeSymlink(symlink *string) error { - homedir, err := os.UserHomeDir() + homeDir, err := os.UserHomeDir() if err != nil { return err } - sl := filepath.Join(homedir, ".podman", *symlink) + sl := filepath.Join(homeDir, ".podman", *symlink) // make the symlink dir and throw away if it already exists if err := os.MkdirAll(filepath.Dir(sl), 0700); err != nil && !errors2.Is(err, os.ErrNotExist) { return err @@ -335,3 +336,9 @@ type SSHConfig struct { // RemoteUsername of the vm user RemoteUsername string } + +// ConnectionConfig contains connections like sockets, etc. +type ConnectionConfig struct { + // PodmanSocket is the exported podman service socket + PodmanSocket *VMFile `json:"PodmanSocket"` +} |