Skip to content

Commit

Permalink
Merge pull request kubernetes#23914 from rphillips/backport/61330
Browse files Browse the repository at this point in the history
[3.11] BUG 1758267: UPSTREAM: 61330: fix workgroup panic bug

Origin-commit: 7618f0a8e440ff860081bd0904b6ef8a7d385362
  • Loading branch information
k8s-publishing-bot committed Oct 3, 2019
2 parents 9d48128 + 6ef1bfc commit ad88da9
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions cmd/kubelet/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
"path"
"path/filepath"
"strconv"
"sync"
"time"

"github.com/coreos/go-systemd/daemon"
Expand Down Expand Up @@ -999,31 +998,19 @@ func RunKubelet(kubeFlags *options.KubeletFlags, kubeCfg *kubeletconfiginternal.
}

func startKubelet(k kubelet.Bootstrap, podCfg *config.PodConfig, kubeCfg *kubeletconfiginternal.KubeletConfiguration, kubeDeps *kubelet.Dependencies, enableServer bool) {
wg := sync.WaitGroup{}

// start the kubelet
wg.Add(1)
go wait.Until(func() {
wg.Done()
k.Run(podCfg.Updates())
}, 0, wait.NeverStop)

// start the kubelet server
if enableServer {
wg.Add(1)
go wait.Until(func() {
wg.Done()
k.ListenAndServe(net.ParseIP(kubeCfg.Address), uint(kubeCfg.Port), kubeDeps.TLSOptions, kubeDeps.Auth, kubeCfg.EnableDebuggingHandlers, kubeCfg.EnableContentionProfiling)
}, 0, wait.NeverStop)
go k.ListenAndServe(net.ParseIP(kubeCfg.Address), uint(kubeCfg.Port), kubeDeps.TLSOptions, kubeDeps.Auth, kubeCfg.EnableDebuggingHandlers, kubeCfg.EnableContentionProfiling)

}
if kubeCfg.ReadOnlyPort > 0 {
wg.Add(1)
go wait.Until(func() {
wg.Done()
k.ListenAndServeReadOnly(net.ParseIP(kubeCfg.Address), uint(kubeCfg.ReadOnlyPort))
}, 0, wait.NeverStop)
go k.ListenAndServeReadOnly(net.ParseIP(kubeCfg.Address), uint(kubeCfg.ReadOnlyPort))
}
wg.Wait()
}

func CreateAndInitKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
Expand Down

0 comments on commit ad88da9

Please sign in to comment.