Commit c06fbe47 authored by Darren Shepherd's avatar Darren Shepherd
Browse files

Update all code to new types location

parent 323367a0
Showing with 58 additions and 40 deletions
+58 -40
......@@ -19,9 +19,8 @@
"skip-dirs": [
"vendor",
"tests",
"pkg/types/client",
"pkg/types/apis",
"pkg/wrangler/generated"
"pkg/client",
"pkg/generated"
],
"tests": false,
"timeout": "10m"
......@@ -31,6 +30,18 @@
{
"linters": "govet",
"text": "^(nilness|structtag)"
},
{
"path":"pkg/apis/management.cattle.io/v3/globaldns_types.go",
"text":".*lobalDns.*"
},
{
"path": "pkg/apis/management.cattle.io/v3/zz_generated_register.go",
"text":".*lobalDns.*"
},
{
"path":"pkg/apis/management.cattle.io/v3/zz_generated_list_types.go",
"text":".*lobalDns.*"
}
]
}
......
......@@ -30,7 +30,7 @@ ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm=armv6l GOLANG_ARCH_arm64=arm64 GOLAN
RUN wget -O - https://storage.googleapis.com/golang/go1.13.4.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local
RUN if [ "${ARCH}" == "amd64" ]; then \
curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.20.0; \
curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.27.0; \
fi
ENV DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 \
......
......@@ -8,10 +8,12 @@ import (
"strings"
"time"
v32 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/catalog/helm"
"github.com/rancher/rancher/pkg/controllers/user/helm/common"
v3 "github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/settings"
v3 "github.com/rancher/rancher/pkg/types/apis/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/types/config"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
......@@ -184,7 +186,7 @@ func doAddCatalogs(management *config.ManagementContext, name, url, branch, helm
ObjectMeta: metav1.ObjectMeta{
Name: name,
},
Spec: v3.CatalogSpec{
Spec: v32.CatalogSpec{
URL: url,
CatalogKind: kind,
Branch: branch,
......
......@@ -4,15 +4,17 @@ import (
"encoding/json"
"testing"
v3 "github.com/rancher/rancher/pkg/types/apis/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/types/apis/management.cattle.io/v3/fakes"
v32 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3"
v3 "github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3/fakes"
"github.com/stretchr/testify/assert"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func NewCatalogClientMock(oldURL string, oldBranch string, annoURL string, annoBranch string) v3.CatalogInterface {
catalog := &v3.Catalog{
Spec: v3.CatalogSpec{
Spec: v32.CatalogSpec{
URL: oldURL,
Branch: oldBranch,
},
......
package app
import (
v32 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3"
v3 "github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/settings"
v3 "github.com/rancher/rancher/pkg/types/apis/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/types/config"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
......@@ -15,19 +16,19 @@ func addLocalCluster(embedded bool, adminName string, management *config.Managem
"field.cattle.io/creatorId": adminName,
},
},
Spec: v3.ClusterSpec{
Spec: v32.ClusterSpec{
Internal: true,
DisplayName: "local",
ClusterSpecBase: v3.ClusterSpecBase{
ClusterSpecBase: v32.ClusterSpecBase{
DockerRootDir: settings.InitialDockerRootDir.Get(),
},
},
Status: v3.ClusterStatus{
Driver: v3.ClusterDriverImported,
Status: v32.ClusterStatus{
Driver: v32.ClusterDriverImported,
},
}
if embedded {
c.Status.Driver = v3.ClusterDriverLocal
c.Status.Driver = v32.ClusterDriverLocal
}
// Ignore error
......
......@@ -7,7 +7,7 @@ import (
"github.com/docker/docker/pkg/reexec"
"github.com/pkg/errors"
"github.com/rancher/rancher/pkg/auth/api/user"
v3 "github.com/rancher/rancher/pkg/types/apis/management.cattle.io/v3"
v3 "github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3"
"github.com/urfave/cli"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/tools/clientcmd"
......
......@@ -5,8 +5,10 @@ import (
"os"
"strings"
v32 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/controllers/management/drivers/kontainerdriver"
v3 "github.com/rancher/rancher/pkg/types/apis/management.cattle.io/v3"
v3 "github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/types/config"
"github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/api/errors"
......@@ -131,12 +133,12 @@ func (c *driverCreator) add(name string) error {
Name: strings.ToLower(name),
Namespace: "",
},
Spec: v3.KontainerDriverSpec{
Spec: v32.KontainerDriverSpec{
URL: "",
BuiltIn: true,
Active: true,
},
Status: v3.KontainerDriverStatus{
Status: v32.KontainerDriverStatus{
DisplayName: name,
},
})
......@@ -167,7 +169,7 @@ func (c *driverCreator) addCustomDriver(name, url, checksum, uiURL string, activ
ObjectMeta: v1.ObjectMeta{
Name: strings.ToLower(name),
},
Spec: v3.KontainerDriverSpec{
Spec: v32.KontainerDriverSpec{
URL: url,
BuiltIn: false,
Active: active,
......@@ -175,7 +177,7 @@ func (c *driverCreator) addCustomDriver(name, url, checksum, uiURL string, activ
UIURL: uiURL,
WhitelistDomains: domains,
},
Status: v3.KontainerDriverStatus{
Status: v32.KontainerDriverStatus{
DisplayName: name,
},
})
......
......@@ -6,7 +6,9 @@ import (
"reflect"
"strings"
v3 "github.com/rancher/rancher/pkg/types/apis/management.cattle.io/v3"
v32 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3"
v3 "github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/types/config"
"github.com/sirupsen/logrus"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
......@@ -178,7 +180,7 @@ func addMachineDriver(name, url, uiURL, checksum string, whitelist []string, act
Name: name,
Annotations: annotations,
},
Spec: v3.NodeDriverSpec{
Spec: v32.NodeDriverSpec{
Active: active,
Builtin: builtin,
URL: url,
......
......@@ -3,7 +3,7 @@ package app
import (
"fmt"
v3 "github.com/rancher/rancher/pkg/types/apis/management.cattle.io/v3"
v3 "github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/types/config"
v1 "k8s.io/api/core/v1"
"k8s.io/api/policy/v1beta1"
......
......@@ -9,7 +9,7 @@ import (
"github.com/docker/docker/pkg/reexec"
"github.com/pkg/errors"
"github.com/rancher/rancher/pkg/auth/api/user"
v3 "github.com/rancher/rancher/pkg/types/apis/management.cattle.io/v3"
v3 "github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3"
"github.com/urfave/cli"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
......
......@@ -4,7 +4,7 @@ import (
"context"
"github.com/pkg/errors"
v3 "github.com/rancher/rancher/pkg/types/apis/management.cattle.io/v3"
v3 "github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/types/config"
"github.com/sirupsen/logrus"
"golang.org/x/crypto/bcrypt"
......
......@@ -6,7 +6,7 @@ import (
"github.com/pkg/errors"
"github.com/rancher/norman/objectclient"
v3 "github.com/rancher/rancher/pkg/types/apis/management.cattle.io/v3"
v3 "github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/types/config"
"github.com/sirupsen/logrus"
rbacv1 "k8s.io/api/rbac/v1"
......
......@@ -6,8 +6,8 @@ import (
"strings"
"time"
v3 "github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/systemaccount"
v3 "github.com/rancher/rancher/pkg/types/apis/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/types/config"
"github.com/sirupsen/logrus"
......
//go:generate go run pkg/types/generator/cleanup/main.go
//go:generate go run pkg/types/codegen/main.go
//go:generate go run pkg/wrangler/codegen/cleanup/main.go
//go:generate go run pkg/wrangler/codegen/main.go
package main
......@@ -9,8 +9,8 @@ import (
"github.com/bep/debounce"
helmlib "github.com/rancher/rancher/pkg/catalog/helm"
v3 "github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/ticker"
v3 "github.com/rancher/rancher/pkg/types/apis/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/types/config"
"github.com/sirupsen/logrus"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
......
......@@ -6,8 +6,8 @@ import (
"github.com/rancher/norman/types"
"github.com/rancher/norman/types/convert"
v3 "github.com/rancher/rancher/pkg/types/apis/management.cattle.io/v3"
managementSchema "github.com/rancher/rancher/pkg/types/apis/management.cattle.io/v3/schema"
v3 "github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3"
managementSchema "github.com/rancher/rancher/pkg/schemas/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/types/config"
"k8s.io/apimachinery/pkg/runtime"
)
......
......@@ -5,7 +5,7 @@ import (
"fmt"
"github.com/rancher/rancher/pkg/features"
v3 "github.com/rancher/rancher/pkg/types/apis/management.cattle.io/v3"
v3 "github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/types/config"
"github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/runtime"
......
......@@ -4,7 +4,7 @@ import (
"testing"
"github.com/rancher/rancher/pkg/features"
v3 "github.com/rancher/rancher/pkg/types/apis/management.cattle.io/v3"
v3 "github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3"
"github.com/stretchr/testify/assert"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
......
......@@ -8,8 +8,8 @@ import (
"time"
"github.com/rancher/rancher/pkg/channelserver"
v3 "github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/settings"
v3 "github.com/rancher/rancher/pkg/types/apis/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/types/config"
"github.com/rancher/wrangler/pkg/data"
"k8s.io/apimachinery/pkg/runtime"
......
......@@ -5,12 +5,12 @@ import (
"fmt"
"github.com/mitchellh/mapstructure"
v32 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/auth/providers/common"
"github.com/rancher/rancher/pkg/auth/providers/saml"
v3 "github.com/rancher/rancher/pkg/types/apis/management.cattle.io/v3"
corev1 "github.com/rancher/rancher/pkg/generated/norman/core/v1"
v3 "github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/types/config"
corev1 "github.com/rancher/rancher/pkg/types/apis/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)
......@@ -34,7 +34,7 @@ func newAuthProvider(apiContext *config.ScaledContext) *authProvider {
}
func (a *authProvider) sync(key string, config *v3.AuthConfig) (runtime.Object, error) {
samlConfig := &v3.SamlConfig{}
samlConfig := &v32.SamlConfig{}
if key == "" || config == nil {
return nil, nil
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment