Split the Kubelet flag options and struct

Reduces the size of the app/server.go file and ensures that the flags
and their defaults are clearly separated.
This commit is contained in:
Clayton Coleman
2015-12-24 18:46:56 -05:00
parent b1e4831265
commit 791d160b42
21 changed files with 410 additions and 358 deletions

View File

@@ -17,13 +17,14 @@ limitations under the License.
package main
import (
kubeletapp "k8s.io/kubernetes/cmd/kubelet/app"
"k8s.io/kubernetes/cmd/kubelet/app"
"k8s.io/kubernetes/cmd/kubelet/app/options"
)
// NewKubelet creates a new hyperkube Server object that includes the
// description and flags.
func NewKubelet() *Server {
s := kubeletapp.NewKubeletServer()
s := options.NewKubeletServer()
hks := Server{
SimpleUsage: "kubelet",
Long: `The kubelet binary is responsible for maintaining a set of containers on a
@@ -33,7 +34,7 @@ func NewKubelet() *Server {
configuration data, with the running set of containers by starting or stopping
Docker containers.`,
Run: func(_ *Server, _ []string) error {
return s.Run(nil)
return app.Run(s, nil)
},
}
s.AddFlags(hks.Flags())