Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Rancher
Commits
c06fbe47
Commit
c06fbe47
authored
4 years ago
by
Darren Shepherd
Browse files
Options
Download
Email Patches
Plain Diff
Update all code to new types location
parent
323367a0
Changes
482
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
.golangci.json
+14
-3
.golangci.json
Dockerfile.dapper
+1
-1
Dockerfile.dapper
app/catalog_data.go
+4
-2
app/catalog_data.go
app/catalog_data_test.go
+5
-3
app/catalog_data_test.go
app/cluster_data.go
+7
-6
app/cluster_data.go
app/ensure_admin_user.go
+1
-1
app/ensure_admin_user.go
app/kontainerdriver_data.go
+7
-5
app/kontainerdriver_data.go
app/machinedriver_data.go
+4
-2
app/machinedriver_data.go
app/podsecuritypolicytemplate_data.go
+1
-1
app/podsecuritypolicytemplate_data.go
app/resetpassword.go
+1
-1
app/resetpassword.go
app/role_data.go
+1
-1
app/role_data.go
app/rolebuilder.go
+1
-1
app/rolebuilder.go
app/user_cleanup.go
+1
-1
app/user_cleanup.go
generate.go
+0
-2
generate.go
pkg/api/controllers/catalog/catalog.go
+1
-1
pkg/api/controllers/catalog/catalog.go
pkg/api/controllers/dynamicschema/dynamicschema.go
+2
-2
pkg/api/controllers/dynamicschema/dynamicschema.go
pkg/api/controllers/feature/feature_handler.go
+1
-1
pkg/api/controllers/feature/feature_handler.go
pkg/api/controllers/feature/feature_handler_test.go
+1
-1
pkg/api/controllers/feature/feature_handler_test.go
pkg/api/controllers/k3smetadata/settings_handler.go
+1
-1
pkg/api/controllers/k3smetadata/settings_handler.go
pkg/api/controllers/samlconfig/samlconfig.go
+4
-4
pkg/api/controllers/samlconfig/samlconfig.go
with
58 additions
and
40 deletions
+58
-40
.golangci.json
+
14
-
3
View file @
c06fbe47
...
...
@@ -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.*"
}
]
}
...
...
This diff is collapsed.
Click to expand it.
Dockerfile.dapper
+
1
-
1
View file @
c06fbe47
...
...
@@ -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.2
0
.0; \
curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.2
7
.0; \
fi
ENV DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 \
...
...
This diff is collapsed.
Click to expand it.
app/catalog_data.go
+
4
-
2
View file @
c06fbe47
...
...
@@ -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
:
v3
2
.
CatalogSpec
{
URL
:
url
,
CatalogKind
:
kind
,
Branch
:
branch
,
...
...
This diff is collapsed.
Click to expand it.
app/catalog_data_test.go
+
5
-
3
View file @
c06fbe47
...
...
@@ -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
:
v3
2
.
CatalogSpec
{
URL
:
oldURL
,
Branch
:
oldBranch
,
},
...
...
This diff is collapsed.
Click to expand it.
app/cluster_data.go
+
7
-
6
View file @
c06fbe47
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
:
v3
2
.
ClusterSpec
{
Internal
:
true
,
DisplayName
:
"local"
,
ClusterSpecBase
:
v3
.
ClusterSpecBase
{
ClusterSpecBase
:
v3
2
.
ClusterSpecBase
{
DockerRootDir
:
settings
.
InitialDockerRootDir
.
Get
(),
},
},
Status
:
v3
.
ClusterStatus
{
Driver
:
v3
.
ClusterDriverImported
,
Status
:
v3
2
.
ClusterStatus
{
Driver
:
v3
2
.
ClusterDriverImported
,
},
}
if
embedded
{
c
.
Status
.
Driver
=
v3
.
ClusterDriverLocal
c
.
Status
.
Driver
=
v3
2
.
ClusterDriverLocal
}
// Ignore error
...
...
This diff is collapsed.
Click to expand it.
app/ensure_admin_user.go
+
1
-
1
View file @
c06fbe47
...
...
@@ -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"
...
...
This diff is collapsed.
Click to expand it.
app/kontainerdriver_data.go
+
7
-
5
View file @
c06fbe47
...
...
@@ -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
:
v3
2
.
KontainerDriverSpec
{
URL
:
""
,
BuiltIn
:
true
,
Active
:
true
,
},
Status
:
v3
.
KontainerDriverStatus
{
Status
:
v3
2
.
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
:
v3
2
.
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
:
v3
2
.
KontainerDriverStatus
{
DisplayName
:
name
,
},
})
...
...
This diff is collapsed.
Click to expand it.
app/machinedriver_data.go
+
4
-
2
View file @
c06fbe47
...
...
@@ -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
:
v3
2
.
NodeDriverSpec
{
Active
:
active
,
Builtin
:
builtin
,
URL
:
url
,
...
...
This diff is collapsed.
Click to expand it.
app/podsecuritypolicytemplate_data.go
+
1
-
1
View file @
c06fbe47
...
...
@@ -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"
...
...
This diff is collapsed.
Click to expand it.
app/resetpassword.go
+
1
-
1
View file @
c06fbe47
...
...
@@ -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"
...
...
This diff is collapsed.
Click to expand it.
app/role_data.go
+
1
-
1
View file @
c06fbe47
...
...
@@ -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"
...
...
This diff is collapsed.
Click to expand it.
app/rolebuilder.go
+
1
-
1
View file @
c06fbe47
...
...
@@ -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"
...
...
This diff is collapsed.
Click to expand it.
app/user_cleanup.go
+
1
-
1
View file @
c06fbe47
...
...
@@ -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"
...
...
This diff is collapsed.
Click to expand it.
generate.go
+
0
-
2
View file @
c06fbe47
//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
This diff is collapsed.
Click to expand it.
pkg/api/controllers/catalog/catalog.go
+
1
-
1
View file @
c06fbe47
...
...
@@ -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"
...
...
This diff is collapsed.
Click to expand it.
pkg/api/controllers/dynamicschema/dynamicschema.go
+
2
-
2
View file @
c06fbe47
...
...
@@ -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/api
s/management.cattle.io/v3
/schema
"
v3
"github.com/rancher/rancher/pkg/
generated/norman
/management.cattle.io/v3"
managementSchema
"github.com/rancher/rancher/pkg/
schema
s/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/types/config"
"k8s.io/apimachinery/pkg/runtime"
)
...
...
This diff is collapsed.
Click to expand it.
pkg/api/controllers/feature/feature_handler.go
+
1
-
1
View file @
c06fbe47
...
...
@@ -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"
...
...
This diff is collapsed.
Click to expand it.
pkg/api/controllers/feature/feature_handler_test.go
+
1
-
1
View file @
c06fbe47
...
...
@@ -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"
)
...
...
This diff is collapsed.
Click to expand it.
pkg/api/controllers/k3smetadata/settings_handler.go
+
1
-
1
View file @
c06fbe47
...
...
@@ -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"
...
...
This diff is collapsed.
Click to expand it.
pkg/api/controllers/samlconfig/samlconfig.go
+
4
-
4
View file @
c06fbe47
...
...
@@ -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
:=
&
v3
2
.
SamlConfig
{}
if
key
==
""
||
config
==
nil
{
return
nil
,
nil
}
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
5
…
25
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help