Documentation ¶
Index ¶
- Variables
- func CreateCommands(source entities.ImageScpOptions, dest entities.ImageScpOptions, ...) ([]string, []string)
- func CreateConnection(url *url.URL, iden string) (*ssh.Client, string, error)
- func CreateSCPCommand(cmd *exec.Cmd, command []string) *exec.Cmd
- func ExecPodman(dest entities.ImageScpOptions, podman string, command []string) (string, error)
- func ExecRemoteCommand(dial *ssh.Client, run string) ([]byte, error)
- func ExecuteTransfer(src, dst string, parentFlags []string, quiet bool) (*entities.ImageLoadReport, *entities.ImageScpOptions, ...)
- func ExtractImage(out []byte) string
- func GetServiceInformation(sshInfo *entities.ImageScpConnections, cliConnections []string, ...) (map[string]config.Destination, error)
- func GetUserInfo(uri *url.URL) (*url.Userinfo, error)
- func IfPassesSecretsFilter(s secrets.Secret, filters map[string][]string) (bool, error)
- func LoadToRemote(dest entities.ImageScpOptions, localFile string, tag string, url *url.URL, ...) (string, string, error)
- func LoginUser(user string) (*exec.Cmd, error)
- func MakeRemoteFile(dial *ssh.Client) (string, error)
- func ParseImageSCPArg(arg string) (*entities.ImageScpOptions, []string, error)
- func RemoteArgLength(input string, side int) int
- func SaveToRemote(image, localFile string, tag string, uri *url.URL, iden string) error
- func ScpTag(cmd *exec.Cmd, podman string, dest entities.ImageScpOptions) error
- func ToLibpodFilters(f url.Values) (filters []string)
- func ToURLValues(f []string) (filters url.Values)
- func ValidateAndConfigure(uri *url.URL, iden string) (*ssh.ClientConfig, error)
- func ValidateImageName(input string) error
- func ValidateImagePortion(location entities.ImageScpOptions, arg string) (entities.ImageScpOptions, error)
- func ValidateSCPArgs(locations []*entities.ImageScpOptions) error
Constants ¶
This section is empty.
Variables ¶
var DeepCopy = func(dst interface{}, src interface{}) error { payload, err := json.Marshal(src) if err != nil { return err } err = json.Unmarshal(payload, dst) if err != nil { return err } return nil }
DeepCopy does a deep copy of a structure Error checking of parameters delegated to json engine
Functions ¶
func CreateCommands ¶ added in v4.2.0
func CreateCommands(source entities.ImageScpOptions, dest entities.ImageScpOptions, parentFlags []string, podman string) ([]string, []string)
createCommands forms the podman save and load commands used by SCP
func CreateConnection ¶ added in v4.2.0
createConnections takes a boolean determining which ssh client to dial and returns the dials client, its newly opened remote file, and an error if applicable.
func CreateSCPCommand ¶ added in v4.2.0
CreateSCPCommand takes an existing command, appends the given arguments and returns a configured podman command for image scp
func ExecPodman ¶ added in v4.2.0
execPodman executes the podman save/load command given the podman binary
func ExecRemoteCommand ¶ added in v4.2.0
ExecRemoteCommand takes a ssh client connection and a command to run and executes the command on the specified client. The function returns the Stdout from the client or the Stderr
func ExecuteTransfer ¶ added in v4.2.0
func ExecuteTransfer(src, dst string, parentFlags []string, quiet bool) (*entities.ImageLoadReport, *entities.ImageScpOptions, *entities.ImageScpOptions, []string, error)
func ExtractImage ¶ added in v4.2.0
ExtractImage pulls out the last line of output from save/load (image id)
func GetServiceInformation ¶ added in v4.2.0
func GetServiceInformation(sshInfo *entities.ImageScpConnections, cliConnections []string, cfg *config.Config) (map[string]config.Destination, error)
GetSerivceInformation takes the parsed list of hosts to connect to and validates the information
func IfPassesSecretsFilter ¶
func LoadToRemote ¶ added in v4.2.0
func LoadToRemote(dest entities.ImageScpOptions, localFile string, tag string, url *url.URL, iden string) (string, string, error)
loadToRemote takes image and remote connection information. it connects to the specified client and copies the saved image dir over to the remote host and then loads it onto the machine returns a string containing output or an error
func LoginUser ¶ added in v4.2.0
LoginUser starts the user process on the host so that image scp can use systemd-run
func MakeRemoteFile ¶ added in v4.2.0
makeRemoteFile creates the necessary remote file on the host to save or load the image to. returns a string with the file name or an error
func ParseImageSCPArg ¶ added in v4.2.0
func ParseImageSCPArg(arg string) (*entities.ImageScpOptions, []string, error)
parseImageSCPArg returns the valid connection, and source/destination data based off of the information provided by the user arg is a string containing one of the cli arguments returned is a filled out source/destination options structs as well as a connections array and an error if applicable
func RemoteArgLength ¶ added in v4.2.0
remoteArgLength is a helper function to simplify the extracting of host argument data returns an int which contains the length of a specified index in a host::image string
func SaveToRemote ¶ added in v4.2.0
saveToRemote takes image information and remote connection information. it connects to the specified client and saves the specified image on the remote machine and then copies it to the specified local location returns an error if one occurs.
func ScpTag ¶ added in v4.2.0
ScpTag is a helper function for native podman to tag an image after a local load from image SCP
func ToLibpodFilters ¶
func ToURLValues ¶
func ValidateAndConfigure ¶ added in v4.2.0
ValidateAndConfigure will take a ssh url and an identity key (rsa and the like) and ensure the information given is valid iden iden can be blank to mean no identity key once the function validates the information it creates and returns an ssh.ClientConfig.
func ValidateImageName ¶ added in v4.2.0
validateImageName makes sure that the image given is valid and no injections are occurring we simply use this for error checking, bot setting the image
func ValidateImagePortion ¶ added in v4.2.0
func ValidateImagePortion(location entities.ImageScpOptions, arg string) (entities.ImageScpOptions, error)
validateImagePortion is a helper function to validate the image name in an SCP argument
func ValidateSCPArgs ¶ added in v4.2.0
func ValidateSCPArgs(locations []*entities.ImageScpOptions) error
validateSCPArgs takes the array of source and destination options and checks for common errors
Types ¶
This section is empty.