-
Notifications
You must be signed in to change notification settings - Fork 75
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
Use custom spec.api.port to check controller state #186
Conversation
Looks like something is broken |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need typecasting
phase/install_controllers.go
Outdated
@@ -79,6 +79,10 @@ func (p *InstallControllers) Run() error { | |||
} | |||
|
|||
func (p *InstallControllers) waitJoined(h *cluster.Host) error { | |||
port := p.Config.Spec.K0s.Config.Dig("spec", "api", "port").(int) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs something like:
port := 6443
if p, ok := p.Config.Spec.K0s.Config.Dig("spec", "api", "port").(int); ok {
port = p
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gives FATA[0015] PANIC: interface conversion: interface {} is nil, not int
when spec.api.port
not set otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh my bad! You are 💯% spot on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this fixed in the commits leading to 83dc9b3? if so, this is also failing with that error (which I don't known if its because this particular line that I'm commenting on):
# k0sctl kubeconfig --config /vagrant/shared/k0sctl.yaml
FATA PANIC: interface conversion: interface {} is nil, not int
phase/upgrade_controllers.go
Outdated
@@ -63,7 +63,11 @@ func (p *UpgradeControllers) Run() error { | |||
if err := h.WaitK0sServiceRunning(); err != nil { | |||
return err | |||
} | |||
if err := h.WaitKubeAPIReady(); err != nil { | |||
port := p.Config.Spec.K0s.Config.Dig("spec", "api", "port").(int) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as in install_controllers.go
Signed-off-by: erdii <me@erdii.engineering>
dac48ad
to
105df2e
Compare
for proper handling of nil values Signed-off-by: erdii <me@erdii.engineering>
105df2e
to
ee73a12
Compare
This reverts commit f6074e9.
Signed-off-by: erdii me@erdii.engineering