refactor!: drop all SSH opts / config handling

See coop-cloud/organising#601
See coop-cloud/organising#482
This commit is contained in:
2024-06-20 09:19:09 +02:00
parent 43990b6fae
commit aa3910f8df
4 changed files with 19 additions and 84 deletions

View File

@ -53,7 +53,7 @@ func cleanUp(domainName string) {
// Docker manages SSH connection details. These are stored to disk in
// ~/.docker. Abra can manage this completely for the user, so it's an
// implementation detail.
func newContext(c *cli.Context, domainName, username, port string) error {
func newContext(c *cli.Context, domainName string) error {
store := contextPkg.NewDefaultDockerContextStore()
contexts, err := store.Store.List()
if err != nil {
@ -67,9 +67,9 @@ func newContext(c *cli.Context, domainName, username, port string) error {
}
}
logrus.Debugf("creating context with domain %s, username %s and port %s", domainName, username, port)
logrus.Debugf("creating context with domain %s", domainName)
if err := client.CreateContext(domainName, username, port); err != nil {
if err := client.CreateContext(domainName); err != nil {
return err
}
@ -158,12 +158,7 @@ developer machine.
logrus.Fatal(err)
}
hostConfig, err := sshPkg.GetHostConfig(domainName)
if err != nil {
logrus.Fatal(err)
}
if err := newContext(c, domainName, hostConfig.User, hostConfig.Port); err != nil {
if err := newContext(c, domainName); err != nil {
logrus.Fatal(err)
}