Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix double unquoting of install flags during host fact gathering phase #246

Merged
merged 1 commit into from
Oct 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions phase/gather_facts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package phase

import (
"fmt"
"strconv"

"github.com/k0sproject/k0sctl/config/cluster"
log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -37,22 +36,12 @@ func (p *GatherFacts) investigateHost(h *cluster.Host) error {

extra := h.InstallFlags.GetValue("--kubelet-extra-args")
if extra != "" {
unq, err := strconv.Unquote(extra)
if err != nil {
return err
}
ef := cluster.Flags{unq}
ef := cluster.Flags{extra}
if over := ef.GetValue("--hostname-override"); over != "" {
unq, err = strconv.Unquote(over)
if err != nil {
return err
}
if over != "" {
if h.HostnameOverride != unq {
return fmt.Errorf("hostname and installFlags kubelet-extra-args hostname-override mismatch, only define either one")
}
h.HostnameOverride = unq
if h.HostnameOverride != over {
return fmt.Errorf("hostname and installFlags kubelet-extra-args hostname-override mismatch, only define either one")
}
h.HostnameOverride = over
}
}

Expand Down