Skip to content

Instantly share code, notes, and snippets.

@ihcsim
Last active February 4, 2020 06:12
Show Gist options
  • Select an option

  • Save ihcsim/947cdc6c676b6e814ebcb0bcf9165034 to your computer and use it in GitHub Desktop.

Select an option

Save ihcsim/947cdc6c676b6e814ebcb0bcf9165034 to your computer and use it in GitHub Desktop.
// NewServer initializes and configures a kubelet.Server object to handle HTTP requests.
func NewServer(
// ...
criHandler http.Handler) Server {
// ...
if enableDebuggingHandlers {
server.InstallDebuggingHandlers(criHandler)
if enableContentionProfiling {
goruntime.SetBlockProfileRate(1)
}
} else {
server.InstallDebuggingDisabledHandlers()
}
return server
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment