mirror of
https://github.com/rancher/steve.git
synced 2025-09-24 21:08:03 +00:00
Adding validate phase to the CI
Adds a validate phase to the CI which runs a linter. Also fixes linter issues discovered during the initial run
This commit is contained in:
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/rancher/steve/pkg/schema/table"
|
||||
apiextv1 "github.com/rancher/wrangler/pkg/generated/controllers/apiextensions.k8s.io/v1"
|
||||
"github.com/rancher/wrangler/pkg/schemas"
|
||||
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
|
||||
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
@@ -5,7 +5,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/rancher/apiserver/pkg/types"
|
||||
"github.com/rancher/wrangler/pkg/generated/controllers/apiextensions.k8s.io/v1"
|
||||
v1 "github.com/rancher/wrangler/pkg/generated/controllers/apiextensions.k8s.io/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/client-go/discovery"
|
||||
)
|
||||
|
@@ -41,11 +41,11 @@ func (c *Collection) Schemas(user user.Info) (*types.APISchemas, error) {
|
||||
func (c *Collection) removeOldRecords(access *accesscontrol.AccessSet, user user.Info) {
|
||||
current, ok := c.userCache.Get(user.GetName())
|
||||
if ok {
|
||||
currentId, cOk := current.(string)
|
||||
if cOk && currentId != access.ID {
|
||||
currentID, cOk := current.(string)
|
||||
if cOk && currentID != access.ID {
|
||||
// we only want to keep around one record per user. If our current access record is invalid, purge the
|
||||
//record of it from the cache, so we don't keep duplicates
|
||||
c.purgeUserRecords(currentId)
|
||||
c.purgeUserRecords(currentID)
|
||||
c.userCache.Remove(user.GetName())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user