mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-24 09:17:53 +00:00
add the ability for the podman remote client to use a configuration file which describes its connections. users can now define a connection the configuration and then call it by name like: podman-remote -c connection1 and the destination and user will be derived from the configuration file. if no -c is provided, we look for a connection in the configuration file designated as 'default'. If the configuration file has only one connection, it will be deemed the 'default'. Signed-off-by: baude <bbaude@redhat.com>
21 lines
609 B
Go
21 lines
609 B
Go
package remoteclientconfig
|
|
|
|
const remoteConfigFileName string = "podman-remote.conf"
|
|
|
|
// RemoteConfig describes the podman remote configuration file
|
|
type RemoteConfig struct {
|
|
Connections map[string]RemoteConnection
|
|
}
|
|
|
|
// RemoteConnection describes the attributes of a podman-remote endpoint
|
|
type RemoteConnection struct {
|
|
Destination string `toml:"destination"`
|
|
Username string `toml:"username"`
|
|
IsDefault bool `toml:"default"`
|
|
}
|
|
|
|
// GetConfigFilePath is a simple helper to export the configuration file's
|
|
// path based on arch, etc
|
|
func GetConfigFilePath() string {
|
|
return getConfigFilePath()
|
|
}
|