Register the kubeadm api group in cmd/kubeadm

This commit is contained in:
Lucas Käldström 2016-10-15 22:18:23 +03:00
parent e9ecbd9c69
commit d46490c21e
4 changed files with 22 additions and 4 deletions

View File

@ -0,0 +1,17 @@
/*
Copyright 2016 The Kubernetes Authors.
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 install // import "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/install"

View File

@ -19,7 +19,7 @@ package v1alpha1
import "k8s.io/kubernetes/pkg/api/unversioned"
type MasterConfiguration struct {
unversioned.TypeMeta
unversioned.TypeMeta `json:",inline"`
Secrets Secrets `json:"secrets"`
API API `json:"api"`
@ -55,7 +55,7 @@ type Secrets struct {
}
type NodeConfiguration struct {
unversioned.TypeMeta
unversioned.TypeMeta `json:",inline"`
MasterAddresses []string `json:"masterAddresses"`
Secrets Secrets `json:"secrets"`
@ -63,7 +63,7 @@ type NodeConfiguration struct {
// ClusterInfo TODO add description
type ClusterInfo struct {
unversioned.TypeMeta
unversioned.TypeMeta `json:",inline"`
// TODO(phase1+) this may become simply `api.Config`
CertificateAuthorities []string `json:"certificateAuthorities"`
Endpoints []string `json:"endpoints"`

View File

@ -99,7 +99,7 @@ func NewJoin(cfgPath string, args []string, cfg *kubeadmapi.NodeConfiguration, s
}
// TODO(phase1+) this we are missing args from the help text, there should be a way to tell cobra about it
if len(args) == 0 {
if len(args) == 0 && len(cfg.MasterAddresses) == 0 {
return nil, fmt.Errorf("must specify master IP address (see --help)")
}
cfg.MasterAddresses = append(cfg.MasterAddresses, args...)

View File

@ -21,6 +21,7 @@ import (
"github.com/spf13/pflag"
_ "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/install"
"k8s.io/kubernetes/cmd/kubeadm/app/cmd"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/util/logs"