Machine refactor - part 1

the way machine was written was very adjunct and as such is in dire need
of refactoring to better structures and structure methods where
appropriate.  the weekest part is specifically around all the files that
machine requires and how some are just dynamically built on the fly.

this pr defines a new machinefile type which allows us to work with the
file and also takes into account the use of symlinks which are going to
be needed on macos due to its relatively short file length restriction.

also, added unit tests for new methods as well as anywhere else I saw a
need.

Signed-off-by: Brent Baude <bbaude@redhat.com>
This commit is contained in:
Brent Baude
2022-03-25 14:42:25 -05:00
parent 54f808e4dd
commit 2ac897aa0d
6 changed files with 318 additions and 13 deletions

View File

@ -29,7 +29,7 @@ type InitOptions struct {
Username string
ReExec bool
Rootful bool
// The numberical userid of the user that called machine
// The numerical userid of the user that called machine
UID string
}
@ -128,6 +128,7 @@ type DistributionDownload interface {
}
func (rc RemoteConnectionType) MakeSSHURL(host, path, port, userName string) url.URL {
//TODO Should this function have input verification?
userInfo := url.User(userName)
uri := url.URL{
Scheme: "ssh",