Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating files for goimports - and fixed a unit test #3752

Merged
merged 3 commits into from
Nov 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ language: go
go:
- 1.8
- 1.9
- tip
# removed because of govet issue with apimahcinery
# - tip

go_import_path: k8s.io/kops

Expand Down
3 changes: 2 additions & 1 deletion cloudmock/aws/mockec2/subnets.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ package mockec2

import (
"fmt"
"strings"

"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/golang/glog"
"strings"
)

type subnetInfo struct {
Expand Down
3 changes: 2 additions & 1 deletion pkg/assets/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ limitations under the License.
package assets

import (
"k8s.io/kops/pkg/apis/kops"
"testing"

"k8s.io/kops/pkg/apis/kops"
)

func TestRemap_File(t *testing.T) {
Expand Down
7 changes: 4 additions & 3 deletions pkg/client/simple/vfsclientset/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ package vfsclientset

import (
"fmt"
"os"
"strings"
"time"

"github.com/golang/glog"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
Expand All @@ -28,9 +32,6 @@ import (
"k8s.io/kops/pkg/apis/kops/v1alpha1"
"k8s.io/kops/pkg/apis/kops/validation"
"k8s.io/kops/util/pkg/vfs"
"os"
"strings"
"time"
)

type ClusterVFS struct {
Expand Down
9 changes: 5 additions & 4 deletions pkg/client/simple/vfsclientset/commonvfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ package vfsclientset
import (
"bytes"
"fmt"
"os"
"reflect"
"sort"
"time"

"github.com/golang/glog"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -30,10 +35,6 @@ import (
"k8s.io/kops/pkg/apis/kops/v1alpha2"
"k8s.io/kops/pkg/kopscodecs"
"k8s.io/kops/util/pkg/vfs"
"os"
"reflect"
"sort"
"time"
)

var StoreVersion = v1alpha2.SchemeGroupVersion
Expand Down
1 change: 1 addition & 0 deletions pkg/client/simple/vfsclientset/federation.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package vfsclientset

import (
"fmt"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
Expand Down
1 change: 1 addition & 0 deletions pkg/client/simple/vfsclientset/instancegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package vfsclientset

import (
"fmt"

"github.com/golang/glog"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down
5 changes: 3 additions & 2 deletions pkg/model/components/kubecontrollermanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ limitations under the License.
package components

import (
"testing"
"time"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
api "k8s.io/kops/pkg/apis/kops"
"k8s.io/kops/pkg/assets"
"testing"
"time"
)

type ClusterParams struct {
Expand Down
1 change: 1 addition & 0 deletions pkg/model/gcemodel/storageacl.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package gcemodel

import (
"fmt"

"k8s.io/kops/upup/pkg/fi"
"k8s.io/kops/upup/pkg/fi/cloudup/gce"
"k8s.io/kops/upup/pkg/fi/cloudup/gcetasks"
Expand Down
9 changes: 5 additions & 4 deletions upup/pkg/fi/cloudup/awstasks/elastic_ip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ package awstasks

import (
"bytes"
"os"
"reflect"
"testing"
"time"

"github.com/aws/aws-sdk-go/service/ec2"
"k8s.io/kops/cloudmock/aws/mockec2"
"k8s.io/kops/pkg/assets"
"k8s.io/kops/upup/pkg/fi"
"k8s.io/kops/upup/pkg/fi/cloudup/awsup"
"os"
"reflect"
"testing"
"time"
)

const defaultDeadline = 2 * time.Second
Expand Down
5 changes: 3 additions & 2 deletions upup/pkg/fi/cloudup/awstasks/securitygroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ limitations under the License.
package awstasks

import (
"reflect"
"testing"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ec2"
"k8s.io/kops/cloudmock/aws/mockec2"
"k8s.io/kops/upup/pkg/fi"
"k8s.io/kops/upup/pkg/fi/cloudup/awsup"
"reflect"
"testing"
)

func TestParseRemovalRule(t *testing.T) {
Expand Down
9 changes: 5 additions & 4 deletions upup/pkg/fi/cloudup/awstasks/subnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ package awstasks

import (
"fmt"
"reflect"
"testing"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ec2"
"k8s.io/kops/cloudmock/aws/mockec2"
"k8s.io/kops/upup/pkg/fi"
"k8s.io/kops/upup/pkg/fi/cloudup/awsup"
"reflect"
"testing"
)

func Test_Subnet_ValidateRequired(t *testing.T) {
Expand Down Expand Up @@ -95,7 +96,7 @@ func TestSubnetCreate(t *testing.T) {
Cloud: cloud,
}

context, err := fi.NewContext(target, cloud, nil, nil, nil, true, allTasks)
context, err := fi.NewContext(target, nil, cloud, nil, nil, nil, true, allTasks)
if err != nil {
t.Fatalf("error building context: %v", err)
}
Expand Down Expand Up @@ -213,7 +214,7 @@ func TestSharedSubnetCreateDoesNotCreateNew(t *testing.T) {
Cloud: cloud,
}

context, err := fi.NewContext(target, cloud, nil, nil, nil, true, allTasks)
context, err := fi.NewContext(target, nil, cloud, nil, nil, nil, true, allTasks)
if err != nil {
t.Fatalf("error building context: %v", err)
}
Expand Down
5 changes: 3 additions & 2 deletions upup/pkg/fi/cloudup/awstasks/vpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ limitations under the License.
package awstasks

import (
"reflect"
"testing"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ec2"
"k8s.io/kops/cloudmock/aws/mockec2"
"k8s.io/kops/upup/pkg/fi"
"k8s.io/kops/upup/pkg/fi/cloudup/awsup"
"reflect"
"testing"
)

func TestVPCCreate(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion upup/pkg/fi/cloudup/gce/gce_cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (
"net/http"
"strings"

"os"

"github.com/golang/glog"
"golang.org/x/net/context"
"golang.org/x/oauth2/google"
Expand All @@ -32,7 +34,6 @@ import (
"k8s.io/kops/upup/pkg/fi"
"k8s.io/kubernetes/federation/pkg/dnsprovider"
"k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns"
"os"
)

type GCECloud interface {
Expand Down
3 changes: 2 additions & 1 deletion upup/pkg/fi/cloudup/networking_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ limitations under the License.
package cloudup

import (
api "k8s.io/kops/pkg/apis/kops"
"os"
"testing"

api "k8s.io/kops/pkg/apis/kops"
)

func Test_FindCNIAssetFromEnvironmentVariable(t *testing.T) {
Expand Down
9 changes: 5 additions & 4 deletions upup/pkg/fi/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ package fi
import (
"bytes"
"fmt"
"github.com/golang/glog"
"io/ioutil"
"k8s.io/kops/pkg/apis/kops"
"k8s.io/kops/util/pkg/vfs"
"k8s.io/kubernetes/federation/pkg/dnsprovider"
"os"
"reflect"
"strings"
"time"

"github.com/golang/glog"
"k8s.io/kops/pkg/apis/kops"
"k8s.io/kops/util/pkg/vfs"
"k8s.io/kubernetes/federation/pkg/dnsprovider"
)

type Context struct {
Expand Down
3 changes: 2 additions & 1 deletion upup/pkg/fi/default_methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ package fi

import (
"fmt"
"k8s.io/kops/upup/pkg/fi/utils"
"reflect"

"k8s.io/kops/upup/pkg/fi/utils"
)

// DefaultDeltaRunMethod implements the standard change-based run procedure:
Expand Down
3 changes: 2 additions & 1 deletion upup/pkg/fi/dryrun_target.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ import (
"strings"
"sync"

"sort"

"github.com/golang/glog"
"k8s.io/kops/pkg/assets"
"k8s.io/kops/pkg/diff"
"k8s.io/kops/upup/pkg/fi/utils"
"sort"
)

// DryRunTarget is a special Target that does not execute anything, but instead tracks all changes.
Expand Down
3 changes: 2 additions & 1 deletion upup/pkg/fi/fitasks/managedfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ package fitasks

import (
"fmt"
"os"

"k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/kops/pkg/acls"
"k8s.io/kops/upup/pkg/fi"
"os"
)

//go:generate fitask -type=ManagedFile
Expand Down
3 changes: 2 additions & 1 deletion upup/pkg/fi/secrets/vfs_secretstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ package secrets
import (
"encoding/json"
"fmt"
"os"

"github.com/golang/glog"
"k8s.io/kops/pkg/acls"
"k8s.io/kops/pkg/apis/kops"
"k8s.io/kops/upup/pkg/fi"
"k8s.io/kops/util/pkg/vfs"
"os"
)

type VFSSecretStore struct {
Expand Down
11 changes: 6 additions & 5 deletions util/pkg/vfs/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@ package vfs

import (
"fmt"
"github.com/golang/glog"
"golang.org/x/net/context"
"golang.org/x/oauth2/google"
storage "google.golang.org/api/storage/v1"
"io/ioutil"
"k8s.io/apimachinery/pkg/util/wait"
"net/http"
"net/url"
"os"
"strings"
"sync"
"time"

"github.com/golang/glog"
"golang.org/x/net/context"
"golang.org/x/oauth2/google"
storage "google.golang.org/api/storage/v1"
"k8s.io/apimachinery/pkg/util/wait"
)

// VFSContext is a 'context' for VFS, that is normally a singleton
Expand Down
5 changes: 3 additions & 2 deletions util/pkg/vfs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ package vfs

import (
"fmt"
"github.com/golang/glog"
"io"
"io/ioutil"
"k8s.io/kops/util/pkg/hashing"
"os"
"path"
"sync"

"github.com/golang/glog"
"k8s.io/kops/util/pkg/hashing"
)

type FSPath struct {
Expand Down
13 changes: 7 additions & 6 deletions util/pkg/vfs/gsfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,20 @@ import (
"encoding/base64"
"encoding/hex"
"fmt"
"github.com/golang/glog"
"golang.org/x/net/context"
"google.golang.org/api/googleapi"
storage "google.golang.org/api/storage/v1"
"io/ioutil"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/kops/util/pkg/hashing"
"net/http"
"os"
"path"
"strings"
"sync"
"time"

"github.com/golang/glog"
"golang.org/x/net/context"
"google.golang.org/api/googleapi"
storage "google.golang.org/api/storage/v1"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/kops/util/pkg/hashing"
)

// GSPath is a vfs path for Google Cloud Storage
Expand Down
3 changes: 2 additions & 1 deletion util/pkg/vfs/k8sfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ package vfs

import (
"fmt"
"k8s.io/kops/util/pkg/hashing"
"path"
"strings"

"k8s.io/kops/util/pkg/hashing"
)

// KubernetesPath is a path for a VFS backed by the kubernetes API
Expand Down
Loading