mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-08-18 08:17:05 +00:00
🐛 Fix the cleanup of ssh users (#38)
This commit is contained in:
parent
2ed54a0d2d
commit
b55e3e0800
@ -128,6 +128,7 @@ func detectDevice() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func InteractiveInstall(debug, spawnShell bool) error {
|
func InteractiveInstall(debug, spawnShell bool) error {
|
||||||
|
var sshUsers []string
|
||||||
bus.Manager.Initialize()
|
bus.Manager.Initialize()
|
||||||
|
|
||||||
cmd.PrintBranding(DefaultBanner)
|
cmd.PrintBranding(DefaultBanner)
|
||||||
@ -183,12 +184,14 @@ func InteractiveInstall(debug, spawnShell bool) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cleanup the users if we selected the default values as they are not valid users
|
// Cleanup the users if we selected the default values as they are not valid users
|
||||||
if users == "github:someuser,github:someuser2" {
|
if users == "github:someuser,github:someuser2" {
|
||||||
users = ""
|
users = ""
|
||||||
}
|
}
|
||||||
sshUsers := strings.Split(users, ",")
|
if users != "" {
|
||||||
|
sshUsers = strings.Split(users, ",")
|
||||||
|
}
|
||||||
|
|
||||||
// Prompt the user by prompts defined by the provider
|
// Prompt the user by prompts defined by the provider
|
||||||
r := []events.YAMLPrompt{}
|
r := []events.YAMLPrompt{}
|
||||||
@ -246,7 +249,7 @@ func InteractiveInstall(debug, spawnShell bool) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If we got no ssh keys, we don't need network, do the user as soon as possible
|
// If we got no ssh keys, we don't need network, do the user as soon as possible
|
||||||
if len(user.SSHAuthorizedKeys) == 0 {
|
if len(sshUsers) == 0 {
|
||||||
stage = config.InitramfsStage.String()
|
stage = config.InitramfsStage.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user