Skip to content

Commit

Permalink
make internal packages more tightly scoped
Browse files Browse the repository at this point in the history
  • Loading branch information
BenTheElder committed Dec 5, 2019
1 parent 3b0b767 commit ab257e2
Show file tree
Hide file tree
Showing 77 changed files with 67 additions and 67 deletions.
2 changes: 1 addition & 1 deletion pkg/cluster/createoption.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

"sigs.k8s.io/kind/pkg/apis/config/v1alpha3"
internalencoding "sigs.k8s.io/kind/pkg/internal/apis/config/encoding"
internalcreate "sigs.k8s.io/kind/pkg/internal/cluster/create"
internalcreate "sigs.k8s.io/kind/pkg/cluster/internal/create"
)

// CreateOption is a Provider.Create option
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"sigs.k8s.io/kind/pkg/cluster/nodes"
"sigs.k8s.io/kind/pkg/log"

"sigs.k8s.io/kind/pkg/internal/cluster/providers/docker"
"sigs.k8s.io/kind/pkg/internal/cluster/providers/provider"
"sigs.k8s.io/kind/pkg/cluster/internal/providers/docker"
"sigs.k8s.io/kind/pkg/cluster/internal/providers/provider"
)

// Context is the private shared context underlying pkg/cluster.Context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (

"sigs.k8s.io/kind/pkg/cluster/nodes"
"sigs.k8s.io/kind/pkg/internal/apis/config"
"sigs.k8s.io/kind/pkg/internal/cluster/context"
"sigs.k8s.io/kind/pkg/internal/util/cli"
"sigs.k8s.io/kind/pkg/cluster/internal/context"
"sigs.k8s.io/kind/pkg/internal/cli"
"sigs.k8s.io/kind/pkg/log"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import (

"sigs.k8s.io/kind/pkg/cluster/nodeutils"
"sigs.k8s.io/kind/pkg/internal/apis/config"
"sigs.k8s.io/kind/pkg/internal/cluster/create/actions"
"sigs.k8s.io/kind/pkg/internal/cluster/kubeadm"
"sigs.k8s.io/kind/pkg/internal/cluster/providers/provider/common"
"sigs.k8s.io/kind/pkg/internal/util/patch"
"sigs.k8s.io/kind/pkg/cluster/internal/create/actions"
"sigs.k8s.io/kind/pkg/cluster/internal/kubeadm"
"sigs.k8s.io/kind/pkg/cluster/internal/providers/provider/common"
"sigs.k8s.io/kind/pkg/cluster/internal/patch"
)

// Action implements action for creating the node config files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"sigs.k8s.io/kind/pkg/errors"

"sigs.k8s.io/kind/pkg/cluster/nodeutils"
"sigs.k8s.io/kind/pkg/internal/cluster/create/actions"
"sigs.k8s.io/kind/pkg/cluster/internal/create/actions"
)

type action struct{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"sigs.k8s.io/kind/pkg/errors"

"sigs.k8s.io/kind/pkg/cluster/nodeutils"
"sigs.k8s.io/kind/pkg/internal/cluster/create/actions"
"sigs.k8s.io/kind/pkg/cluster/internal/create/actions"
)

type action struct{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

"sigs.k8s.io/kind/pkg/cluster/nodeutils"

"sigs.k8s.io/kind/pkg/internal/cluster/create/actions"
"sigs.k8s.io/kind/pkg/cluster/internal/create/actions"
)

// kubeadmInitAction implements action for executing the kubadm init
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (

"sigs.k8s.io/kind/pkg/cluster/nodeutils"

"sigs.k8s.io/kind/pkg/internal/cluster/create/actions"
"sigs.k8s.io/kind/pkg/cluster/internal/create/actions"
)

// Action implements action for creating the kubeadm join
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (
"sigs.k8s.io/kind/pkg/errors"

"sigs.k8s.io/kind/pkg/cluster/nodeutils"
"sigs.k8s.io/kind/pkg/internal/cluster/create/actions"
"sigs.k8s.io/kind/pkg/internal/cluster/loadbalancer"
"sigs.k8s.io/kind/pkg/internal/cluster/providers/provider/common"
"sigs.k8s.io/kind/pkg/cluster/internal/create/actions"
"sigs.k8s.io/kind/pkg/cluster/internal/loadbalancer"
"sigs.k8s.io/kind/pkg/cluster/internal/providers/provider/common"
)

// Action implements and action for configuring and starting the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"sigs.k8s.io/kind/pkg/cluster/nodes"
"sigs.k8s.io/kind/pkg/cluster/nodeutils"
"sigs.k8s.io/kind/pkg/exec"
"sigs.k8s.io/kind/pkg/internal/cluster/create/actions"
"sigs.k8s.io/kind/pkg/cluster/internal/create/actions"
)

// Action implements an action for waiting for the cluster to be ready
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ import (
"sigs.k8s.io/kind/pkg/errors"
"sigs.k8s.io/kind/pkg/internal/apis/config"
"sigs.k8s.io/kind/pkg/internal/apis/config/encoding"
"sigs.k8s.io/kind/pkg/internal/cluster/context"
"sigs.k8s.io/kind/pkg/internal/cluster/delete"
"sigs.k8s.io/kind/pkg/internal/util/cli"
"sigs.k8s.io/kind/pkg/cluster/internal/context"
"sigs.k8s.io/kind/pkg/cluster/internal/delete"
"sigs.k8s.io/kind/pkg/internal/cli"
"sigs.k8s.io/kind/pkg/log"

"sigs.k8s.io/kind/pkg/internal/cluster/create/actions"
configaction "sigs.k8s.io/kind/pkg/internal/cluster/create/actions/config"
"sigs.k8s.io/kind/pkg/internal/cluster/create/actions/installcni"
"sigs.k8s.io/kind/pkg/internal/cluster/create/actions/installstorage"
"sigs.k8s.io/kind/pkg/internal/cluster/create/actions/kubeadminit"
"sigs.k8s.io/kind/pkg/internal/cluster/create/actions/kubeadmjoin"
"sigs.k8s.io/kind/pkg/internal/cluster/create/actions/loadbalancer"
"sigs.k8s.io/kind/pkg/internal/cluster/create/actions/waitforready"
"sigs.k8s.io/kind/pkg/internal/cluster/kubeconfig"
"sigs.k8s.io/kind/pkg/cluster/internal/create/actions"
configaction "sigs.k8s.io/kind/pkg/cluster/internal/create/actions/config"
"sigs.k8s.io/kind/pkg/cluster/internal/create/actions/installcni"
"sigs.k8s.io/kind/pkg/cluster/internal/create/actions/installstorage"
"sigs.k8s.io/kind/pkg/cluster/internal/create/actions/kubeadminit"
"sigs.k8s.io/kind/pkg/cluster/internal/create/actions/kubeadmjoin"
"sigs.k8s.io/kind/pkg/cluster/internal/create/actions/loadbalancer"
"sigs.k8s.io/kind/pkg/cluster/internal/create/actions/waitforready"
"sigs.k8s.io/kind/pkg/cluster/internal/kubeconfig"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"sigs.k8s.io/kind/pkg/errors"
"sigs.k8s.io/kind/pkg/log"

"sigs.k8s.io/kind/pkg/internal/cluster/context"
"sigs.k8s.io/kind/pkg/cluster/internal/context"
// TODO: we shouldn't need to import this here
"sigs.k8s.io/kind/pkg/internal/cluster/kubeconfig"
"sigs.k8s.io/kind/pkg/cluster/internal/kubeconfig"
)

// Cluster deletes the cluster identified by ctx
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package kubeconfig
import (
"testing"

"sigs.k8s.io/kind/pkg/internal/util/assert"
"sigs.k8s.io/kind/pkg/internal/assert"
)

func TestEncodeRoundtrip(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package kubeconfig
import (
"testing"

"sigs.k8s.io/kind/pkg/internal/util/assert"
"sigs.k8s.io/kind/pkg/internal/assert"
)

func TestKINDClusterKey(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"reflect"
"testing"

"sigs.k8s.io/kind/pkg/internal/util/assert"
"sigs.k8s.io/kind/pkg/internal/assert"
)

func TestMerge(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

"sigs.k8s.io/kind/pkg/fs"

"sigs.k8s.io/kind/pkg/internal/util/assert"
"sigs.k8s.io/kind/pkg/internal/assert"
)

func TestPaths(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"reflect"
"testing"

"sigs.k8s.io/kind/pkg/internal/util/assert"
"sigs.k8s.io/kind/pkg/internal/assert"
)

func TestKINDFromRawKubeadm(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"path/filepath"
"testing"

"sigs.k8s.io/kind/pkg/internal/util/assert"
"sigs.k8s.io/kind/pkg/internal/assert"
)

func TestRemove(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"path/filepath"
"testing"

"sigs.k8s.io/kind/pkg/internal/util/assert"
"sigs.k8s.io/kind/pkg/internal/assert"
)

func TestWrite(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import (

"sigs.k8s.io/kind/pkg/cluster/nodeutils"
"sigs.k8s.io/kind/pkg/errors"
"sigs.k8s.io/kind/pkg/internal/cluster/context"
"sigs.k8s.io/kind/pkg/cluster/internal/context"

// this package has slightly more generic kubeconfig helpers
// and minimal dependencies on the rest of kind
"sigs.k8s.io/kind/pkg/internal/cluster/kubeconfig/internal/kubeconfig"
"sigs.k8s.io/kind/pkg/cluster/internal/kubeconfig/internal/kubeconfig"
)

// Export exports the kubeconfig given the cluster context and a path to write it to
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"testing"

"sigs.k8s.io/kind/pkg/internal/apis/config"
"sigs.k8s.io/kind/pkg/internal/util/assert"
"sigs.k8s.io/kind/pkg/internal/assert"
)

func TestKubeYAML(t *testing.T) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package patch
import (
"testing"

"sigs.k8s.io/kind/pkg/internal/util/assert"
"sigs.k8s.io/kind/pkg/internal/assert"
)

func TestTOML(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"sigs.k8s.io/kind/pkg/log"

"sigs.k8s.io/kind/pkg/internal/apis/config"
"sigs.k8s.io/kind/pkg/internal/cluster/providers/provider/common"
"sigs.k8s.io/kind/pkg/internal/util/cli"
"sigs.k8s.io/kind/pkg/cluster/internal/providers/provider/common"
"sigs.k8s.io/kind/pkg/internal/cli"
)

// ensureNodeImages ensures that the node images used by the create
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import (

"sigs.k8s.io/kind/pkg/cluster/nodeutils"
"sigs.k8s.io/kind/pkg/internal/apis/config"
"sigs.k8s.io/kind/pkg/internal/cluster/providers/provider"
"sigs.k8s.io/kind/pkg/internal/cluster/providers/provider/common"
"sigs.k8s.io/kind/pkg/internal/util/cli"
"sigs.k8s.io/kind/pkg/cluster/internal/providers/provider"
"sigs.k8s.io/kind/pkg/cluster/internal/providers/provider/common"
"sigs.k8s.io/kind/pkg/internal/cli"
)

// NewProvider returns a new provider based on executing `docker ...`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (
"sigs.k8s.io/kind/pkg/exec"

"sigs.k8s.io/kind/pkg/internal/apis/config"
"sigs.k8s.io/kind/pkg/internal/cluster/loadbalancer"
"sigs.k8s.io/kind/pkg/internal/cluster/providers/provider/common"
"sigs.k8s.io/kind/pkg/cluster/internal/loadbalancer"
"sigs.k8s.io/kind/pkg/cluster/internal/providers/provider/common"
)

// planCreation creates a slice of funcs that will create the containers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package common
import (
"testing"

"sigs.k8s.io/kind/pkg/internal/util/assert"
"sigs.k8s.io/kind/pkg/internal/assert"
)

func TestMakeNodeNamer(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"testing"

"sigs.k8s.io/kind/pkg/internal/apis/config"
"sigs.k8s.io/kind/pkg/internal/util/assert"
"sigs.k8s.io/kind/pkg/internal/assert"
)

func TestGetProxyEnvs(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"sigs.k8s.io/kind/pkg/cluster/nodes"

"sigs.k8s.io/kind/pkg/internal/apis/config"
"sigs.k8s.io/kind/pkg/internal/util/cli"
"sigs.k8s.io/kind/pkg/internal/cli"
)

// Provider represents a provider of cluster / node infrastructure
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/nodeutils/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"sigs.k8s.io/kind/pkg/errors"
"sigs.k8s.io/kind/pkg/exec"

"sigs.k8s.io/kind/pkg/internal/cluster/providers/provider/common"
"sigs.k8s.io/kind/pkg/cluster/internal/providers/provider/common"
)

// GetControlPlaneEndpoint returns the control plane endpoints for IPv4 and IPv6
Expand Down
14 changes: 7 additions & 7 deletions pkg/cluster/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ import (
"sigs.k8s.io/kind/pkg/cluster/nodes"
"sigs.k8s.io/kind/pkg/log"

internalcontext "sigs.k8s.io/kind/pkg/internal/cluster/context"
internalcreate "sigs.k8s.io/kind/pkg/internal/cluster/create"
internaldelete "sigs.k8s.io/kind/pkg/internal/cluster/delete"
"sigs.k8s.io/kind/pkg/internal/cluster/kubeconfig"
internallogs "sigs.k8s.io/kind/pkg/internal/cluster/logs"
"sigs.k8s.io/kind/pkg/internal/cluster/providers/docker"
internalprovider "sigs.k8s.io/kind/pkg/internal/cluster/providers/provider"
internalcontext "sigs.k8s.io/kind/pkg/cluster/internal/context"
internalcreate "sigs.k8s.io/kind/pkg/cluster/internal/create"
internaldelete "sigs.k8s.io/kind/pkg/cluster/internal/delete"
"sigs.k8s.io/kind/pkg/cluster/internal/kubeconfig"
internallogs "sigs.k8s.io/kind/pkg/cluster/internal/logs"
"sigs.k8s.io/kind/pkg/cluster/internal/providers/docker"
internalprovider "sigs.k8s.io/kind/pkg/cluster/internal/providers/provider"
)

// DefaultName is the default cluster name
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/kind/get/kubeconfigpath/kubeconfigpath.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"sigs.k8s.io/kind/pkg/cmd"
"sigs.k8s.io/kind/pkg/log"

"sigs.k8s.io/kind/pkg/internal/cluster/kubeconfig"
"sigs.k8s.io/kind/pkg/cluster/internal/kubeconfig"
)

type flagpole struct {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (

"sigs.k8s.io/kind/pkg/log"

"sigs.k8s.io/kind/pkg/internal/util/cli"
"sigs.k8s.io/kind/pkg/internal/util/env"
"sigs.k8s.io/kind/pkg/internal/cli"
"sigs.k8s.io/kind/pkg/internal/env"
)

// NewLogger returns the standard logger used by the kind CLI
Expand Down
2 changes: 1 addition & 1 deletion pkg/errors/aggregate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package errors
import (
"testing"

"sigs.k8s.io/kind/pkg/internal/util/assert"
"sigs.k8s.io/kind/pkg/internal/assert"
)

func TestErrors(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/errors/concurrent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"sort"
"testing"

"sigs.k8s.io/kind/pkg/internal/util/assert"
"sigs.k8s.io/kind/pkg/internal/assert"
)

func TestUntilErrorConcurrent(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/errors/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

pkgerrors "github.com/pkg/errors"

"sigs.k8s.io/kind/pkg/internal/util/assert"
"sigs.k8s.io/kind/pkg/internal/assert"
)

func TestStackTrace(t *testing.T) {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

"sigs.k8s.io/kind/pkg/log"

"sigs.k8s.io/kind/pkg/internal/util/env"
"sigs.k8s.io/kind/pkg/internal/env"
)

// Logger is the kind cli's log.Logger implementation
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit ab257e2

Please sign in to comment.