mirror of
https://github.com/rancher/types.git
synced 2025-09-16 06:49:21 +00:00
cluster auth token type changes
This commit is contained in:
committed by
Craig Jellick
parent
918e3096ba
commit
8cac937266
@@ -3,6 +3,7 @@ package schema
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
m "github.com/rancher/norman/types/mapper"
|
||||
"github.com/rancher/types/apis/cluster.cattle.io/v3"
|
||||
"github.com/rancher/types/factory"
|
||||
"k8s.io/api/core/v1"
|
||||
storagev1 "k8s.io/api/storage/v1"
|
||||
@@ -20,7 +21,8 @@ var (
|
||||
Schemas = factory.Schemas(&Version).
|
||||
Init(namespaceTypes).
|
||||
Init(persistentVolumeTypes).
|
||||
Init(storageClassTypes)
|
||||
Init(storageClassTypes).
|
||||
Init(tokens)
|
||||
)
|
||||
|
||||
func namespaceTypes(schemas *types.Schemas) *types.Schemas {
|
||||
@@ -86,3 +88,15 @@ func storageClassTypes(schemas *types.Schemas) *types.Schemas {
|
||||
ReclaimPolicy string `json:"reclaimPolicy,omitempty" norman:"type=enum,options=Recycle|Delete|Retain"`
|
||||
}{})
|
||||
}
|
||||
|
||||
func tokens(schemas *types.Schemas) *types.Schemas {
|
||||
return schemas.
|
||||
MustImportAndCustomize(&Version, v3.ClusterAuthToken{}, func(schema *types.Schema) {
|
||||
schema.CollectionMethods = []string{}
|
||||
schema.ResourceMethods = []string{}
|
||||
}).
|
||||
MustImportAndCustomize(&Version, v3.ClusterUserAttribute{}, func(schema *types.Schema) {
|
||||
schema.CollectionMethods = []string{}
|
||||
schema.ResourceMethods = []string{}
|
||||
})
|
||||
}
|
||||
|
30
apis/cluster.cattle.io/v3/types.go
Normal file
30
apis/cluster.cattle.io/v3/types.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type ClusterUserAttribute struct {
|
||||
types.Namespaced
|
||||
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Groups []string `json:"groups,omitempty"`
|
||||
LastRefresh string `json:"lastRefresh,omitempty"`
|
||||
NeedsRefresh bool `json:"needsRefresh"`
|
||||
Enabled bool `json:"enabled"`
|
||||
}
|
||||
|
||||
type ClusterAuthToken struct {
|
||||
types.Namespaced
|
||||
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
UserName string `json:"userName"`
|
||||
ExpiresAt string `json:"expiresAt,omitempty"`
|
||||
SecretKeyHash string `json:"hash"`
|
||||
Enabled bool `json:"enabled"`
|
||||
}
|
Reference in New Issue
Block a user