mirror of https://github.com/kubernetes/kops.git
Apply gofmt to pkg directory
It was omitted from the makefile `make gofmt`
This commit is contained in:
parent
ddfa3e467e
commit
35cd96f359
1
Makefile
1
Makefile
|
|
@ -201,6 +201,7 @@ gofmt:
|
||||||
gofmt -w -s federation/
|
gofmt -w -s federation/
|
||||||
gofmt -w -s util/
|
gofmt -w -s util/
|
||||||
gofmt -w -s upup/pkg/
|
gofmt -w -s upup/pkg/
|
||||||
|
gofmt -w -s pkg/
|
||||||
gofmt -w -s protokube/cmd
|
gofmt -w -s protokube/cmd
|
||||||
gofmt -w -s protokube/pkg
|
gofmt -w -s protokube/pkg
|
||||||
gofmt -w -s dns-controller/cmd
|
gofmt -w -s dns-controller/cmd
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ const DefaultChannel = "stable"
|
||||||
|
|
||||||
type Channel struct {
|
type Channel struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
unversioned.TypeMeta `json:",inline"`
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
Spec ChannelSpec `json:"spec,omitempty"`
|
Spec ChannelSpec `json:"spec,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -488,7 +488,7 @@ func (z *ClusterZoneSpec) assignCIDR(c *Cluster) error {
|
||||||
// We assume a maximum of 8 subnets per network
|
// We assume a maximum of 8 subnets per network
|
||||||
// TODO: Does this make sense on GCE?
|
// TODO: Does this make sense on GCE?
|
||||||
// TODO: Should we limit this to say 1000 IPs per subnet? (any reason to?)
|
// TODO: Should we limit this to say 1000 IPs per subnet? (any reason to?)
|
||||||
index = index % 8 - 1
|
index = index%8 - 1
|
||||||
networkLength += 3
|
networkLength += 3
|
||||||
|
|
||||||
ip4 := cidr.IP.To4()
|
ip4 := cidr.IP.To4()
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ import (
|
||||||
|
|
||||||
type KubeletConfig struct {
|
type KubeletConfig struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
unversioned.TypeMeta `json:",inline"`
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
Spec ClusterSpec `json:"spec,omitempty"`
|
Spec ClusterSpec `json:"spec,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
@ -374,24 +374,24 @@ type KubeAPIServerConfig struct {
|
||||||
|
|
||||||
LogLevel int `json:"logLevel,omitempty" flag:"v"`
|
LogLevel int `json:"logLevel,omitempty" flag:"v"`
|
||||||
|
|
||||||
CloudProvider string `json:"cloudProvider,omitempty" flag:"cloud-provider"`
|
CloudProvider string `json:"cloudProvider,omitempty" flag:"cloud-provider"`
|
||||||
SecurePort int `json:"securePort,omitempty" flag:"secure-port"`
|
SecurePort int `json:"securePort,omitempty" flag:"secure-port"`
|
||||||
Address string `json:"address,omitempty" flag:"address"`
|
Address string `json:"address,omitempty" flag:"address"`
|
||||||
EtcdServers []string `json:"etcdServers,omitempty" flag:"etcd-servers"`
|
EtcdServers []string `json:"etcdServers,omitempty" flag:"etcd-servers"`
|
||||||
EtcdServersOverrides []string `json:"etcdServersOverrides,omitempty" flag:"etcd-servers-overrides"`
|
EtcdServersOverrides []string `json:"etcdServersOverrides,omitempty" flag:"etcd-servers-overrides"`
|
||||||
AdmissionControl []string `json:"admissionControl,omitempty" flag:"admission-control"`
|
AdmissionControl []string `json:"admissionControl,omitempty" flag:"admission-control"`
|
||||||
ServiceClusterIPRange string `json:"serviceClusterIPRange,omitempty" flag:"service-cluster-ip-range"`
|
ServiceClusterIPRange string `json:"serviceClusterIPRange,omitempty" flag:"service-cluster-ip-range"`
|
||||||
ClientCAFile string `json:"clientCAFile,omitempty" flag:"client-ca-file"`
|
ClientCAFile string `json:"clientCAFile,omitempty" flag:"client-ca-file"`
|
||||||
BasicAuthFile string `json:"basicAuthFile,omitempty" flag:"basic-auth-file"`
|
BasicAuthFile string `json:"basicAuthFile,omitempty" flag:"basic-auth-file"`
|
||||||
TLSCertFile string `json:"tlsCertFile,omitempty" flag:"tls-cert-file"`
|
TLSCertFile string `json:"tlsCertFile,omitempty" flag:"tls-cert-file"`
|
||||||
TLSPrivateKeyFile string `json:"tlsPrivateKeyFile,omitempty" flag:"tls-private-key-file"`
|
TLSPrivateKeyFile string `json:"tlsPrivateKeyFile,omitempty" flag:"tls-private-key-file"`
|
||||||
TokenAuthFile string `json:"tokenAuthFile,omitempty" flag:"token-auth-file"`
|
TokenAuthFile string `json:"tokenAuthFile,omitempty" flag:"token-auth-file"`
|
||||||
AllowPrivileged *bool `json:"allowPrivileged,omitempty" flag:"allow-privileged"`
|
AllowPrivileged *bool `json:"allowPrivileged,omitempty" flag:"allow-privileged"`
|
||||||
APIServerCount *int `json:"apiServerCount,omitempty" flag:"apiserver-count"`
|
APIServerCount *int `json:"apiServerCount,omitempty" flag:"apiserver-count"`
|
||||||
// keys and values in RuntimeConfig are parsed into the `--runtime-config` parameter
|
// keys and values in RuntimeConfig are parsed into the `--runtime-config` parameter
|
||||||
// for KubeAPIServer, concatenated with commas. ex: `--runtime-config=key1=value1,key2=value2`.
|
// for KubeAPIServer, concatenated with commas. ex: `--runtime-config=key1=value1,key2=value2`.
|
||||||
// Use this to enable alpha resources on kube-apiserver
|
// Use this to enable alpha resources on kube-apiserver
|
||||||
RuntimeConfig map[string]string `json:"runtimeConfig,omitempty" flag:"runtime-config"`
|
RuntimeConfig map[string]string `json:"runtimeConfig,omitempty" flag:"runtime-config"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type KubeControllerManagerConfig struct {
|
type KubeControllerManagerConfig struct {
|
||||||
|
|
|
||||||
|
|
@ -18,4 +18,4 @@ limitations under the License.
|
||||||
// +k8s:conversion-gen=k8s.io/kops/pkg/apis/kops
|
// +k8s:conversion-gen=k8s.io/kops/pkg/apis/kops
|
||||||
|
|
||||||
// +groupName=kops.k8s.io
|
// +groupName=kops.k8s.io
|
||||||
package kops // import "k8s.io/kops/pkg/apis/kops"
|
package kops // import "k8s.io/kops/pkg/apis/kops"
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,10 @@ import (
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
// Federation represents a federated set of kubernetes clusters
|
// Federation represents a federated set of kubernetes clusters
|
||||||
type Federation struct {
|
type Federation struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
unversioned.TypeMeta `json:",inline"`
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
Spec FederationSpec `json:"spec,omitempty"`
|
Spec FederationSpec `json:"spec,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
@ -33,7 +32,7 @@ type FederationSpec struct {
|
||||||
Controllers []string `json:"controllers,omitempty"`
|
Controllers []string `json:"controllers,omitempty"`
|
||||||
Members []string `json:"members,omitempty"`
|
Members []string `json:"members,omitempty"`
|
||||||
|
|
||||||
DNSName string `json:"dnsName,omitempty"`
|
DNSName string `json:"dnsName,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type FederationList struct {
|
type FederationList struct {
|
||||||
|
|
|
||||||
|
|
@ -17,12 +17,11 @@ limitations under the License.
|
||||||
package kops
|
package kops
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
|
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||||
"k8s.io/kubernetes/pkg/types"
|
"k8s.io/kubernetes/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
// ObjectMeta is metadata that all persisted resources must have, which includes all objects
|
// ObjectMeta is metadata that all persisted resources must have, which includes all objects
|
||||||
// users must create.
|
// users must create.
|
||||||
type ObjectMeta struct {
|
type ObjectMeta struct {
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,9 @@ limitations under the License.
|
||||||
package install
|
package install
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/apimachinery/announced"
|
|
||||||
"k8s.io/kops/pkg/apis/kops"
|
"k8s.io/kops/pkg/apis/kops"
|
||||||
"k8s.io/kops/pkg/apis/kops/v1alpha1"
|
"k8s.io/kops/pkg/apis/kops/v1alpha1"
|
||||||
|
"k8s.io/kubernetes/pkg/apimachinery/announced"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
@ -33,7 +33,7 @@ func init() {
|
||||||
AddInternalObjectsToScheme: kops.AddToScheme,
|
AddInternalObjectsToScheme: kops.AddToScheme,
|
||||||
},
|
},
|
||||||
announced.VersionToSchemeFunc{
|
announced.VersionToSchemeFunc{
|
||||||
v1alpha1.SchemeGroupVersion.Version: v1alpha1.AddToScheme,
|
v1alpha1.SchemeGroupVersion.Version: v1alpha1.AddToScheme,
|
||||||
},
|
},
|
||||||
).Announce().RegisterAndEnable(); err != nil {
|
).Announce().RegisterAndEnable(); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ import (
|
||||||
// InstanceGroup represents a group of instances (either nodes or masters) with the same configuration
|
// InstanceGroup represents a group of instances (either nodes or masters) with the same configuration
|
||||||
type InstanceGroup struct {
|
type InstanceGroup struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
unversioned.TypeMeta `json:",inline"`
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
Spec InstanceGroupSpec `json:"spec,omitempty"`
|
Spec InstanceGroupSpec `json:"spec,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ import (
|
||||||
|
|
||||||
var (
|
var (
|
||||||
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
|
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
|
||||||
AddToScheme = SchemeBuilder.AddToScheme
|
AddToScheme = SchemeBuilder.AddToScheme
|
||||||
)
|
)
|
||||||
|
|
||||||
// GroupName is the group name use in this package
|
// GroupName is the group name use in this package
|
||||||
|
|
@ -59,4 +59,4 @@ func (obj *InstanceGroup) GetObjectKind() unversioned.ObjectKind {
|
||||||
}
|
}
|
||||||
func (obj *Federation) GetObjectKind() unversioned.ObjectKind {
|
func (obj *Federation) GetObjectKind() unversioned.ObjectKind {
|
||||||
return &obj.TypeMeta
|
return &obj.TypeMeta
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@ package registry
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"k8s.io/kops/pkg/client/simple"
|
|
||||||
api "k8s.io/kops/pkg/apis/kops"
|
api "k8s.io/kops/pkg/apis/kops"
|
||||||
|
"k8s.io/kops/pkg/client/simple"
|
||||||
)
|
)
|
||||||
|
|
||||||
func CreateClusterConfig(clientset simple.Clientset, cluster *api.Cluster, groups []*api.InstanceGroup) error {
|
func CreateClusterConfig(clientset simple.Clientset, cluster *api.Cluster, groups []*api.InstanceGroup) error {
|
||||||
|
|
|
||||||
|
|
@ -17,19 +17,19 @@ limitations under the License.
|
||||||
package kops
|
package kops
|
||||||
|
|
||||||
const (
|
const (
|
||||||
TopologyPublic = "public"
|
TopologyPublic = "public"
|
||||||
TopologyPrivate = "private"
|
TopologyPrivate = "private"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TopologySpec struct {
|
type TopologySpec struct {
|
||||||
// The environment to launch the Kubernetes masters in public|private
|
// The environment to launch the Kubernetes masters in public|private
|
||||||
Masters string `json:"masters,omitempty"`
|
Masters string `json:"masters,omitempty"`
|
||||||
|
|
||||||
// The environment to launch the Kubernetes nodes in public|private
|
// The environment to launch the Kubernetes nodes in public|private
|
||||||
Nodes string `json:"nodes,omitempty"`
|
Nodes string `json:"nodes,omitempty"`
|
||||||
|
|
||||||
// Controls if a private topology should deploy a bastion host or not
|
// Controls if a private topology should deploy a bastion host or not
|
||||||
// The bastion host is designed to be a simple, and secure bridge between
|
// The bastion host is designed to be a simple, and secure bridge between
|
||||||
// the public subnet and the private subnet
|
// the public subnet and the private subnet
|
||||||
BypassBastion bool `json:"bypassBastion,omitempty"`
|
BypassBastion bool `json:"bypassBastion,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ import (
|
||||||
|
|
||||||
type KubeletConfig struct {
|
type KubeletConfig struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
unversioned.TypeMeta `json:",inline"`
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
Spec ClusterSpec `json:"spec,omitempty"`
|
Spec ClusterSpec `json:"spec,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,4 +18,4 @@ limitations under the License.
|
||||||
// +k8s:conversion-gen=k8s.io/kops/pkg/apis/kops
|
// +k8s:conversion-gen=k8s.io/kops/pkg/apis/kops
|
||||||
|
|
||||||
// +groupName=kops.k8s.io
|
// +groupName=kops.k8s.io
|
||||||
package v1alpha1 // import "k8s.io/kops/pkg/apis/kops/v1alpha1"
|
package v1alpha1 // import "k8s.io/kops/pkg/apis/kops/v1alpha1"
|
||||||
|
|
|
||||||
|
|
@ -17,14 +17,14 @@ limitations under the License.
|
||||||
package v1alpha1
|
package v1alpha1
|
||||||
|
|
||||||
type DockerConfig struct {
|
type DockerConfig struct {
|
||||||
Bridge *string `json:"bridge,omitempty" flag:"bridge"`
|
Bridge *string `json:"bridge,omitempty" flag:"bridge"`
|
||||||
LogLevel *string `json:"logLevel,omitempty" flag:"log-level"`
|
LogLevel *string `json:"logLevel,omitempty" flag:"log-level"`
|
||||||
IPTables *bool `json:"ipTables,omitempty" flag:"iptables"`
|
IPTables *bool `json:"ipTables,omitempty" flag:"iptables"`
|
||||||
IPMasq *bool `json:"ipMasq,omitempty" flag:"ip-masq"`
|
IPMasq *bool `json:"ipMasq,omitempty" flag:"ip-masq"`
|
||||||
|
|
||||||
// Storage maps to the docker storage flag
|
// Storage maps to the docker storage flag
|
||||||
// But nodeup will also process a comma-separate list, selecting the first supported option
|
// But nodeup will also process a comma-separate list, selecting the first supported option
|
||||||
Storage *string `json:"storage,omitempty" flag:"storage-driver"`
|
Storage *string `json:"storage,omitempty" flag:"storage-driver"`
|
||||||
|
|
||||||
InsecureRegistry *string `json:"insecureRegistry,omitempty" flag:"insecure-registry"`
|
InsecureRegistry *string `json:"insecureRegistry,omitempty" flag:"insecure-registry"`
|
||||||
MTU *int `json:"mtu,omitempty" flag:"mtu"`
|
MTU *int `json:"mtu,omitempty" flag:"mtu"`
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import (
|
||||||
|
|
||||||
type Federation struct {
|
type Federation struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
unversioned.TypeMeta `json:",inline"`
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
Spec FederationSpec `json:"spec"`
|
Spec FederationSpec `json:"spec"`
|
||||||
}
|
}
|
||||||
|
|
@ -31,7 +31,7 @@ type FederationSpec struct {
|
||||||
Controllers []string `json:"controllers,omitempty"`
|
Controllers []string `json:"controllers,omitempty"`
|
||||||
Members []string `json:"members,omitempty"`
|
Members []string `json:"members,omitempty"`
|
||||||
|
|
||||||
DNSName string `json:"dnsName,omitempty"`
|
DNSName string `json:"dnsName,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type FederationList struct {
|
type FederationList struct {
|
||||||
|
|
|
||||||
|
|
@ -17,12 +17,11 @@ limitations under the License.
|
||||||
package v1alpha1
|
package v1alpha1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
|
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||||
"k8s.io/kubernetes/pkg/types"
|
"k8s.io/kubernetes/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
// ObjectMeta is metadata that all persisted resources must have, which includes all objects
|
// ObjectMeta is metadata that all persisted resources must have, which includes all objects
|
||||||
// users must create.
|
// users must create.
|
||||||
type ObjectMeta struct {
|
type ObjectMeta struct {
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ import (
|
||||||
// InstanceGroup represents a group of instances (either nodes or masters) with the same configuration
|
// InstanceGroup represents a group of instances (either nodes or masters) with the same configuration
|
||||||
type InstanceGroup struct {
|
type InstanceGroup struct {
|
||||||
unversioned.TypeMeta `json:",inline"`
|
unversioned.TypeMeta `json:",inline"`
|
||||||
ObjectMeta `json:"metadata,omitempty"`
|
ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
Spec InstanceGroupSpec `json:"spec,omitempty"`
|
Spec InstanceGroupSpec `json:"spec,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ import (
|
||||||
|
|
||||||
var (
|
var (
|
||||||
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
|
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
|
||||||
AddToScheme = SchemeBuilder.AddToScheme
|
AddToScheme = SchemeBuilder.AddToScheme
|
||||||
)
|
)
|
||||||
|
|
||||||
// GroupName is the group name use in this package
|
// GroupName is the group name use in this package
|
||||||
|
|
@ -59,4 +59,4 @@ func (obj *InstanceGroup) GetObjectKind() unversioned.ObjectKind {
|
||||||
}
|
}
|
||||||
func (obj *Federation) GetObjectKind() unversioned.ObjectKind {
|
func (obj *Federation) GetObjectKind() unversioned.ObjectKind {
|
||||||
return &obj.TypeMeta
|
return &obj.TypeMeta
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,19 +17,19 @@ limitations under the License.
|
||||||
package v1alpha1
|
package v1alpha1
|
||||||
|
|
||||||
const (
|
const (
|
||||||
TopologyPublic = "public"
|
TopologyPublic = "public"
|
||||||
TopologyPrivate = "private"
|
TopologyPrivate = "private"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TopologySpec struct {
|
type TopologySpec struct {
|
||||||
// The environment to launch the Kubernetes masters in public|private
|
// The environment to launch the Kubernetes masters in public|private
|
||||||
Masters string `json:"masters,omitempty"`
|
Masters string `json:"masters,omitempty"`
|
||||||
|
|
||||||
// The environment to launch the Kubernetes nodes in public|private
|
// The environment to launch the Kubernetes nodes in public|private
|
||||||
Nodes string `json:"nodes,omitempty"`
|
Nodes string `json:"nodes,omitempty"`
|
||||||
|
|
||||||
// Controls if a private topology should deploy a bastion host or not
|
// Controls if a private topology should deploy a bastion host or not
|
||||||
// The bastion host is designed to be a simple, and secure bridge between
|
// The bastion host is designed to be a simple, and secure bridge between
|
||||||
// the public subnet and the private subnet
|
// the public subnet and the private subnet
|
||||||
BypassBastion bool `json:"bypassBastion,omitempty"`
|
BypassBastion bool `json:"bypassBastion,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -304,18 +304,17 @@ func (c *Cluster) Validate(strict bool) error {
|
||||||
c.Spec.Topology = &TopologySpec{Masters: TopologyPublic, Nodes: TopologyPublic}
|
c.Spec.Topology = &TopologySpec{Masters: TopologyPublic, Nodes: TopologyPublic}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if c.Spec.Topology.Masters != "" && c.Spec.Topology.Nodes != "" {
|
if c.Spec.Topology.Masters != "" && c.Spec.Topology.Nodes != "" {
|
||||||
if c.Spec.Topology.Masters != TopologyPublic && c.Spec.Topology.Masters != TopologyPrivate {
|
if c.Spec.Topology.Masters != TopologyPublic && c.Spec.Topology.Masters != TopologyPrivate {
|
||||||
return fmt.Errorf("Invalid Masters value for Topology")
|
return fmt.Errorf("Invalid Masters value for Topology")
|
||||||
} else if c.Spec.Topology.Nodes != TopologyPublic && c.Spec.Topology.Nodes != TopologyPrivate {
|
} else if c.Spec.Topology.Nodes != TopologyPublic && c.Spec.Topology.Nodes != TopologyPrivate {
|
||||||
return fmt.Errorf("Invalid Nodes value for Topology")
|
return fmt.Errorf("Invalid Nodes value for Topology")
|
||||||
// Until we support other topologies - these must match
|
// Until we support other topologies - these must match
|
||||||
} else if c.Spec.Topology.Masters != c.Spec.Topology.Nodes {
|
} else if c.Spec.Topology.Masters != c.Spec.Topology.Nodes {
|
||||||
return fmt.Errorf("Topology Nodes must match Topology Masters")
|
return fmt.Errorf("Topology Nodes must match Topology Masters")
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
} else {
|
||||||
return fmt.Errorf("Topology requires non-nil values for Masters and Nodes")
|
return fmt.Errorf("Topology requires non-nil values for Masters and Nodes")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import (
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
api "k8s.io/kops/pkg/apis/kops"
|
api "k8s.io/kops/pkg/apis/kops"
|
||||||
"k8s.io/kops/pkg/apis/kops/registry"
|
"k8s.io/kops/pkg/apis/kops/registry"
|
||||||
|
"k8s.io/kops/pkg/apis/kops/v1alpha1"
|
||||||
"k8s.io/kops/pkg/client/simple"
|
"k8s.io/kops/pkg/client/simple"
|
||||||
"k8s.io/kops/util/pkg/vfs"
|
"k8s.io/kops/util/pkg/vfs"
|
||||||
k8sapi "k8s.io/kubernetes/pkg/api"
|
k8sapi "k8s.io/kubernetes/pkg/api"
|
||||||
|
|
@ -28,14 +29,13 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
"k8s.io/kops/pkg/apis/kops/v1alpha1"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type ClusterVFS struct {
|
type ClusterVFS struct {
|
||||||
commonVFS
|
commonVFS
|
||||||
}
|
}
|
||||||
|
|
||||||
func newClusterVFS(basePath vfs.Path) (*ClusterVFS) {
|
func newClusterVFS(basePath vfs.Path) *ClusterVFS {
|
||||||
c := &ClusterVFS{}
|
c := &ClusterVFS{}
|
||||||
c.init("Cluster", basePath, v1alpha1.SchemeGroupVersion)
|
c.init("Cluster", basePath, v1alpha1.SchemeGroupVersion)
|
||||||
defaultReadVersion := v1alpha1.SchemeGroupVersion.WithKind("Cluster")
|
defaultReadVersion := v1alpha1.SchemeGroupVersion.WithKind("Cluster")
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ package vfsclientset
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/golang/glog"
|
||||||
kops "k8s.io/kops/pkg/apis/kops"
|
kops "k8s.io/kops/pkg/apis/kops"
|
||||||
"k8s.io/kops/util/pkg/vfs"
|
"k8s.io/kops/util/pkg/vfs"
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
|
|
@ -27,14 +28,13 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
"time"
|
"time"
|
||||||
"github.com/golang/glog"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type commonVFS struct {
|
type commonVFS struct {
|
||||||
kind string
|
kind string
|
||||||
basePath vfs.Path
|
basePath vfs.Path
|
||||||
decoder runtime.Decoder
|
decoder runtime.Decoder
|
||||||
encoder runtime.Encoder
|
encoder runtime.Encoder
|
||||||
defaultReadVersion *unversioned.GroupVersionKind
|
defaultReadVersion *unversioned.GroupVersionKind
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -101,7 +101,7 @@ func (c *commonVFS) serialize(o runtime.Object) ([]byte, error) {
|
||||||
return b.Bytes(), nil
|
return b.Bytes(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c*commonVFS) readConfig(configPath vfs.Path) (runtime.Object, error) {
|
func (c *commonVFS) readConfig(configPath vfs.Path) (runtime.Object, error) {
|
||||||
data, err := configPath.ReadFile()
|
data, err := configPath.ReadFile()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ func newFederationVFS(c *VFSClientset) *FederationVFS {
|
||||||
var _ simple.FederationInterface = &FederationVFS{}
|
var _ simple.FederationInterface = &FederationVFS{}
|
||||||
|
|
||||||
func (c *FederationVFS) Get(name string) (*api.Federation, error) {
|
func (c *FederationVFS) Get(name string) (*api.Federation, error) {
|
||||||
o, err := c.get(name,)
|
o, err := c.get(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,9 @@ package vfsclientset
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
_ "k8s.io/kops/pkg/apis/kops/install"
|
||||||
_ "k8s.io/kubernetes/pkg/api/install"
|
_ "k8s.io/kubernetes/pkg/api/install"
|
||||||
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||||
_ "k8s.io/kops/pkg/apis/kops/install"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue