Go Module: use v3 for go module compatibility

This commit is contained in:
iwilltry42 2020-06-18 07:35:00 +02:00
parent 83b84071f6
commit 76d90478f5
No known key found for this signature in database
GPG Key ID: 7BA57AD1CFF16110
40 changed files with 99 additions and 99 deletions

View File

@ -55,7 +55,7 @@ PKG := $(shell go mod vendor)
TAGS :=
TESTS := .
TESTFLAGS :=
LDFLAGS := -w -s -X github.com/rancher/k3d/version.Version=${GIT_TAG} -X github.com/rancher/k3d/version.K3sVersion=${K3S_TAG}
LDFLAGS := -w -s -X github.com/rancher/k3d/v3/version.Version=${GIT_TAG} -X github.com/rancher/k3d/v3/version.K3sVersion=${K3S_TAG}
GCFLAGS :=
GOFLAGS :=
BINDIR := $(CURDIR)/bin

View File

@ -56,7 +56,7 @@ or...
## Build
1. Clone this repo, e.g. via `go get -u github.com/rancher/k3d`
1. Clone this repo, e.g. via `git clone git@github.com:rancher/k3d.git` or `go get github.com/rancher/k3d/v3@master`
2. Inside the repo run
- 'make install-tools' to make sure required go packages are installed
3. Inside the repo run one of the following commands

View File

@ -30,12 +30,12 @@ import (
"github.com/spf13/cobra"
cliutil "github.com/rancher/k3d/cmd/util"
"github.com/rancher/k3d/pkg/cluster"
k3dCluster "github.com/rancher/k3d/pkg/cluster"
"github.com/rancher/k3d/pkg/runtimes"
k3d "github.com/rancher/k3d/pkg/types"
"github.com/rancher/k3d/version"
cliutil "github.com/rancher/k3d/v3/cmd/util"
"github.com/rancher/k3d/v3/pkg/cluster"
k3dCluster "github.com/rancher/k3d/v3/pkg/cluster"
"github.com/rancher/k3d/v3/pkg/runtimes"
k3d "github.com/rancher/k3d/v3/pkg/types"
"github.com/rancher/k3d/v3/version"
log "github.com/sirupsen/logrus"
)

View File

@ -27,11 +27,11 @@ import (
"github.com/spf13/cobra"
"github.com/rancher/k3d/cmd/util"
k3dc "github.com/rancher/k3d/pkg/cluster"
"github.com/rancher/k3d/pkg/runtimes"
k3d "github.com/rancher/k3d/pkg/types"
"github.com/rancher/k3d/version"
"github.com/rancher/k3d/v3/cmd/util"
k3dc "github.com/rancher/k3d/v3/pkg/cluster"
"github.com/rancher/k3d/v3/pkg/runtimes"
k3d "github.com/rancher/k3d/v3/pkg/types"
"github.com/rancher/k3d/v3/version"
log "github.com/sirupsen/logrus"
)

View File

@ -22,10 +22,10 @@ THE SOFTWARE.
package delete
import (
"github.com/rancher/k3d/cmd/util"
"github.com/rancher/k3d/pkg/cluster"
"github.com/rancher/k3d/pkg/runtimes"
k3d "github.com/rancher/k3d/pkg/types"
"github.com/rancher/k3d/v3/cmd/util"
"github.com/rancher/k3d/v3/pkg/cluster"
"github.com/rancher/k3d/v3/pkg/runtimes"
k3d "github.com/rancher/k3d/v3/pkg/types"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"

View File

@ -22,10 +22,10 @@ THE SOFTWARE.
package delete
import (
"github.com/rancher/k3d/cmd/util"
"github.com/rancher/k3d/pkg/cluster"
"github.com/rancher/k3d/pkg/runtimes"
k3d "github.com/rancher/k3d/pkg/types"
"github.com/rancher/k3d/v3/cmd/util"
"github.com/rancher/k3d/v3/pkg/cluster"
"github.com/rancher/k3d/v3/pkg/runtimes"
k3d "github.com/rancher/k3d/v3/pkg/types"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)

View File

@ -27,10 +27,10 @@ import (
"os"
"strings"
"github.com/rancher/k3d/cmd/util"
k3cluster "github.com/rancher/k3d/pkg/cluster"
"github.com/rancher/k3d/pkg/runtimes"
k3d "github.com/rancher/k3d/pkg/types"
"github.com/rancher/k3d/v3/cmd/util"
k3cluster "github.com/rancher/k3d/v3/pkg/cluster"
"github.com/rancher/k3d/v3/pkg/runtimes"
k3d "github.com/rancher/k3d/v3/pkg/types"
"github.com/spf13/cobra"
log "github.com/sirupsen/logrus"

View File

@ -25,10 +25,10 @@ import (
"fmt"
"os"
"github.com/rancher/k3d/cmd/util"
"github.com/rancher/k3d/pkg/cluster"
"github.com/rancher/k3d/pkg/runtimes"
k3d "github.com/rancher/k3d/pkg/types"
"github.com/rancher/k3d/v3/cmd/util"
"github.com/rancher/k3d/v3/pkg/cluster"
"github.com/rancher/k3d/v3/pkg/runtimes"
k3d "github.com/rancher/k3d/v3/pkg/types"
"github.com/spf13/cobra"
"k8s.io/client-go/tools/clientcmd"

View File

@ -28,10 +28,10 @@ import (
"strings"
"github.com/liggitt/tabwriter"
"github.com/rancher/k3d/cmd/util"
"github.com/rancher/k3d/pkg/cluster"
"github.com/rancher/k3d/pkg/runtimes"
k3d "github.com/rancher/k3d/pkg/types"
"github.com/rancher/k3d/v3/cmd/util"
"github.com/rancher/k3d/v3/pkg/cluster"
"github.com/rancher/k3d/v3/pkg/runtimes"
k3d "github.com/rancher/k3d/v3/pkg/types"
"github.com/spf13/cobra"
log "github.com/sirupsen/logrus"

View File

@ -24,10 +24,10 @@ package load
import (
"github.com/spf13/cobra"
"github.com/rancher/k3d/cmd/util"
"github.com/rancher/k3d/pkg/runtimes"
"github.com/rancher/k3d/pkg/tools"
k3d "github.com/rancher/k3d/pkg/types"
"github.com/rancher/k3d/v3/cmd/util"
"github.com/rancher/k3d/v3/pkg/runtimes"
"github.com/rancher/k3d/v3/pkg/tools"
k3d "github.com/rancher/k3d/v3/pkg/types"
log "github.com/sirupsen/logrus"
)

View File

@ -30,14 +30,14 @@ import (
"github.com/spf13/cobra"
"github.com/rancher/k3d/cmd/create"
"github.com/rancher/k3d/cmd/delete"
"github.com/rancher/k3d/cmd/get"
"github.com/rancher/k3d/cmd/load"
"github.com/rancher/k3d/cmd/start"
"github.com/rancher/k3d/cmd/stop"
"github.com/rancher/k3d/pkg/runtimes"
"github.com/rancher/k3d/version"
"github.com/rancher/k3d/v3/cmd/create"
"github.com/rancher/k3d/v3/cmd/delete"
"github.com/rancher/k3d/v3/cmd/get"
"github.com/rancher/k3d/v3/cmd/load"
"github.com/rancher/k3d/v3/cmd/start"
"github.com/rancher/k3d/v3/cmd/stop"
"github.com/rancher/k3d/v3/pkg/runtimes"
"github.com/rancher/k3d/v3/version"
log "github.com/sirupsen/logrus"
"github.com/sirupsen/logrus/hooks/writer"

View File

@ -24,13 +24,13 @@ package start
import (
"time"
"github.com/rancher/k3d/cmd/util"
"github.com/rancher/k3d/pkg/cluster"
"github.com/rancher/k3d/pkg/runtimes"
"github.com/rancher/k3d/pkg/types"
"github.com/rancher/k3d/v3/cmd/util"
"github.com/rancher/k3d/v3/pkg/cluster"
"github.com/rancher/k3d/v3/pkg/runtimes"
"github.com/rancher/k3d/v3/pkg/types"
"github.com/spf13/cobra"
k3d "github.com/rancher/k3d/pkg/types"
k3d "github.com/rancher/k3d/v3/pkg/types"
log "github.com/sirupsen/logrus"
)

View File

@ -22,9 +22,9 @@ THE SOFTWARE.
package start
import (
"github.com/rancher/k3d/cmd/util"
"github.com/rancher/k3d/pkg/runtimes"
k3d "github.com/rancher/k3d/pkg/types"
"github.com/rancher/k3d/v3/cmd/util"
"github.com/rancher/k3d/v3/pkg/runtimes"
k3d "github.com/rancher/k3d/v3/pkg/types"
"github.com/spf13/cobra"
log "github.com/sirupsen/logrus"

View File

@ -24,10 +24,10 @@ package stop
import (
"github.com/spf13/cobra"
"github.com/rancher/k3d/cmd/util"
"github.com/rancher/k3d/pkg/cluster"
"github.com/rancher/k3d/pkg/runtimes"
k3d "github.com/rancher/k3d/pkg/types"
"github.com/rancher/k3d/v3/cmd/util"
"github.com/rancher/k3d/v3/pkg/cluster"
"github.com/rancher/k3d/v3/pkg/runtimes"
k3d "github.com/rancher/k3d/v3/pkg/types"
log "github.com/sirupsen/logrus"
)

View File

@ -22,11 +22,11 @@ THE SOFTWARE.
package stop
import (
"github.com/rancher/k3d/cmd/util"
"github.com/rancher/k3d/pkg/runtimes"
"github.com/rancher/k3d/v3/cmd/util"
"github.com/rancher/k3d/v3/pkg/runtimes"
"github.com/spf13/cobra"
k3d "github.com/rancher/k3d/pkg/types"
k3d "github.com/rancher/k3d/v3/pkg/types"
log "github.com/sirupsen/logrus"
)

View File

@ -25,9 +25,9 @@ import (
"context"
"strings"
k3dcluster "github.com/rancher/k3d/pkg/cluster"
"github.com/rancher/k3d/pkg/runtimes"
k3d "github.com/rancher/k3d/pkg/types"
k3dcluster "github.com/rancher/k3d/v3/pkg/cluster"
"github.com/rancher/k3d/v3/pkg/runtimes"
k3d "github.com/rancher/k3d/v3/pkg/types"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)

View File

@ -28,7 +28,7 @@ import (
log "github.com/sirupsen/logrus"
k3d "github.com/rancher/k3d/pkg/types"
k3d "github.com/rancher/k3d/v3/pkg/types"
"regexp"
)

View File

@ -27,7 +27,7 @@ import (
"strconv"
"strings"
k3d "github.com/rancher/k3d/pkg/types"
k3d "github.com/rancher/k3d/v3/pkg/types"
log "github.com/sirupsen/logrus"
)

View File

@ -26,7 +26,7 @@ import (
"os"
"strings"
"github.com/rancher/k3d/pkg/runtimes"
"github.com/rancher/k3d/v3/pkg/runtimes"
log "github.com/sirupsen/logrus"
)

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/rancher/k3d
module github.com/rancher/k3d/v3
go 1.14

View File

@ -21,7 +21,7 @@ THE SOFTWARE.
*/
package main
import "github.com/rancher/k3d/cmd"
import "github.com/rancher/k3d/v3/cmd"
func main() {
cmd.Execute()

View File

@ -31,10 +31,10 @@ import (
"time"
"github.com/imdario/mergo"
k3drt "github.com/rancher/k3d/pkg/runtimes"
"github.com/rancher/k3d/pkg/types"
k3d "github.com/rancher/k3d/pkg/types"
"github.com/rancher/k3d/pkg/util"
k3drt "github.com/rancher/k3d/v3/pkg/runtimes"
"github.com/rancher/k3d/v3/pkg/types"
k3d "github.com/rancher/k3d/v3/pkg/types"
"github.com/rancher/k3d/v3/pkg/util"
log "github.com/sirupsen/logrus"
"golang.org/x/sync/errgroup"
)
@ -290,7 +290,7 @@ func CreateCluster(ctx context.Context, runtime k3drt.Runtime, cluster *k3d.Clus
// Create LB as a modified node with loadbalancerRole
lbNode := &k3d.Node{
Name: fmt.Sprintf("%s-%s-masterlb", k3d.DefaultObjectNamePrefix, cluster.Name),
Image: k3d.DefaultLBImage,
Image: k3d.DefaultLBImageRepo,
Ports: append(cluster.MasterLoadBalancer.Ports, fmt.Sprintf("%s:%s:%s/tcp", cluster.ExposeAPI.Host, cluster.ExposeAPI.Port, k3d.DefaultAPIPort)),
Env: []string{
fmt.Sprintf("SERVERS=%s", servers),

View File

@ -24,7 +24,7 @@ package cluster
import (
"fmt"
"github.com/rancher/k3d/pkg/types"
"github.com/rancher/k3d/v3/pkg/types"
)
// CheckName ensures that a cluster name is also a valid host name according to RFC 1123.

View File

@ -30,8 +30,8 @@ import (
"path"
"time"
"github.com/rancher/k3d/pkg/runtimes"
k3d "github.com/rancher/k3d/pkg/types"
"github.com/rancher/k3d/v3/pkg/runtimes"
k3d "github.com/rancher/k3d/v3/pkg/types"
log "github.com/sirupsen/logrus"
"k8s.io/client-go/tools/clientcmd"
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"

View File

@ -26,8 +26,8 @@ import (
"fmt"
"strings"
"github.com/rancher/k3d/pkg/runtimes"
k3d "github.com/rancher/k3d/pkg/types"
"github.com/rancher/k3d/v3/pkg/runtimes"
k3d "github.com/rancher/k3d/v3/pkg/types"
log "github.com/sirupsen/logrus"
)

View File

@ -30,8 +30,8 @@ import (
"time"
"github.com/imdario/mergo"
"github.com/rancher/k3d/pkg/runtimes"
k3d "github.com/rancher/k3d/pkg/types"
"github.com/rancher/k3d/v3/pkg/runtimes"
k3d "github.com/rancher/k3d/v3/pkg/types"
log "github.com/sirupsen/logrus"
"golang.org/x/sync/errgroup"
)

View File

@ -26,7 +26,7 @@ import (
"context"
"io"
k3d "github.com/rancher/k3d/pkg/types"
k3d "github.com/rancher/k3d/v3/pkg/types"
)
// GetKubeconfig grabs the kubeconfig from inside a k3d node

View File

@ -29,7 +29,7 @@ import (
"github.com/containerd/containerd"
"github.com/containerd/containerd/containers"
k3d "github.com/rancher/k3d/pkg/types"
k3d "github.com/rancher/k3d/v3/pkg/types"
log "github.com/sirupsen/logrus"
)

View File

@ -24,7 +24,7 @@ package containerd
import (
"context"
k3d "github.com/rancher/k3d/pkg/types"
k3d "github.com/rancher/k3d/v3/pkg/types"
)
// CopyToNode copies a file from the local FS to the selected node

View File

@ -33,7 +33,7 @@ import (
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/client"
k3d "github.com/rancher/k3d/pkg/types"
k3d "github.com/rancher/k3d/v3/pkg/types"
log "github.com/sirupsen/logrus"
)

View File

@ -27,7 +27,7 @@ import (
"io"
"github.com/docker/docker/client"
k3d "github.com/rancher/k3d/pkg/types"
k3d "github.com/rancher/k3d/v3/pkg/types"
log "github.com/sirupsen/logrus"
)

View File

@ -28,7 +28,7 @@ import (
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/client"
k3d "github.com/rancher/k3d/pkg/types"
k3d "github.com/rancher/k3d/v3/pkg/types"
log "github.com/sirupsen/logrus"
)

View File

@ -32,7 +32,7 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/client"
k3d "github.com/rancher/k3d/pkg/types"
k3d "github.com/rancher/k3d/v3/pkg/types"
log "github.com/sirupsen/logrus"
)

View File

@ -31,7 +31,7 @@ import (
docker "github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/network"
"github.com/docker/go-connections/nat"
k3d "github.com/rancher/k3d/pkg/types"
k3d "github.com/rancher/k3d/v3/pkg/types"
log "github.com/sirupsen/logrus"
)

View File

@ -30,7 +30,7 @@ import (
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/network"
"github.com/docker/go-connections/nat"
k3d "github.com/rancher/k3d/pkg/types"
k3d "github.com/rancher/k3d/v3/pkg/types"
)
func TestTranslateNodeToContainer(t *testing.T) {

View File

@ -29,7 +29,7 @@ import (
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/client"
"github.com/docker/docker/pkg/archive"
k3d "github.com/rancher/k3d/pkg/types"
k3d "github.com/rancher/k3d/v3/pkg/types"
log "github.com/sirupsen/logrus"
)

View File

@ -28,7 +28,7 @@ import (
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/volume"
"github.com/docker/docker/client"
k3d "github.com/rancher/k3d/pkg/types"
k3d "github.com/rancher/k3d/v3/pkg/types"
log "github.com/sirupsen/logrus"
)

View File

@ -27,9 +27,9 @@ import (
"io"
"time"
"github.com/rancher/k3d/pkg/runtimes/containerd"
"github.com/rancher/k3d/pkg/runtimes/docker"
k3d "github.com/rancher/k3d/pkg/types"
"github.com/rancher/k3d/v3/pkg/runtimes/containerd"
"github.com/rancher/k3d/v3/pkg/runtimes/docker"
k3d "github.com/rancher/k3d/v3/pkg/types"
)
// SelectedRuntime is a runtime (pun intended) variable determining the selected runtime

View File

@ -30,9 +30,9 @@ import (
"sync"
"time"
k3dc "github.com/rancher/k3d/pkg/cluster"
"github.com/rancher/k3d/pkg/runtimes"
k3d "github.com/rancher/k3d/pkg/types"
k3dc "github.com/rancher/k3d/v3/pkg/cluster"
"github.com/rancher/k3d/v3/pkg/runtimes"
k3d "github.com/rancher/k3d/v3/pkg/types"
log "github.com/sirupsen/logrus"
)

View File

@ -38,8 +38,8 @@ const DefaultClusterNameMaxLength = 32
// DefaultK3sImageRepo specifies the default image repository for the used k3s image
const DefaultK3sImageRepo = "docker.io/rancher/k3s"
// DefaultLBImage defines the default cluster load balancer image
const DefaultLBImage = "docker.io/iwilltry42/k3d-proxy:v0.0.3"
// DefaultLBImageRepo defines the default cluster load balancer image
const DefaultLBImageRepo = "docker.io/iwilltry42/k3d-proxy:v0.0.3"
// DefaultObjectNamePrefix defines the name prefix for every object created by k3d
const DefaultObjectNamePrefix = "k3d"