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

@ -14,19 +14,16 @@ import (
type Context = contextStore.Metadata
func CreateContext(contextName string, user string, port string) error {
host := contextName
if user != "" {
host = fmt.Sprintf("%s@%s", user, host)
}
if port != "" {
host = fmt.Sprintf("%s:%s", host, port)
}
host = fmt.Sprintf("ssh://%s", host)
// CreateContext creates a new Docker context.
func CreateContext(contextName string) error {
host := fmt.Sprintf("ssh://%s", contextName)
if err := createContext(contextName, host); err != nil {
return err
}
logrus.Debugf("created the %s context", contextName)
return nil
}