diff --git a/cmd/hyperkube/hyperkube.go b/cmd/hyperkube/hyperkube.go index 6d786e0a7bc..56e3916ac68 100644 --- a/cmd/hyperkube/hyperkube.go +++ b/cmd/hyperkube/hyperkube.go @@ -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()) diff --git a/cmd/hyperkube/kube-apiserver.go b/cmd/hyperkube/kube-apiserver.go new file mode 100644 index 00000000000..666db8f8ec4 --- /dev/null +++ b/cmd/hyperkube/kube-apiserver.go @@ -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 +} diff --git a/cmd/kube-apiserver/app/server.go b/cmd/kube-apiserver/app/server.go index 377f0477d8d..7cf3837f35a 100644 --- a/cmd/kube-apiserver/app/server.go +++ b/cmd/kube-apiserver/app/server.go @@ -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