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 util/
|
||||
gofmt -w -s upup/pkg/
|
||||
gofmt -w -s pkg/
|
||||
gofmt -w -s protokube/cmd
|
||||
gofmt -w -s protokube/pkg
|
||||
gofmt -w -s dns-controller/cmd
|
||||
|
|
|
|||
|
|
@ -488,7 +488,7 @@ func (z *ClusterZoneSpec) assignCIDR(c *Cluster) error {
|
|||
// We assume a maximum of 8 subnets per network
|
||||
// TODO: Does this make sense on GCE?
|
||||
// TODO: Should we limit this to say 1000 IPs per subnet? (any reason to?)
|
||||
index = index % 8 - 1
|
||||
index = index%8 - 1
|
||||
networkLength += 3
|
||||
|
||||
ip4 := cidr.IP.To4()
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ import (
|
|||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
)
|
||||
|
||||
|
||||
// Federation represents a federated set of kubernetes clusters
|
||||
type Federation struct {
|
||||
unversioned.TypeMeta `json:",inline"`
|
||||
|
|
|
|||
|
|
@ -17,12 +17,11 @@ limitations under the License.
|
|||
package kops
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/types"
|
||||
)
|
||||
|
||||
|
||||
// ObjectMeta is metadata that all persisted resources must have, which includes all objects
|
||||
// users must create.
|
||||
type ObjectMeta struct {
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@ limitations under the License.
|
|||
package install
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/apimachinery/announced"
|
||||
"k8s.io/kops/pkg/apis/kops"
|
||||
"k8s.io/kops/pkg/apis/kops/v1alpha1"
|
||||
"k8s.io/kubernetes/pkg/apimachinery/announced"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ package registry
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"k8s.io/kops/pkg/client/simple"
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -17,12 +17,11 @@ limitations under the License.
|
|||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/types"
|
||||
)
|
||||
|
||||
|
||||
// ObjectMeta is metadata that all persisted resources must have, which includes all objects
|
||||
// users must create.
|
||||
type ObjectMeta struct {
|
||||
|
|
|
|||
|
|
@ -304,7 +304,6 @@ func (c *Cluster) Validate(strict bool) error {
|
|||
c.Spec.Topology = &TopologySpec{Masters: TopologyPublic, Nodes: TopologyPublic}
|
||||
}
|
||||
|
||||
|
||||
if c.Spec.Topology.Masters != "" && c.Spec.Topology.Nodes != "" {
|
||||
if c.Spec.Topology.Masters != TopologyPublic && c.Spec.Topology.Masters != TopologyPrivate {
|
||||
return fmt.Errorf("Invalid Masters value for Topology")
|
||||
|
|
@ -315,7 +314,7 @@ func (c *Cluster) Validate(strict bool) error {
|
|||
return fmt.Errorf("Topology Nodes must match Topology Masters")
|
||||
}
|
||||
|
||||
}else{
|
||||
} else {
|
||||
return fmt.Errorf("Topology requires non-nil values for Masters and Nodes")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import (
|
|||
"github.com/golang/glog"
|
||||
api "k8s.io/kops/pkg/apis/kops"
|
||||
"k8s.io/kops/pkg/apis/kops/registry"
|
||||
"k8s.io/kops/pkg/apis/kops/v1alpha1"
|
||||
"k8s.io/kops/pkg/client/simple"
|
||||
"k8s.io/kops/util/pkg/vfs"
|
||||
k8sapi "k8s.io/kubernetes/pkg/api"
|
||||
|
|
@ -28,14 +29,13 @@ import (
|
|||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
"k8s.io/kops/pkg/apis/kops/v1alpha1"
|
||||
)
|
||||
|
||||
type ClusterVFS struct {
|
||||
commonVFS
|
||||
}
|
||||
|
||||
func newClusterVFS(basePath vfs.Path) (*ClusterVFS) {
|
||||
func newClusterVFS(basePath vfs.Path) *ClusterVFS {
|
||||
c := &ClusterVFS{}
|
||||
c.init("Cluster", basePath, v1alpha1.SchemeGroupVersion)
|
||||
defaultReadVersion := v1alpha1.SchemeGroupVersion.WithKind("Cluster")
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package vfsclientset
|
|||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/golang/glog"
|
||||
kops "k8s.io/kops/pkg/apis/kops"
|
||||
"k8s.io/kops/util/pkg/vfs"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
|
|
@ -27,7 +28,6 @@ import (
|
|||
"os"
|
||||
"reflect"
|
||||
"time"
|
||||
"github.com/golang/glog"
|
||||
)
|
||||
|
||||
type commonVFS struct {
|
||||
|
|
@ -101,7 +101,7 @@ func (c *commonVFS) serialize(o runtime.Object) ([]byte, error) {
|
|||
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()
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ func newFederationVFS(c *VFSClientset) *FederationVFS {
|
|||
var _ simple.FederationInterface = &FederationVFS{}
|
||||
|
||||
func (c *FederationVFS) Get(name string) (*api.Federation, error) {
|
||||
o, err := c.get(name,)
|
||||
o, err := c.get(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ package vfsclientset
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
_ "k8s.io/kops/pkg/apis/kops/install"
|
||||
_ "k8s.io/kubernetes/pkg/api/install"
|
||||
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||
_ "k8s.io/kops/pkg/apis/kops/install"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue