keep hyperkube noise in one place

pull/6/head
Tim Hockin 2015-02-07 14:20:00 -08:00
parent 899d30f16a
commit cb09571768
3 changed files with 39 additions and 19 deletions

View File

@ -21,7 +21,6 @@ package main
import (
"os"
apiserver "github.com/GoogleCloudPlatform/kubernetes/cmd/kube-apiserver/app"
"github.com/GoogleCloudPlatform/kubernetes/pkg/controllermanager"
"github.com/GoogleCloudPlatform/kubernetes/pkg/hyperkube"
sched "github.com/GoogleCloudPlatform/kubernetes/plugin/pkg/scheduler/server"
@ -33,7 +32,7 @@ func main() {
Long: "This is an all-in-one binary that can run any of the various Kubernetes servers.",
}
hk.AddServer(apiserver.NewHyperkubeServer())
hk.AddServer(NewKubeAPIServer())
hk.AddServer(controllermanager.NewHyperkubeServer())
hk.AddServer(sched.NewHyperkubeServer())
hk.AddServer(NewKubelet())

View File

@ -0,0 +1,38 @@
/*
Copyright 2015 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
kubeapiserver "github.com/GoogleCloudPlatform/kubernetes/cmd/kube-apiserver/app"
"github.com/GoogleCloudPlatform/kubernetes/pkg/hyperkube"
)
// NewKubeAPIServer creates a new hyperkube Server object that includes the
// description and flags.
func NewKubeAPIServer() *hyperkube.Server {
s := kubeapiserver.NewAPIServer()
hks := hyperkube.Server{
SimpleUsage: "apiserver",
Long: "The main API entrypoint and interface to the storage system. The API server is also the focal point for all authorization decisions.",
Run: func(_ *hyperkube.Server, args []string) error {
return s.Run(args)
},
}
s.AddFlags(hks.Flags())
return &hks
}

View File

@ -33,7 +33,6 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/capabilities"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider"
"github.com/GoogleCloudPlatform/kubernetes/pkg/hyperkube"
"github.com/GoogleCloudPlatform/kubernetes/pkg/master"
"github.com/GoogleCloudPlatform/kubernetes/pkg/tools"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
@ -102,22 +101,6 @@ func NewAPIServer() *APIServer {
return &s
}
// NewHyperkubeServer creates a new hyperkube Server object that includes the
// description and flags.
func NewHyperkubeServer() *hyperkube.Server {
s := NewAPIServer()
hks := hyperkube.Server{
SimpleUsage: "apiserver",
Long: "The main API entrypoint and interface to the storage system. The API server is also the focal point for all authorization decisions.",
Run: func(_ *hyperkube.Server, args []string) error {
return s.Run(args)
},
}
s.AddFlags(hks.Flags())
return &hks
}
// AddFlags adds flags for a specific APIServer to the specified FlagSet
func (s *APIServer) AddFlags(fs *pflag.FlagSet) {
// Note: the weird ""+ in below lines seems to be the only way to get gofmt to