cloud-controller-manager: add test server

This commit is contained in:
Dr. Stefan Schimanski
2018-08-28 12:58:40 +02:00
parent 88035a4599
commit c9913269a6
3 changed files with 207 additions and 3 deletions

View File

@@ -71,7 +71,7 @@ the cloud specific control loops shipped with Kubernetes.`,
os.Exit(1)
}
if err := Run(c.Complete()); err != nil {
if err := Run(c.Complete(), wait.NeverStop); err != nil {
fmt.Fprintf(os.Stderr, "%v\n", err)
os.Exit(1)
}
@@ -100,7 +100,7 @@ the cloud specific control loops shipped with Kubernetes.`,
}
// Run runs the ExternalCMServer. This should never exit.
func Run(c *cloudcontrollerconfig.CompletedConfig) error {
func Run(c *cloudcontrollerconfig.CompletedConfig, stopCh <-chan struct{}) error {
cloud, err := cloudprovider.InitCloudProvider(c.ComponentConfig.CloudProvider.Name, c.ComponentConfig.CloudProvider.CloudConfigFile)
if err != nil {
glog.Fatalf("Cloud provider could not be initialized: %v", err)
@@ -125,7 +125,6 @@ func Run(c *cloudcontrollerconfig.CompletedConfig) error {
}
// Start the controller manager HTTP server
stopCh := make(chan struct{})
if c.SecureServing != nil {
unsecuredMux := genericcontrollermanager.NewBaseHandler(&c.ComponentConfig.Debugging)
handler := genericcontrollermanager.BuildHandlerChain(unsecuredMux, &c.Authorization, &c.Authentication)