mirror of
https://github.com/rancher/types.git
synced 2025-07-02 16:31:48 +00:00
commit
1fc1ece572
@ -2,6 +2,8 @@ package schema
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
"github.com/rancher/norman/types/factory"
|
||||
"github.com/rancher/norman/types/mapper"
|
||||
"github.com/rancher/types/apis/authorization.cattle.io/v1"
|
||||
)
|
||||
|
||||
@ -12,11 +14,30 @@ var (
|
||||
Path: "/v1-authz",
|
||||
}
|
||||
|
||||
Schemas = types.NewSchemas().
|
||||
MustImport(&Version, v1.Project{}).
|
||||
Schemas = factory.Schemas(&Version).
|
||||
AddMapperForType(&Version, v1.Project{},
|
||||
mapper.DisplayName{},
|
||||
).
|
||||
AddMapperForType(&Version, v1.ProjectRoleTemplateBinding{},
|
||||
&mapper.Move{From: "subject/name", To: "subjectName"},
|
||||
&mapper.Move{From: "subject/kind", To: "subjectKind"},
|
||||
&mapper.Move{From: "subject/namespace", To: "subjectNamespace"},
|
||||
&mapper.Drop{Field: "subject"},
|
||||
).
|
||||
MustImportAndCustomize(&Version, v1.Project{}, func(schema *types.Schema) {
|
||||
schema.SubContext = "projects"
|
||||
}).
|
||||
MustImport(&Version, v1.ProjectRoleTemplate{}).
|
||||
MustImport(&Version, v1.PodSecurityPolicyTemplate{}).
|
||||
MustImport(&Version, v1.ProjectRoleTemplateBinding{}).
|
||||
MustImport(&Version, v1.PodSecurityPolicyTemplate{}).
|
||||
MustImport(&Version, v1.ClusterRoleTemplate{}).
|
||||
MustImport(&Version, v1.ClusterRoleTemplateBinding{})
|
||||
MustImport(&Version, v1.ClusterRoleTemplateBinding{}).
|
||||
MustImportAndCustomize(&Version, v1.ProjectRoleTemplateBinding{}, func(schema *types.Schema) {
|
||||
schema.MustCustomizeField("subjectKind", func(field types.Field) types.Field {
|
||||
field.Type = "enum"
|
||||
field.Options = []string{"User", "Group", "ServiceAccount"}
|
||||
field.Nullable = false
|
||||
return field
|
||||
})
|
||||
})
|
||||
)
|
||||
|
@ -25,7 +25,7 @@ type ProjectRoleTemplate struct {
|
||||
|
||||
Rules []rbacv1.PolicyRule `json:"rules,omitempty"`
|
||||
|
||||
ProjectRoleTemplates []string `json:"projectRoleTemplates,omitempty" norman:"type=array[reference[projectRoleTemplate]]"`
|
||||
ProjectRoleTemplateNames []string `json:"projectRoleTemplateNames,omitempty" norman:"type=array[reference[projectRoleTemplate]]"`
|
||||
}
|
||||
|
||||
type PodSecurityPolicyTemplate struct {
|
||||
@ -51,7 +51,7 @@ type ClusterRoleTemplate struct {
|
||||
|
||||
Rules []rbacv1.PolicyRule `json:"rules,omitempty"`
|
||||
|
||||
ClusterRoleTemplates []string `json:"clusterRoleTemplates,omitempty" norman:"type=array[reference[clusterRoleTemplate]]"`
|
||||
ClusterRoleTemplateNames []string `json:"clusterRoleTemplateNames,omitempty" norman:"type=array[reference[clusterRoleTemplate]]"`
|
||||
}
|
||||
|
||||
type ClusterRoleTemplateBinding struct {
|
||||
|
@ -38,7 +38,7 @@ type ClusterRoleTemplateBindingController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
AddHandler(handler ClusterRoleTemplateBindingHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Start(threadiness int, ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type ClusterRoleTemplateBindingInterface interface {
|
||||
|
@ -38,7 +38,7 @@ type ClusterRoleTemplateController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
AddHandler(handler ClusterRoleTemplateHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Start(threadiness int, ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type ClusterRoleTemplateInterface interface {
|
||||
|
@ -17,8 +17,8 @@ func (in *ClusterRoleTemplate) DeepCopyInto(out *ClusterRoleTemplate) {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.ClusterRoleTemplates != nil {
|
||||
in, out := &in.ClusterRoleTemplates, &out.ClusterRoleTemplates
|
||||
if in.ClusterRoleTemplateNames != nil {
|
||||
in, out := &in.ClusterRoleTemplateNames, &out.ClusterRoleTemplateNames
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
@ -276,8 +276,8 @@ func (in *ProjectRoleTemplate) DeepCopyInto(out *ProjectRoleTemplate) {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.ProjectRoleTemplates != nil {
|
||||
in, out := &in.ProjectRoleTemplates, &out.ProjectRoleTemplates
|
||||
if in.ProjectRoleTemplateNames != nil {
|
||||
in, out := &in.ProjectRoleTemplateNames, &out.ProjectRoleTemplateNames
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
|
@ -13,8 +13,8 @@ type Interface interface {
|
||||
|
||||
ProjectsGetter
|
||||
ProjectRoleTemplatesGetter
|
||||
PodSecurityPolicyTemplatesGetter
|
||||
ProjectRoleTemplateBindingsGetter
|
||||
PodSecurityPolicyTemplatesGetter
|
||||
ClusterRoleTemplatesGetter
|
||||
ClusterRoleTemplateBindingsGetter
|
||||
}
|
||||
@ -25,8 +25,8 @@ type Client struct {
|
||||
|
||||
projectControllers map[string]ProjectController
|
||||
projectRoleTemplateControllers map[string]ProjectRoleTemplateController
|
||||
podSecurityPolicyTemplateControllers map[string]PodSecurityPolicyTemplateController
|
||||
projectRoleTemplateBindingControllers map[string]ProjectRoleTemplateBindingController
|
||||
podSecurityPolicyTemplateControllers map[string]PodSecurityPolicyTemplateController
|
||||
clusterRoleTemplateControllers map[string]ClusterRoleTemplateController
|
||||
clusterRoleTemplateBindingControllers map[string]ClusterRoleTemplateBindingController
|
||||
}
|
||||
@ -47,8 +47,8 @@ func NewForConfig(config rest.Config) (Interface, error) {
|
||||
|
||||
projectControllers: map[string]ProjectController{},
|
||||
projectRoleTemplateControllers: map[string]ProjectRoleTemplateController{},
|
||||
podSecurityPolicyTemplateControllers: map[string]PodSecurityPolicyTemplateController{},
|
||||
projectRoleTemplateBindingControllers: map[string]ProjectRoleTemplateBindingController{},
|
||||
podSecurityPolicyTemplateControllers: map[string]PodSecurityPolicyTemplateController{},
|
||||
clusterRoleTemplateControllers: map[string]ClusterRoleTemplateController{},
|
||||
clusterRoleTemplateBindingControllers: map[string]ClusterRoleTemplateBindingController{},
|
||||
}, nil
|
||||
@ -84,19 +84,6 @@ func (c *Client) ProjectRoleTemplates(namespace string) ProjectRoleTemplateInter
|
||||
}
|
||||
}
|
||||
|
||||
type PodSecurityPolicyTemplatesGetter interface {
|
||||
PodSecurityPolicyTemplates(namespace string) PodSecurityPolicyTemplateInterface
|
||||
}
|
||||
|
||||
func (c *Client) PodSecurityPolicyTemplates(namespace string) PodSecurityPolicyTemplateInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &PodSecurityPolicyTemplateResource, PodSecurityPolicyTemplateGroupVersionKind, podSecurityPolicyTemplateFactory{})
|
||||
return &podSecurityPolicyTemplateClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type ProjectRoleTemplateBindingsGetter interface {
|
||||
ProjectRoleTemplateBindings(namespace string) ProjectRoleTemplateBindingInterface
|
||||
}
|
||||
@ -110,6 +97,19 @@ func (c *Client) ProjectRoleTemplateBindings(namespace string) ProjectRoleTempla
|
||||
}
|
||||
}
|
||||
|
||||
type PodSecurityPolicyTemplatesGetter interface {
|
||||
PodSecurityPolicyTemplates(namespace string) PodSecurityPolicyTemplateInterface
|
||||
}
|
||||
|
||||
func (c *Client) PodSecurityPolicyTemplates(namespace string) PodSecurityPolicyTemplateInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &PodSecurityPolicyTemplateResource, PodSecurityPolicyTemplateGroupVersionKind, podSecurityPolicyTemplateFactory{})
|
||||
return &podSecurityPolicyTemplateClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type ClusterRoleTemplatesGetter interface {
|
||||
ClusterRoleTemplates(namespace string) ClusterRoleTemplateInterface
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ type PodSecurityPolicyTemplateController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
AddHandler(handler PodSecurityPolicyTemplateHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Start(threadiness int, ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type PodSecurityPolicyTemplateInterface interface {
|
||||
|
@ -38,7 +38,7 @@ type ProjectController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
AddHandler(handler ProjectHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Start(threadiness int, ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type ProjectInterface interface {
|
||||
|
@ -38,7 +38,7 @@ type ProjectRoleTemplateBindingController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
AddHandler(handler ProjectRoleTemplateBindingHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Start(threadiness int, ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type ProjectRoleTemplateBindingInterface interface {
|
||||
|
@ -38,7 +38,7 @@ type ProjectRoleTemplateController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
AddHandler(handler ProjectRoleTemplateHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Start(threadiness int, ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type ProjectRoleTemplateInterface interface {
|
||||
|
@ -2,9 +2,8 @@ package schema
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
m "github.com/rancher/norman/types/mapping/mapper"
|
||||
"github.com/rancher/norman/types/factory"
|
||||
"github.com/rancher/types/apis/cluster.cattle.io/v1"
|
||||
"github.com/rancher/types/commonmappers"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -12,14 +11,9 @@ var (
|
||||
Version: "v1",
|
||||
Group: "cluster.cattle.io",
|
||||
Path: "/v1-cluster",
|
||||
SubContexts: map[string]bool{
|
||||
"clusters": true,
|
||||
},
|
||||
}
|
||||
|
||||
Schemas = commonmappers.Add(&Version, types.NewSchemas()).
|
||||
AddMapperForType(&Version, v1.Cluster{}, m.NewObject()).
|
||||
AddMapperForType(&Version, v1.ClusterNode{}, m.NewObject()).
|
||||
Schemas = factory.Schemas(&Version).
|
||||
MustImport(&Version, v1.Cluster{}).
|
||||
MustImport(&Version, v1.ClusterNode{})
|
||||
)
|
||||
|
@ -38,7 +38,7 @@ type ClusterController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
AddHandler(handler ClusterHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Start(threadiness int, ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type ClusterInterface interface {
|
||||
|
@ -38,7 +38,7 @@ type ClusterNodeController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
AddHandler(handler ClusterNodeHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Start(threadiness int, ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type ClusterNodeInterface interface {
|
||||
|
@ -0,0 +1,47 @@
|
||||
package mapper
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
"github.com/rancher/norman/types/convert"
|
||||
m "github.com/rancher/norman/types/mapper"
|
||||
)
|
||||
|
||||
type DeploymentStrategyMapper struct {
|
||||
}
|
||||
|
||||
func (d DeploymentStrategyMapper) FromInternal(data map[string]interface{}) {
|
||||
if m.GetValueN(data, "strategy", "type") != "Recreate" {
|
||||
m.PutValue(data, "Parallel", "deploymentStrategy", "kind")
|
||||
maxUnavailable := m.GetValueN(data, "strategy", "rollingUpdate", "maxUnavailable")
|
||||
maxSurge := m.GetValueN(data, "strategy", "rollingUpdate", "maxSurge")
|
||||
if !convert.IsEmpty(maxSurge) {
|
||||
m.PutValue(data, true, "deploymentStrategy", "parallelConfig", "startFirst")
|
||||
m.PutValue(data, convert.ToString(maxSurge), "batchSize")
|
||||
} else if !convert.IsEmpty(maxUnavailable) {
|
||||
m.PutValue(data, convert.ToString(maxUnavailable), "batchSize")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (d DeploymentStrategyMapper) ToInternal(data map[string]interface{}) {
|
||||
batchSize := m.GetValueN(data, "batchSize")
|
||||
if convert.IsEmpty(batchSize) {
|
||||
batchSize = 1
|
||||
}
|
||||
|
||||
batchSize, _ = convert.ToNumber(batchSize)
|
||||
|
||||
kind, _ := m.GetValueN(data, "deploymentStrategy", "kind").(string)
|
||||
if kind == "" || kind == "Parallel" {
|
||||
startFirst, _ := m.GetValueN(data, "deploymentStrategy", "startFirst").(bool)
|
||||
if startFirst {
|
||||
m.PutValue(data, batchSize, "strategy", "rollingUpdate", "maxSurge")
|
||||
} else {
|
||||
m.PutValue(data, batchSize, "strategy", "rollingUpdate", "maxUnavailable")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (d DeploymentStrategyMapper) ModifySchema(schema *types.Schema, schemas *types.Schemas) error {
|
||||
return nil
|
||||
}
|
@ -2,7 +2,7 @@ package mapper
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
"github.com/rancher/norman/types/mapping/mapper"
|
||||
"github.com/rancher/norman/types/mapper"
|
||||
)
|
||||
|
||||
type NodeAddressMapper struct {
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/rancher/norman/types"
|
||||
"github.com/rancher/norman/types/convert"
|
||||
"github.com/rancher/norman/types/mapping/mapper"
|
||||
"github.com/rancher/norman/types/mapper"
|
||||
)
|
||||
|
||||
type OSInfo struct {
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/rancher/norman/types"
|
||||
m "github.com/rancher/norman/types/mapping/mapper"
|
||||
m "github.com/rancher/norman/types/mapper"
|
||||
)
|
||||
|
||||
type PivotMapper struct {
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
|
||||
"github.com/rancher/norman/types"
|
||||
"github.com/rancher/norman/types/convert"
|
||||
"github.com/rancher/norman/types/mapping/mapper"
|
||||
"github.com/rancher/norman/types/mapper"
|
||||
"k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
|
37
apis/workload.cattle.io/v1/schema/mapper/status.go
Normal file
37
apis/workload.cattle.io/v1/schema/mapper/status.go
Normal file
@ -0,0 +1,37 @@
|
||||
package mapper
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
"github.com/rancher/types/status"
|
||||
)
|
||||
|
||||
type Status struct {
|
||||
}
|
||||
|
||||
func (s Status) FromInternal(data map[string]interface{}) {
|
||||
status.Set(data)
|
||||
}
|
||||
|
||||
func (s Status) ToInternal(data map[string]interface{}) {
|
||||
}
|
||||
|
||||
func (s Status) ModifySchema(schema *types.Schema, schemas *types.Schemas) error {
|
||||
schema.ResourceFields["state"] = types.Field{
|
||||
CodeName: "State",
|
||||
Type: "string",
|
||||
}
|
||||
schema.ResourceFields["transitioning"] = types.Field{
|
||||
CodeName: "Transitioning",
|
||||
Type: "enum",
|
||||
Options: []string{
|
||||
"yes",
|
||||
"no",
|
||||
"error",
|
||||
},
|
||||
}
|
||||
schema.ResourceFields["transitioningMessage"] = types.Field{
|
||||
CodeName: "TransitioningMessage",
|
||||
Type: "string",
|
||||
}
|
||||
return nil
|
||||
}
|
16
apis/workload.cattle.io/v1/schema/mapper/workload.go
Normal file
16
apis/workload.cattle.io/v1/schema/mapper/workload.go
Normal file
@ -0,0 +1,16 @@
|
||||
package mapper
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
m "github.com/rancher/norman/types/mapper"
|
||||
)
|
||||
|
||||
func NewWorkloadTypeMapper() types.Mapper {
|
||||
return &types.Mappers{
|
||||
&m.Move{From: "labels", To: "workloadLabels"},
|
||||
&m.Move{From: "annotations", To: "workloadAnnotations"},
|
||||
&m.Move{From: "metadata/labels", To: "labels", NoDeleteFromField: true},
|
||||
&m.Move{From: "metadata/annotations", To: "annotations", NoDeleteFromField: true},
|
||||
&m.Drop{Field: "metadata"},
|
||||
}
|
||||
}
|
@ -2,9 +2,10 @@ package schema
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
m "github.com/rancher/norman/types/mapping/mapper"
|
||||
"github.com/rancher/norman/types/factory"
|
||||
m "github.com/rancher/norman/types/mapper"
|
||||
workloadv1 "github.com/rancher/types/apis/workload.cattle.io/v1"
|
||||
"github.com/rancher/types/apis/workload.cattle.io/v1/schema/mapper"
|
||||
"github.com/rancher/types/commonmappers"
|
||||
"k8s.io/api/core/v1"
|
||||
"k8s.io/kubernetes/staging/src/k8s.io/api/apps/v1beta2"
|
||||
)
|
||||
@ -15,249 +16,283 @@ var (
|
||||
Group: "workload.cattle.io",
|
||||
Path: "/v1-workload",
|
||||
SubContexts: map[string]bool{
|
||||
"projects": true,
|
||||
"namespaces": true,
|
||||
"projects": true,
|
||||
},
|
||||
}
|
||||
|
||||
Schemas = commonmappers.Add(&Version, types.NewSchemas()).
|
||||
Schemas = factory.Schemas(&Version).
|
||||
Init(podTypes).
|
||||
Init(namespaceTypes).
|
||||
Init(nodeTypes).
|
||||
Init(replicaSetTypes).
|
||||
Init(deploymentTypes).
|
||||
Init(statefulSetTypes)
|
||||
Init(statefulSetTypes).
|
||||
Init(replicaSet).
|
||||
Init(replicationController).
|
||||
Init(daemonSet).
|
||||
Init(workloadTypes)
|
||||
)
|
||||
|
||||
func workloadTypes(schemas *types.Schemas) *types.Schemas {
|
||||
return schemas.
|
||||
AddMapperForType(&Version, workloadv1.WorkloadSpec{},
|
||||
&m.Embed{Field: "deployConfig"},
|
||||
&m.Embed{Field: "template"},
|
||||
).
|
||||
AddMapperForType(&Version, workloadv1.Workload{}, mapper.NewWorkloadTypeMapper()).
|
||||
MustImport(&Version, workloadv1.Workload{}, projectOverride{})
|
||||
}
|
||||
|
||||
func statefulSetTypes(schemas *types.Schemas) *types.Schemas {
|
||||
return schemas.
|
||||
AddMapperForType(&Version, v1beta2.StatefulSetUpdateStrategy{}, &types.TypeMapper{
|
||||
Mappers: []types.Mapper{
|
||||
m.Enum{Field: "type",
|
||||
Values: map[string][]string{
|
||||
"RollingUpdate": {"rollingUpdate"},
|
||||
"OnDelete": {"onDelete"},
|
||||
},
|
||||
},
|
||||
m.Move{From: "type", To: "kind"},
|
||||
m.Move{From: "rollingUpdate", To: "rollingUpdateConfig"},
|
||||
AddMapperForType(&Version, v1beta2.StatefulSetSpec{},
|
||||
&m.Move{
|
||||
From: "replicas",
|
||||
To: "scale",
|
||||
DestDefined: true,
|
||||
},
|
||||
}).
|
||||
AddMapperForType(&Version, v1beta2.StatefulSetSpec{}, &types.TypeMapper{
|
||||
Mappers: []types.Mapper{
|
||||
&m.Move{
|
||||
From: "replicas",
|
||||
To: "deploy/scale",
|
||||
},
|
||||
m.Enum{Field: "podManagementPolicy",
|
||||
Values: map[string][]string{
|
||||
"OrderedReady": {"ordered"},
|
||||
"Parallel": {"parallel"},
|
||||
},
|
||||
},
|
||||
&m.Move{
|
||||
From: "podManagementPolicy",
|
||||
To: "deploy/strategy",
|
||||
},
|
||||
&m.Move{
|
||||
From: "revisionHistoryLimit",
|
||||
To: "deploy/maxRevisions",
|
||||
},
|
||||
m.Drop{"selector"},
|
||||
m.SliceToMap{
|
||||
Field: "volumeClaimTemplates",
|
||||
Key: "name",
|
||||
},
|
||||
&m.Move{
|
||||
From: "updateStrategy/rollingUpdate/partition",
|
||||
To: "deploymentStrategy/orderedConfig/partition",
|
||||
},
|
||||
}).
|
||||
AddMapperForType(&Version, v1beta2.StatefulSet{}, m.NewObject()).
|
||||
m.SetValue{
|
||||
From: "updateStrategy/type",
|
||||
IfEq: "OnDelete",
|
||||
Value: true,
|
||||
To: "deploymentStrategy/orderedConfig/onDelete",
|
||||
},
|
||||
m.SetValue{
|
||||
From: "podManagementPolicy",
|
||||
IfEq: "Parallel",
|
||||
Value: "Parallel",
|
||||
To: "deploymentStrategy/kind",
|
||||
},
|
||||
m.SetValue{
|
||||
From: "podManagementPolicy",
|
||||
IfEq: "OrderedReady",
|
||||
Value: "Ordered",
|
||||
To: "deploymentStrategy/kind",
|
||||
},
|
||||
m.Drop{Field: "selector"},
|
||||
&m.Embed{Field: "template"},
|
||||
).
|
||||
AddMapperForType(&Version, v1beta2.StatefulSet{}, mapper.NewWorkloadTypeMapper()).
|
||||
MustImport(&Version, v1beta2.StatefulSetSpec{}, deployOverride{}).
|
||||
MustImport(&Version, v1beta2.StatefulSet{})
|
||||
MustImport(&Version, v1beta2.StatefulSet{}, projectOverride{})
|
||||
}
|
||||
|
||||
func replicaSet(schemas *types.Schemas) *types.Schemas {
|
||||
return schemas.
|
||||
AddMapperForType(&Version, v1beta2.ReplicaSetSpec{},
|
||||
&m.Move{
|
||||
From: "replicas",
|
||||
To: "scale",
|
||||
DestDefined: true,
|
||||
},
|
||||
&m.Move{
|
||||
From: "minReadySeconds",
|
||||
To: "deploymentStrategy/parallelConfig/minReadySeconds",
|
||||
},
|
||||
m.Drop{Field: "selector"},
|
||||
&m.Embed{Field: "template"},
|
||||
).
|
||||
AddMapperForType(&Version, v1beta2.ReplicaSet{}, mapper.NewWorkloadTypeMapper()).
|
||||
MustImport(&Version, v1beta2.ReplicaSetSpec{}, deployOverride{}).
|
||||
MustImportAndCustomize(&Version, v1beta2.ReplicaSet{}, func(schema *types.Schema) {
|
||||
schema.BaseType = "workload"
|
||||
}, projectOverride{})
|
||||
}
|
||||
|
||||
func replicationController(schemas *types.Schemas) *types.Schemas {
|
||||
return schemas.
|
||||
AddMapperForType(&Version, v1.ReplicationControllerSpec{},
|
||||
&m.Move{
|
||||
From: "replicas",
|
||||
To: "scale",
|
||||
DestDefined: true,
|
||||
},
|
||||
&m.Move{
|
||||
From: "minReadySeconds",
|
||||
To: "deploymentStrategy/parallelConfig/minReadySeconds",
|
||||
},
|
||||
m.Drop{Field: "selector"},
|
||||
&m.Embed{Field: "template"},
|
||||
).
|
||||
AddMapperForType(&Version, v1.ReplicationController{}, mapper.NewWorkloadTypeMapper()).
|
||||
MustImport(&Version, v1.ReplicationControllerSpec{}, deployOverride{}).
|
||||
MustImportAndCustomize(&Version, v1.ReplicationController{}, func(schema *types.Schema) {
|
||||
schema.BaseType = "workload"
|
||||
}, projectOverride{})
|
||||
}
|
||||
|
||||
func daemonSet(schemas *types.Schemas) *types.Schemas {
|
||||
return schemas.
|
||||
AddMapperForType(&Version, v1beta2.DaemonSetSpec{},
|
||||
m.SetValue{
|
||||
From: "updateStrategy/type",
|
||||
IfEq: "OnDelete",
|
||||
Value: true,
|
||||
To: "deploymentStrategy/globalConfig/onDelete",
|
||||
},
|
||||
&m.Move{
|
||||
From: "minReadySeconds",
|
||||
To: "deploymentStrategy/globalConfig/minReadySeconds",
|
||||
},
|
||||
m.Drop{Field: "selector"},
|
||||
&m.Embed{Field: "template"},
|
||||
).
|
||||
AddMapperForType(&Version, v1beta2.DaemonSet{}, mapper.NewWorkloadTypeMapper()).
|
||||
MustImport(&Version, v1beta2.DaemonSetSpec{}, deployOverride{}).
|
||||
MustImportAndCustomize(&Version, v1beta2.DaemonSet{}, func(schema *types.Schema) {
|
||||
schema.BaseType = "workload"
|
||||
}, projectOverride{})
|
||||
}
|
||||
|
||||
func deploymentTypes(schemas *types.Schemas) *types.Schemas {
|
||||
return schemas.
|
||||
AddMapperForType(&Version, v1beta2.DeploymentStrategy{}, &types.TypeMapper{
|
||||
Mappers: []types.Mapper{
|
||||
m.Enum{Field: "type",
|
||||
Values: map[string][]string{
|
||||
"RollingUpdate": {"rollingUpdate"},
|
||||
"Recreate": {"recreate"},
|
||||
},
|
||||
},
|
||||
m.Move{From: "type", To: "kind"},
|
||||
m.Move{From: "rollingUpdate", To: "rollingUpdateConfig"},
|
||||
AddMapperForType(&Version, v1beta2.DeploymentSpec{},
|
||||
&m.Move{
|
||||
From: "replicas",
|
||||
To: "scale",
|
||||
DestDefined: true,
|
||||
},
|
||||
}).
|
||||
AddMapperForType(&Version, v1beta2.DeploymentSpec{}, &types.TypeMapper{
|
||||
Mappers: []types.Mapper{
|
||||
&m.Move{
|
||||
From: "replicas",
|
||||
To: "deploy/scale",
|
||||
},
|
||||
&m.Move{
|
||||
From: "minReadySeconds",
|
||||
To: "deploy/minReadySeconds",
|
||||
},
|
||||
&m.Move{
|
||||
From: "progressDeadlineSeconds",
|
||||
To: "deploy/progressDeadlineSeconds",
|
||||
},
|
||||
&m.Move{
|
||||
From: "revisionHistoryLimit",
|
||||
To: "deploy/maxRevisions",
|
||||
},
|
||||
m.Drop{"selector"},
|
||||
m.Move{From: "strategy", To: "updateStrategy"},
|
||||
&m.Move{
|
||||
From: "minReadySeconds",
|
||||
To: "deploymentStrategy/parallelConfig/minReadySeconds",
|
||||
},
|
||||
}).
|
||||
AddMapperForType(&Version, v1beta2.Deployment{}, m.NewObject()).
|
||||
&m.Move{
|
||||
From: "progressDeadlineSeconds",
|
||||
To: "deploymentStrategy/parallelConfig/progressDeadlineSeconds",
|
||||
},
|
||||
mapper.DeploymentStrategyMapper{},
|
||||
m.Drop{Field: "selector"},
|
||||
m.Drop{Field: "strategy"},
|
||||
&m.Embed{Field: "template"},
|
||||
).
|
||||
AddMapperForType(&Version, v1beta2.Deployment{}, mapper.NewWorkloadTypeMapper()).
|
||||
MustImport(&Version, v1beta2.DeploymentSpec{}, deployOverride{}).
|
||||
MustImport(&Version, v1beta2.Deployment{})
|
||||
}
|
||||
|
||||
func replicaSetTypes(schemas *types.Schemas) *types.Schemas {
|
||||
return schemas.
|
||||
AddMapperForType(&Version, v1beta2.ReplicaSetSpec{}, &types.TypeMapper{
|
||||
Mappers: []types.Mapper{
|
||||
&m.Move{
|
||||
From: "replicas",
|
||||
To: "deploy/scale",
|
||||
},
|
||||
&m.Move{
|
||||
From: "minReadySeconds",
|
||||
To: "deploy/minReadySeconds",
|
||||
},
|
||||
m.Drop{"selector"},
|
||||
},
|
||||
}).
|
||||
AddMapperForType(&Version, v1beta2.ReplicaSet{}, m.NewObject()).
|
||||
MustImport(&Version, v1beta2.ReplicaSetSpec{}, deployOverride{}).
|
||||
MustImport(&Version, v1beta2.ReplicaSet{})
|
||||
MustImportAndCustomize(&Version, v1beta2.Deployment{}, func(schema *types.Schema) {
|
||||
schema.BaseType = "workload"
|
||||
}, projectOverride{})
|
||||
}
|
||||
|
||||
func nodeTypes(schemas *types.Schemas) *types.Schemas {
|
||||
return schemas.
|
||||
AddMapperForType(&Version, v1.NodeStatus{}, &types.TypeMapper{
|
||||
Mappers: []types.Mapper{
|
||||
&mapper.NodeAddressMapper{},
|
||||
&mapper.OSInfo{},
|
||||
&m.Drop{"addresses"},
|
||||
&m.Drop{"conditions"},
|
||||
&m.Drop{"daemonEndpoints"},
|
||||
&m.Drop{"images"},
|
||||
&m.Drop{"nodeInfo"},
|
||||
&m.SliceToMap{Field: "volumesAttached", Key: "devicePath"},
|
||||
},
|
||||
}).
|
||||
AddMapperForType(&Version, v1.Node{}, m.NewObject()).
|
||||
MustImport(&Version, v1.NodeStatus{}, nodeStatusOverride{}).
|
||||
AddMapperForType(&Version, v1.NodeStatus{},
|
||||
&mapper.NodeAddressMapper{},
|
||||
&mapper.OSInfo{},
|
||||
&m.Drop{Field: "addresses"},
|
||||
&m.Drop{Field: "daemonEndpoints"},
|
||||
&m.Drop{Field: "images"},
|
||||
&m.Drop{Field: "nodeInfo"},
|
||||
&m.SliceToMap{Field: "volumesAttached", Key: "devicePath"},
|
||||
).
|
||||
AddMapperForType(&Version, v1.Node{},
|
||||
mapper.Status{},
|
||||
&m.Embed{Field: "status"},
|
||||
&m.Drop{Field: "conditions"},
|
||||
).
|
||||
MustImport(&Version, v1.NodeStatus{}, struct {
|
||||
IPAddress string
|
||||
Hostname string
|
||||
Info NodeInfo
|
||||
}{}).
|
||||
MustImport(&Version, v1.Node{})
|
||||
}
|
||||
|
||||
func namespaceTypes(schemas *types.Schemas) *types.Schemas {
|
||||
return schemas.
|
||||
AddMapperForType(&Version, v1.NamespaceStatus{}, &types.TypeMapper{
|
||||
Mappers: []types.Mapper{
|
||||
&m.Drop{"phase"},
|
||||
},
|
||||
}).
|
||||
AddMapperForType(&Version, v1.NamespaceSpec{}, &types.TypeMapper{
|
||||
Mappers: []types.Mapper{
|
||||
&m.Drop{"finalizers"},
|
||||
},
|
||||
}).
|
||||
AddMapperForType(&Version, v1.Namespace{}, m.NewObject()).
|
||||
MustImport(&Version, v1.Namespace{})
|
||||
AddMapperForType(&Version, v1.NamespaceStatus{},
|
||||
&m.Drop{Field: "phase"},
|
||||
).
|
||||
AddMapperForType(&Version, v1.NamespaceSpec{},
|
||||
&m.Drop{Field: "finalizers"},
|
||||
).
|
||||
AddMapperForType(&Version, v1.Namespace{},
|
||||
&m.LabelField{Field: "projectId"},
|
||||
).
|
||||
MustImport(&Version, v1.Namespace{}, projectOverride{}, struct {
|
||||
Templates map[string]string
|
||||
Answers map[string]interface{}
|
||||
Prune bool
|
||||
ExternalID string
|
||||
Tags []string
|
||||
}{})
|
||||
}
|
||||
|
||||
func podTypes(schemas *types.Schemas) *types.Schemas {
|
||||
return schemas.
|
||||
AddMapperForType(&Version, v1.Capabilities{}, &types.TypeMapper{
|
||||
Mappers: []types.Mapper{
|
||||
m.Move{From: "add", To: "capAdd"},
|
||||
m.Move{From: "drop", To: "capDrop"},
|
||||
},
|
||||
}).
|
||||
AddMapperForType(&Version, v1.PodSecurityContext{}, &types.TypeMapper{
|
||||
Mappers: []types.Mapper{
|
||||
m.Drop{"seLinuxOptions"},
|
||||
m.Move{From: "runAsUser", To: "uid"},
|
||||
m.Move{From: "supplementalGroups", To: "gids"},
|
||||
m.Move{From: "fsGroup", To: "fsgid"},
|
||||
},
|
||||
}).
|
||||
AddMapperForType(&Version, v1.SecurityContext{}, &types.TypeMapper{
|
||||
Mappers: []types.Mapper{
|
||||
&m.Embed{Field: "capabilities"},
|
||||
m.Drop{"seLinuxOptions"},
|
||||
m.Move{From: "readOnlyRootFilesystem", To: "readOnly"},
|
||||
m.Move{From: "runAsUser", To: "uid"},
|
||||
},
|
||||
}).
|
||||
AddMapperForType(&Version, v1.Container{}, &types.TypeMapper{
|
||||
Mappers: []types.Mapper{
|
||||
m.Move{"command", "entrypoint"},
|
||||
m.Move{"args", "command"},
|
||||
m.Move{"livenessProbe", "healthcheck"},
|
||||
m.Move{"readinessProbe", "readycheck"},
|
||||
m.Move{"imagePullPolicy", "pullPolicy"},
|
||||
mapper.EnvironmentMapper{},
|
||||
&m.Embed{Field: "securityContext"},
|
||||
&m.Embed{Field: "lifecycle"},
|
||||
},
|
||||
}).
|
||||
AddMapperForType(&Version, v1.ContainerPort{}, &types.TypeMapper{
|
||||
Mappers: []types.Mapper{
|
||||
m.Drop{"name"},
|
||||
},
|
||||
}).
|
||||
AddMapperForType(&Version, v1.VolumeMount{}, &types.TypeMapper{
|
||||
Mappers: []types.Mapper{
|
||||
m.Enum{
|
||||
Field: "mountPropagation",
|
||||
Values: map[string][]string{
|
||||
"HostToContainer": []string{"rslave"},
|
||||
"Bidirectional": []string{"rshared", "shared"},
|
||||
},
|
||||
AddMapperForType(&Version, v1.PodTemplateSpec{},
|
||||
&m.Embed{Field: "spec"},
|
||||
).
|
||||
AddMapperForType(&Version, v1.Capabilities{},
|
||||
m.Move{From: "add", To: "capAdd"},
|
||||
m.Move{From: "drop", To: "capDrop"},
|
||||
).
|
||||
AddMapperForType(&Version, v1.PodSecurityContext{},
|
||||
m.Drop{Field: "seLinuxOptions"},
|
||||
m.Move{From: "runAsUser", To: "uid"},
|
||||
m.Move{From: "supplementalGroups", To: "gids"},
|
||||
m.Move{From: "fsGroup", To: "fsgid"},
|
||||
).
|
||||
AddMapperForType(&Version, v1.SecurityContext{},
|
||||
&m.Embed{Field: "capabilities"},
|
||||
m.Drop{Field: "seLinuxOptions"},
|
||||
m.Move{From: "readOnlyRootFilesystem", To: "readOnly"},
|
||||
m.Move{From: "runAsUser", To: "uid"},
|
||||
).
|
||||
AddMapperForType(&Version, v1.Container{},
|
||||
m.Move{From: "command", To: "entrypoint"},
|
||||
m.Move{From: "args", To: "command"},
|
||||
m.Move{From: "livenessProbe", To: "healthcheck"},
|
||||
m.Move{From: "readinessProbe", To: "readycheck"},
|
||||
m.Move{From: "imagePullPolicy", To: "pullPolicy"},
|
||||
mapper.EnvironmentMapper{},
|
||||
&m.Embed{Field: "securityContext"},
|
||||
&m.Embed{Field: "lifecycle"},
|
||||
).
|
||||
AddMapperForType(&Version, v1.ContainerPort{},
|
||||
m.Drop{Field: "name"},
|
||||
).
|
||||
AddMapperForType(&Version, v1.VolumeMount{},
|
||||
m.Enum{
|
||||
Field: "mountPropagation",
|
||||
Values: map[string][]string{
|
||||
"HostToContainer": {"rslave"},
|
||||
"Bidirectional": {"rshared", "shared"},
|
||||
},
|
||||
},
|
||||
}).
|
||||
).
|
||||
AddMapperForType(&Version, v1.Handler{}, handlerMapper).
|
||||
AddMapperForType(&Version, v1.Probe{}, handlerMapper).
|
||||
AddMapperForType(&Version, v1.PodSpec{}, &types.TypeMapper{
|
||||
Mappers: []types.Mapper{
|
||||
m.Move{From: "restartPolicy", To: "restart"},
|
||||
m.Move{From: "imagePullSecrets", To: "pullSecrets"},
|
||||
mapper.NamespaceMapper{},
|
||||
mapper.InitContainerMapper{},
|
||||
mapper.SchedulingMapper{},
|
||||
&m.Embed{Field: "securityContext"},
|
||||
&m.SliceToMap{
|
||||
Field: "volumes",
|
||||
Key: "name",
|
||||
},
|
||||
&m.SliceToMap{
|
||||
Field: "containers",
|
||||
Key: "name",
|
||||
},
|
||||
&m.SliceToMap{
|
||||
Field: "hostAliases",
|
||||
Key: "ip",
|
||||
},
|
||||
AddMapperForType(&Version, v1.PodStatus{},
|
||||
m.Move{From: "hostIP", To: "nodeIp"},
|
||||
m.Move{From: "podIP", To: "podIp"},
|
||||
).
|
||||
AddMapperForType(&Version, v1.PodSpec{},
|
||||
m.Move{From: "restartPolicy", To: "restart"},
|
||||
m.Move{From: "imagePullSecrets", To: "pullSecrets"},
|
||||
mapper.NamespaceMapper{},
|
||||
mapper.InitContainerMapper{},
|
||||
mapper.SchedulingMapper{},
|
||||
&m.Embed{Field: "securityContext"},
|
||||
&m.Drop{Field: "serviceAccount"},
|
||||
&m.SliceToMap{
|
||||
Field: "volumes",
|
||||
Key: "name",
|
||||
},
|
||||
}).
|
||||
AddMapperForType(&Version, v1.Pod{}, &types.TypeMapper{
|
||||
Mappers: []types.Mapper{
|
||||
&m.Drop{"status"},
|
||||
&m.Embed{Field: "metadata"},
|
||||
&m.Embed{Field: "spec"},
|
||||
&m.SliceToMap{
|
||||
Field: "containers",
|
||||
Key: "name",
|
||||
},
|
||||
}).
|
||||
AddMapperForType(&Version, v1.ResourceRequirements{}, &types.TypeMapper{
|
||||
Mappers: []types.Mapper{
|
||||
mapper.PivotMapper{Plural: true},
|
||||
&m.SliceToMap{
|
||||
Field: "hostAliases",
|
||||
Key: "ip",
|
||||
},
|
||||
}).
|
||||
).
|
||||
AddMapperForType(&Version, v1.ResourceRequirements{},
|
||||
mapper.PivotMapper{Plural: true},
|
||||
).
|
||||
AddMapperForType(&Version, v1.Pod{}, mapper.Status{}).
|
||||
// Must import handlers before Container
|
||||
MustImport(&Version, v1.Handler{}, handlerOverride{}).
|
||||
MustImport(&Version, v1.Probe{}, handlerOverride{}).
|
||||
@ -269,9 +304,12 @@ func podTypes(schemas *types.Schemas) *types.Schemas {
|
||||
InitContainer bool
|
||||
}{}).
|
||||
MustImport(&Version, v1.PodSpec{}, struct {
|
||||
Net string
|
||||
PID string
|
||||
IPC string
|
||||
NodeName string `norman:"type=reference[node]"`
|
||||
Net string
|
||||
PID string
|
||||
IPC string
|
||||
}{}).
|
||||
MustImport(&Version, v1.Pod{})
|
||||
MustImport(&Version, v1.Pod{}, projectOverride{}, struct {
|
||||
WorkloadID string `norman:"type=reference[workload]"`
|
||||
}{})
|
||||
}
|
||||
|
@ -2,28 +2,25 @@ package schema
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
m "github.com/rancher/norman/types/mapping/mapper"
|
||||
m "github.com/rancher/norman/types/mapper"
|
||||
"github.com/rancher/types/apis/workload.cattle.io/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
var (
|
||||
handlerMapper = &types.TypeMapper{
|
||||
Mappers: []types.Mapper{
|
||||
&m.UnionEmbed{
|
||||
Fields: []m.UnionMapping{
|
||||
{
|
||||
FieldName: "exec",
|
||||
CheckFields: []string{"command"},
|
||||
},
|
||||
{
|
||||
FieldName: "tcpSocket",
|
||||
CheckFields: []string{"tcp", "port"},
|
||||
},
|
||||
{
|
||||
FieldName: "httpGet",
|
||||
CheckFields: []string{"port"},
|
||||
},
|
||||
},
|
||||
handlerMapper = &m.UnionEmbed{
|
||||
Fields: []m.UnionMapping{
|
||||
{
|
||||
FieldName: "exec",
|
||||
CheckFields: []string{"command"},
|
||||
},
|
||||
{
|
||||
FieldName: "tcpSocket",
|
||||
CheckFields: []string{"tcp", "port"},
|
||||
},
|
||||
{
|
||||
FieldName: "httpGet",
|
||||
CheckFields: []string{"port"},
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -76,22 +73,6 @@ type NodeScheduling struct {
|
||||
Preferred []string
|
||||
}
|
||||
|
||||
type deployParams struct {
|
||||
BatchSize int64
|
||||
Scale int64
|
||||
Global bool
|
||||
Cron string
|
||||
Job bool
|
||||
Ordered bool
|
||||
QuorumSize int64
|
||||
}
|
||||
|
||||
type nodeStatusOverride struct {
|
||||
IPAddress string
|
||||
Hostname string
|
||||
Info NodeInfo
|
||||
}
|
||||
|
||||
type NodeInfo struct {
|
||||
CPU CPUInfo
|
||||
Memory MemoryInfo
|
||||
@ -118,9 +99,11 @@ type KubernetesInfo struct {
|
||||
KubeProxyVersion string
|
||||
}
|
||||
|
||||
type DeployParams struct {
|
||||
type deployOverride struct {
|
||||
v1.DeployConfig
|
||||
}
|
||||
|
||||
type deployOverride struct {
|
||||
Deploy *DeployParams
|
||||
type projectOverride struct {
|
||||
types.Namespaced
|
||||
ProjectID string `norman:"type=reference[/v1-authz/schemas/project]"`
|
||||
}
|
||||
|
56
apis/workload.cattle.io/v1/types.go
Normal file
56
apis/workload.cattle.io/v1/types.go
Normal file
@ -0,0 +1,56 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type WorkloadSpec struct {
|
||||
DeployConfig DeployConfig
|
||||
Template v1.PodTemplateSpec
|
||||
}
|
||||
|
||||
type WorkloadStatus struct {
|
||||
}
|
||||
|
||||
type Workload struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec WorkloadSpec `json:"spec"`
|
||||
Status *WorkloadStatus `json:"status"`
|
||||
}
|
||||
|
||||
type DeployConfig struct {
|
||||
Scale int64
|
||||
BatchSize string
|
||||
DeploymentStrategy *DeployStrategy
|
||||
}
|
||||
|
||||
type DeploymentParallelConfig struct {
|
||||
StartFirst bool
|
||||
MinReadySeconds int64
|
||||
ProgressDeadlineSeconds int64
|
||||
}
|
||||
|
||||
type DeploymentJobConfig struct {
|
||||
BatchLimit int64
|
||||
ActiveDeadlineSeconds int64
|
||||
OnDelete bool
|
||||
}
|
||||
|
||||
type DeploymentOrderedConfig struct {
|
||||
PartitionSize int64
|
||||
OnDelete bool
|
||||
}
|
||||
|
||||
type DeploymentGlobalConfig struct {
|
||||
OnDelete bool
|
||||
}
|
||||
|
||||
type DeployStrategy struct {
|
||||
Kind string
|
||||
ParallelConfig *DeploymentParallelConfig
|
||||
JobConfig *DeploymentJobConfig
|
||||
OrderedConfig *DeploymentOrderedConfig
|
||||
GlobalConfig *DeploymentGlobalConfig
|
||||
}
|
251
apis/workload.cattle.io/v1/zz_generated_deepcopy.go
Normal file
251
apis/workload.cattle.io/v1/zz_generated_deepcopy.go
Normal file
@ -0,0 +1,251 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DeployConfig) DeepCopyInto(out *DeployConfig) {
|
||||
*out = *in
|
||||
if in.DeploymentStrategy != nil {
|
||||
in, out := &in.DeploymentStrategy, &out.DeploymentStrategy
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(DeployStrategy)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeployConfig.
|
||||
func (in *DeployConfig) DeepCopy() *DeployConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DeployConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DeployStrategy) DeepCopyInto(out *DeployStrategy) {
|
||||
*out = *in
|
||||
if in.ParallelConfig != nil {
|
||||
in, out := &in.ParallelConfig, &out.ParallelConfig
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(DeploymentParallelConfig)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
if in.JobConfig != nil {
|
||||
in, out := &in.JobConfig, &out.JobConfig
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(DeploymentJobConfig)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
if in.OrderedConfig != nil {
|
||||
in, out := &in.OrderedConfig, &out.OrderedConfig
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(DeploymentOrderedConfig)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
if in.GlobalConfig != nil {
|
||||
in, out := &in.GlobalConfig, &out.GlobalConfig
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(DeploymentGlobalConfig)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeployStrategy.
|
||||
func (in *DeployStrategy) DeepCopy() *DeployStrategy {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DeployStrategy)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DeploymentGlobalConfig) DeepCopyInto(out *DeploymentGlobalConfig) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentGlobalConfig.
|
||||
func (in *DeploymentGlobalConfig) DeepCopy() *DeploymentGlobalConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DeploymentGlobalConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DeploymentJobConfig) DeepCopyInto(out *DeploymentJobConfig) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentJobConfig.
|
||||
func (in *DeploymentJobConfig) DeepCopy() *DeploymentJobConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DeploymentJobConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DeploymentOrderedConfig) DeepCopyInto(out *DeploymentOrderedConfig) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentOrderedConfig.
|
||||
func (in *DeploymentOrderedConfig) DeepCopy() *DeploymentOrderedConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DeploymentOrderedConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DeploymentParallelConfig) DeepCopyInto(out *DeploymentParallelConfig) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentParallelConfig.
|
||||
func (in *DeploymentParallelConfig) DeepCopy() *DeploymentParallelConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DeploymentParallelConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Workload) DeepCopyInto(out *Workload) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
if in.Status != nil {
|
||||
in, out := &in.Status, &out.Status
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(WorkloadStatus)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workload.
|
||||
func (in *Workload) DeepCopy() *Workload {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Workload)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *Workload) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WorkloadList) DeepCopyInto(out *WorkloadList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]Workload, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadList.
|
||||
func (in *WorkloadList) DeepCopy() *WorkloadList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WorkloadList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *WorkloadList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WorkloadSpec) DeepCopyInto(out *WorkloadSpec) {
|
||||
*out = *in
|
||||
in.DeployConfig.DeepCopyInto(&out.DeployConfig)
|
||||
in.Template.DeepCopyInto(&out.Template)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadSpec.
|
||||
func (in *WorkloadSpec) DeepCopy() *WorkloadSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WorkloadSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WorkloadStatus) DeepCopyInto(out *WorkloadStatus) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadStatus.
|
||||
func (in *WorkloadStatus) DeepCopy() *WorkloadStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WorkloadStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
57
apis/workload.cattle.io/v1/zz_generated_k8s_client.go
Normal file
57
apis/workload.cattle.io/v1/zz_generated_k8s_client.go
Normal file
@ -0,0 +1,57 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"github.com/rancher/norman/clientbase"
|
||||
"k8s.io/client-go/dynamic"
|
||||
"k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
type Interface interface {
|
||||
RESTClient() rest.Interface
|
||||
|
||||
WorkloadsGetter
|
||||
}
|
||||
|
||||
type Client struct {
|
||||
sync.Mutex
|
||||
restClient rest.Interface
|
||||
|
||||
workloadControllers map[string]WorkloadController
|
||||
}
|
||||
|
||||
func NewForConfig(config rest.Config) (Interface, error) {
|
||||
if config.NegotiatedSerializer == nil {
|
||||
configConfig := dynamic.ContentConfig()
|
||||
config.NegotiatedSerializer = configConfig.NegotiatedSerializer
|
||||
}
|
||||
|
||||
restClient, err := rest.UnversionedRESTClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &Client{
|
||||
restClient: restClient,
|
||||
|
||||
workloadControllers: map[string]WorkloadController{},
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (c *Client) RESTClient() rest.Interface {
|
||||
return c.restClient
|
||||
}
|
||||
|
||||
type WorkloadsGetter interface {
|
||||
Workloads(namespace string) WorkloadInterface
|
||||
}
|
||||
|
||||
func (c *Client) Workloads(namespace string) WorkloadInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &WorkloadResource, WorkloadGroupVersionKind, workloadFactory{})
|
||||
return &workloadClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
141
apis/workload.cattle.io/v1/zz_generated_workload_controller.go
Normal file
141
apis/workload.cattle.io/v1/zz_generated_workload_controller.go
Normal file
@ -0,0 +1,141 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/norman/clientbase"
|
||||
"github.com/rancher/norman/controller"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
WorkloadGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v1",
|
||||
Group: "workload.cattle.io",
|
||||
Kind: "Workload",
|
||||
}
|
||||
WorkloadResource = metav1.APIResource{
|
||||
Name: "workloads",
|
||||
SingularName: "workload",
|
||||
Namespaced: false,
|
||||
Kind: WorkloadGroupVersionKind.Kind,
|
||||
}
|
||||
)
|
||||
|
||||
type WorkloadList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []Workload
|
||||
}
|
||||
|
||||
type WorkloadHandlerFunc func(key string, obj *Workload) error
|
||||
|
||||
type WorkloadController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
AddHandler(handler WorkloadHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type WorkloadInterface interface {
|
||||
Create(*Workload) (*Workload, error)
|
||||
Get(name string, opts metav1.GetOptions) (*Workload, error)
|
||||
Update(*Workload) (*Workload, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*WorkloadList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() WorkloadController
|
||||
}
|
||||
|
||||
type workloadController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *workloadController) AddHandler(handler WorkloadHandlerFunc) {
|
||||
c.GenericController.AddHandler(func(key string) error {
|
||||
obj, exists, err := c.Informer().GetStore().GetByKey(key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !exists {
|
||||
return handler(key, nil)
|
||||
}
|
||||
return handler(key, obj.(*Workload))
|
||||
})
|
||||
}
|
||||
|
||||
type workloadFactory struct {
|
||||
}
|
||||
|
||||
func (c workloadFactory) Object() runtime.Object {
|
||||
return &Workload{}
|
||||
}
|
||||
|
||||
func (c workloadFactory) List() runtime.Object {
|
||||
return &WorkloadList{}
|
||||
}
|
||||
|
||||
func (s *workloadClient) Controller() WorkloadController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.workloadControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(WorkloadGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &workloadController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.workloadControllers[s.ns] = c
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type workloadClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *clientbase.ObjectClient
|
||||
controller WorkloadController
|
||||
}
|
||||
|
||||
func (s *workloadClient) Create(o *Workload) (*Workload, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*Workload), err
|
||||
}
|
||||
|
||||
func (s *workloadClient) Get(name string, opts metav1.GetOptions) (*Workload, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*Workload), err
|
||||
}
|
||||
|
||||
func (s *workloadClient) Update(o *Workload) (*Workload, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*Workload), err
|
||||
}
|
||||
|
||||
func (s *workloadClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *workloadClient) List(opts metav1.ListOptions) (*WorkloadList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*WorkloadList), err
|
||||
}
|
||||
|
||||
func (s *workloadClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
func (s *workloadClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
@ -9,8 +9,8 @@ type Client struct {
|
||||
|
||||
Project ProjectOperations
|
||||
ProjectRoleTemplate ProjectRoleTemplateOperations
|
||||
PodSecurityPolicyTemplate PodSecurityPolicyTemplateOperations
|
||||
ProjectRoleTemplateBinding ProjectRoleTemplateBindingOperations
|
||||
PodSecurityPolicyTemplate PodSecurityPolicyTemplateOperations
|
||||
ClusterRoleTemplate ClusterRoleTemplateOperations
|
||||
ClusterRoleTemplateBinding ClusterRoleTemplateBindingOperations
|
||||
}
|
||||
@ -27,8 +27,8 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) {
|
||||
|
||||
client.Project = newProjectClient(client)
|
||||
client.ProjectRoleTemplate = newProjectRoleTemplateClient(client)
|
||||
client.PodSecurityPolicyTemplate = newPodSecurityPolicyTemplateClient(client)
|
||||
client.ProjectRoleTemplateBinding = newProjectRoleTemplateBindingClient(client)
|
||||
client.PodSecurityPolicyTemplate = newPodSecurityPolicyTemplateClient(client)
|
||||
client.ClusterRoleTemplate = newClusterRoleTemplateClient(client)
|
||||
client.ClusterRoleTemplateBinding = newClusterRoleTemplateBindingClient(client)
|
||||
|
||||
|
@ -5,21 +5,31 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
ClusterRoleTemplateType = "clusterRoleTemplate"
|
||||
ClusterRoleTemplateFieldAPIVersion = "apiVersion"
|
||||
ClusterRoleTemplateFieldClusterRoleTemplates = "clusterRoleTemplates"
|
||||
ClusterRoleTemplateFieldKind = "kind"
|
||||
ClusterRoleTemplateFieldObjectMeta = "objectMeta"
|
||||
ClusterRoleTemplateFieldRules = "rules"
|
||||
ClusterRoleTemplateType = "clusterRoleTemplate"
|
||||
ClusterRoleTemplateFieldAnnotations = "annotations"
|
||||
ClusterRoleTemplateFieldClusterRoleTemplateIds = "clusterRoleTemplateIds"
|
||||
ClusterRoleTemplateFieldCreated = "created"
|
||||
ClusterRoleTemplateFieldLabels = "labels"
|
||||
ClusterRoleTemplateFieldName = "name"
|
||||
ClusterRoleTemplateFieldOwnerReferences = "ownerReferences"
|
||||
ClusterRoleTemplateFieldRemoved = "removed"
|
||||
ClusterRoleTemplateFieldResourcePath = "resourcePath"
|
||||
ClusterRoleTemplateFieldRules = "rules"
|
||||
ClusterRoleTemplateFieldUuid = "uuid"
|
||||
)
|
||||
|
||||
type ClusterRoleTemplate struct {
|
||||
types.Resource
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
ClusterRoleTemplates []string `json:"clusterRoleTemplates,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
ObjectMeta ObjectMeta `json:"objectMeta,omitempty"`
|
||||
Rules []PolicyRule `json:"rules,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
ClusterRoleTemplateIds []string `json:"clusterRoleTemplateIds,omitempty"`
|
||||
Created string `json:"created,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"`
|
||||
Removed string `json:"removed,omitempty"`
|
||||
ResourcePath string `json:"resourcePath,omitempty"`
|
||||
Rules []PolicyRule `json:"rules,omitempty"`
|
||||
Uuid string `json:"uuid,omitempty"`
|
||||
}
|
||||
type ClusterRoleTemplateCollection struct {
|
||||
types.Collection
|
||||
|
@ -5,23 +5,33 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
ClusterRoleTemplateBindingType = "clusterRoleTemplateBinding"
|
||||
ClusterRoleTemplateBindingFieldAPIVersion = "apiVersion"
|
||||
ClusterRoleTemplateBindingFieldClusterName = "clusterName"
|
||||
ClusterRoleTemplateBindingFieldClusterRoleTemplateName = "clusterRoleTemplateName"
|
||||
ClusterRoleTemplateBindingFieldKind = "kind"
|
||||
ClusterRoleTemplateBindingFieldObjectMeta = "objectMeta"
|
||||
ClusterRoleTemplateBindingFieldSubject = "subject"
|
||||
ClusterRoleTemplateBindingType = "clusterRoleTemplateBinding"
|
||||
ClusterRoleTemplateBindingFieldAnnotations = "annotations"
|
||||
ClusterRoleTemplateBindingFieldClusterId = "clusterId"
|
||||
ClusterRoleTemplateBindingFieldClusterRoleTemplateId = "clusterRoleTemplateId"
|
||||
ClusterRoleTemplateBindingFieldCreated = "created"
|
||||
ClusterRoleTemplateBindingFieldLabels = "labels"
|
||||
ClusterRoleTemplateBindingFieldName = "name"
|
||||
ClusterRoleTemplateBindingFieldOwnerReferences = "ownerReferences"
|
||||
ClusterRoleTemplateBindingFieldRemoved = "removed"
|
||||
ClusterRoleTemplateBindingFieldResourcePath = "resourcePath"
|
||||
ClusterRoleTemplateBindingFieldSubject = "subject"
|
||||
ClusterRoleTemplateBindingFieldUuid = "uuid"
|
||||
)
|
||||
|
||||
type ClusterRoleTemplateBinding struct {
|
||||
types.Resource
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
ClusterName string `json:"clusterName,omitempty"`
|
||||
ClusterRoleTemplateName string `json:"clusterRoleTemplateName,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
ObjectMeta ObjectMeta `json:"objectMeta,omitempty"`
|
||||
Subject Subject `json:"subject,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
ClusterId string `json:"clusterId,omitempty"`
|
||||
ClusterRoleTemplateId string `json:"clusterRoleTemplateId,omitempty"`
|
||||
Created string `json:"created,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"`
|
||||
Removed string `json:"removed,omitempty"`
|
||||
ResourcePath string `json:"resourcePath,omitempty"`
|
||||
Subject *Subject `json:"subject,omitempty"`
|
||||
Uuid string `json:"uuid,omitempty"`
|
||||
}
|
||||
type ClusterRoleTemplateBindingCollection struct {
|
||||
types.Collection
|
||||
|
@ -7,6 +7,6 @@ const (
|
||||
)
|
||||
|
||||
type HostPortRange struct {
|
||||
Max int64 `json:"max,omitempty"`
|
||||
Min int64 `json:"min,omitempty"`
|
||||
Max *int64 `json:"max,omitempty"`
|
||||
Min *int64 `json:"min,omitempty"`
|
||||
}
|
||||
|
@ -7,6 +7,6 @@ const (
|
||||
)
|
||||
|
||||
type IDRange struct {
|
||||
Max int64 `json:"max,omitempty"`
|
||||
Min int64 `json:"min,omitempty"`
|
||||
Max *int64 `json:"max,omitempty"`
|
||||
Min *int64 `json:"min,omitempty"`
|
||||
}
|
||||
|
@ -1,40 +1,26 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
ObjectMetaType = "objectMeta"
|
||||
ObjectMetaFieldAnnotations = "annotations"
|
||||
ObjectMetaFieldClusterName = "clusterName"
|
||||
ObjectMetaFieldCreationTimestamp = "creationTimestamp"
|
||||
ObjectMetaFieldDeletionGracePeriodSeconds = "deletionGracePeriodSeconds"
|
||||
ObjectMetaFieldDeletionTimestamp = "deletionTimestamp"
|
||||
ObjectMetaFieldFinalizers = "finalizers"
|
||||
ObjectMetaFieldGenerateName = "generateName"
|
||||
ObjectMetaFieldGeneration = "generation"
|
||||
ObjectMetaFieldInitializers = "initializers"
|
||||
ObjectMetaFieldLabels = "labels"
|
||||
ObjectMetaFieldName = "name"
|
||||
ObjectMetaFieldNamespace = "namespace"
|
||||
ObjectMetaFieldOwnerReferences = "ownerReferences"
|
||||
ObjectMetaFieldResourceVersion = "resourceVersion"
|
||||
ObjectMetaFieldSelfLink = "selfLink"
|
||||
ObjectMetaFieldUID = "uid"
|
||||
ObjectMetaType = "objectMeta"
|
||||
ObjectMetaFieldAnnotations = "annotations"
|
||||
ObjectMetaFieldCreated = "created"
|
||||
ObjectMetaFieldLabels = "labels"
|
||||
ObjectMetaFieldName = "name"
|
||||
ObjectMetaFieldNamespace = "namespace"
|
||||
ObjectMetaFieldOwnerReferences = "ownerReferences"
|
||||
ObjectMetaFieldRemoved = "removed"
|
||||
ObjectMetaFieldResourcePath = "resourcePath"
|
||||
ObjectMetaFieldUuid = "uuid"
|
||||
)
|
||||
|
||||
type ObjectMeta struct {
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
ClusterName string `json:"clusterName,omitempty"`
|
||||
CreationTimestamp string `json:"creationTimestamp,omitempty"`
|
||||
DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty"`
|
||||
DeletionTimestamp string `json:"deletionTimestamp,omitempty"`
|
||||
Finalizers []string `json:"finalizers,omitempty"`
|
||||
GenerateName string `json:"generateName,omitempty"`
|
||||
Generation int64 `json:"generation,omitempty"`
|
||||
Initializers *Initializers `json:"initializers,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"`
|
||||
ResourceVersion string `json:"resourceVersion,omitempty"`
|
||||
SelfLink string `json:"selfLink,omitempty"`
|
||||
UID string `json:"uid,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
Created string `json:"created,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"`
|
||||
Removed string `json:"removed,omitempty"`
|
||||
ResourcePath string `json:"resourcePath,omitempty"`
|
||||
Uuid string `json:"uuid,omitempty"`
|
||||
}
|
||||
|
@ -22,21 +22,21 @@ const (
|
||||
)
|
||||
|
||||
type PodSecurityPolicySpec struct {
|
||||
AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty"`
|
||||
AllowedCapabilities []string `json:"allowedCapabilities,omitempty"`
|
||||
AllowedHostPaths []AllowedHostPath `json:"allowedHostPaths,omitempty"`
|
||||
DefaultAddCapabilities []string `json:"defaultAddCapabilities,omitempty"`
|
||||
DefaultAllowPrivilegeEscalation *bool `json:"defaultAllowPrivilegeEscalation,omitempty"`
|
||||
FSGroup FSGroupStrategyOptions `json:"fsGroup,omitempty"`
|
||||
HostIPC bool `json:"hostIPC,omitempty"`
|
||||
HostNetwork bool `json:"hostNetwork,omitempty"`
|
||||
HostPID bool `json:"hostPID,omitempty"`
|
||||
HostPorts []HostPortRange `json:"hostPorts,omitempty"`
|
||||
Privileged bool `json:"privileged,omitempty"`
|
||||
ReadOnlyRootFilesystem bool `json:"readOnlyRootFilesystem,omitempty"`
|
||||
RequiredDropCapabilities []string `json:"requiredDropCapabilities,omitempty"`
|
||||
RunAsUser RunAsUserStrategyOptions `json:"runAsUser,omitempty"`
|
||||
SELinux SELinuxStrategyOptions `json:"seLinux,omitempty"`
|
||||
SupplementalGroups SupplementalGroupsStrategyOptions `json:"supplementalGroups,omitempty"`
|
||||
Volumes []string `json:"volumes,omitempty"`
|
||||
AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty"`
|
||||
AllowedCapabilities []string `json:"allowedCapabilities,omitempty"`
|
||||
AllowedHostPaths []AllowedHostPath `json:"allowedHostPaths,omitempty"`
|
||||
DefaultAddCapabilities []string `json:"defaultAddCapabilities,omitempty"`
|
||||
DefaultAllowPrivilegeEscalation *bool `json:"defaultAllowPrivilegeEscalation,omitempty"`
|
||||
FSGroup *FSGroupStrategyOptions `json:"fsGroup,omitempty"`
|
||||
HostIPC *bool `json:"hostIPC,omitempty"`
|
||||
HostNetwork *bool `json:"hostNetwork,omitempty"`
|
||||
HostPID *bool `json:"hostPID,omitempty"`
|
||||
HostPorts []HostPortRange `json:"hostPorts,omitempty"`
|
||||
Privileged *bool `json:"privileged,omitempty"`
|
||||
ReadOnlyRootFilesystem *bool `json:"readOnlyRootFilesystem,omitempty"`
|
||||
RequiredDropCapabilities []string `json:"requiredDropCapabilities,omitempty"`
|
||||
RunAsUser *RunAsUserStrategyOptions `json:"runAsUser,omitempty"`
|
||||
SELinux *SELinuxStrategyOptions `json:"seLinux,omitempty"`
|
||||
SupplementalGroups *SupplementalGroupsStrategyOptions `json:"supplementalGroups,omitempty"`
|
||||
Volumes []string `json:"volumes,omitempty"`
|
||||
}
|
||||
|
@ -5,19 +5,61 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
PodSecurityPolicyTemplateType = "podSecurityPolicyTemplate"
|
||||
PodSecurityPolicyTemplateFieldAPIVersion = "apiVersion"
|
||||
PodSecurityPolicyTemplateFieldKind = "kind"
|
||||
PodSecurityPolicyTemplateFieldObjectMeta = "objectMeta"
|
||||
PodSecurityPolicyTemplateFieldSpec = "spec"
|
||||
PodSecurityPolicyTemplateType = "podSecurityPolicyTemplate"
|
||||
PodSecurityPolicyTemplateFieldAllowPrivilegeEscalation = "allowPrivilegeEscalation"
|
||||
PodSecurityPolicyTemplateFieldAllowedCapabilities = "allowedCapabilities"
|
||||
PodSecurityPolicyTemplateFieldAllowedHostPaths = "allowedHostPaths"
|
||||
PodSecurityPolicyTemplateFieldAnnotations = "annotations"
|
||||
PodSecurityPolicyTemplateFieldCreated = "created"
|
||||
PodSecurityPolicyTemplateFieldDefaultAddCapabilities = "defaultAddCapabilities"
|
||||
PodSecurityPolicyTemplateFieldDefaultAllowPrivilegeEscalation = "defaultAllowPrivilegeEscalation"
|
||||
PodSecurityPolicyTemplateFieldFSGroup = "fsGroup"
|
||||
PodSecurityPolicyTemplateFieldHostIPC = "hostIPC"
|
||||
PodSecurityPolicyTemplateFieldHostNetwork = "hostNetwork"
|
||||
PodSecurityPolicyTemplateFieldHostPID = "hostPID"
|
||||
PodSecurityPolicyTemplateFieldHostPorts = "hostPorts"
|
||||
PodSecurityPolicyTemplateFieldLabels = "labels"
|
||||
PodSecurityPolicyTemplateFieldName = "name"
|
||||
PodSecurityPolicyTemplateFieldOwnerReferences = "ownerReferences"
|
||||
PodSecurityPolicyTemplateFieldPrivileged = "privileged"
|
||||
PodSecurityPolicyTemplateFieldReadOnlyRootFilesystem = "readOnlyRootFilesystem"
|
||||
PodSecurityPolicyTemplateFieldRemoved = "removed"
|
||||
PodSecurityPolicyTemplateFieldRequiredDropCapabilities = "requiredDropCapabilities"
|
||||
PodSecurityPolicyTemplateFieldResourcePath = "resourcePath"
|
||||
PodSecurityPolicyTemplateFieldRunAsUser = "runAsUser"
|
||||
PodSecurityPolicyTemplateFieldSELinux = "seLinux"
|
||||
PodSecurityPolicyTemplateFieldSupplementalGroups = "supplementalGroups"
|
||||
PodSecurityPolicyTemplateFieldUuid = "uuid"
|
||||
PodSecurityPolicyTemplateFieldVolumes = "volumes"
|
||||
)
|
||||
|
||||
type PodSecurityPolicyTemplate struct {
|
||||
types.Resource
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
ObjectMeta ObjectMeta `json:"objectMeta,omitempty"`
|
||||
Spec PodSecurityPolicySpec `json:"spec,omitempty"`
|
||||
AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty"`
|
||||
AllowedCapabilities []string `json:"allowedCapabilities,omitempty"`
|
||||
AllowedHostPaths []AllowedHostPath `json:"allowedHostPaths,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
Created string `json:"created,omitempty"`
|
||||
DefaultAddCapabilities []string `json:"defaultAddCapabilities,omitempty"`
|
||||
DefaultAllowPrivilegeEscalation *bool `json:"defaultAllowPrivilegeEscalation,omitempty"`
|
||||
FSGroup *FSGroupStrategyOptions `json:"fsGroup,omitempty"`
|
||||
HostIPC *bool `json:"hostIPC,omitempty"`
|
||||
HostNetwork *bool `json:"hostNetwork,omitempty"`
|
||||
HostPID *bool `json:"hostPID,omitempty"`
|
||||
HostPorts []HostPortRange `json:"hostPorts,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"`
|
||||
Privileged *bool `json:"privileged,omitempty"`
|
||||
ReadOnlyRootFilesystem *bool `json:"readOnlyRootFilesystem,omitempty"`
|
||||
Removed string `json:"removed,omitempty"`
|
||||
RequiredDropCapabilities []string `json:"requiredDropCapabilities,omitempty"`
|
||||
ResourcePath string `json:"resourcePath,omitempty"`
|
||||
RunAsUser *RunAsUserStrategyOptions `json:"runAsUser,omitempty"`
|
||||
SELinux *SELinuxStrategyOptions `json:"seLinux,omitempty"`
|
||||
SupplementalGroups *SupplementalGroupsStrategyOptions `json:"supplementalGroups,omitempty"`
|
||||
Uuid string `json:"uuid,omitempty"`
|
||||
Volumes []string `json:"volumes,omitempty"`
|
||||
}
|
||||
type PodSecurityPolicyTemplateCollection struct {
|
||||
types.Collection
|
||||
|
@ -5,19 +5,31 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
ProjectType = "project"
|
||||
ProjectFieldAPIVersion = "apiVersion"
|
||||
ProjectFieldKind = "kind"
|
||||
ProjectFieldObjectMeta = "objectMeta"
|
||||
ProjectFieldSpec = "spec"
|
||||
ProjectType = "project"
|
||||
ProjectFieldAnnotations = "annotations"
|
||||
ProjectFieldClusterId = "clusterId"
|
||||
ProjectFieldCreated = "created"
|
||||
ProjectFieldId = "id"
|
||||
ProjectFieldLabels = "labels"
|
||||
ProjectFieldName = "name"
|
||||
ProjectFieldOwnerReferences = "ownerReferences"
|
||||
ProjectFieldRemoved = "removed"
|
||||
ProjectFieldResourcePath = "resourcePath"
|
||||
ProjectFieldUuid = "uuid"
|
||||
)
|
||||
|
||||
type Project struct {
|
||||
types.Resource
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
ObjectMeta ObjectMeta `json:"objectMeta,omitempty"`
|
||||
Spec ProjectSpec `json:"spec,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
ClusterId string `json:"clusterId,omitempty"`
|
||||
Created string `json:"created,omitempty"`
|
||||
Id string `json:"id,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"`
|
||||
Removed string `json:"removed,omitempty"`
|
||||
ResourcePath string `json:"resourcePath,omitempty"`
|
||||
Uuid string `json:"uuid,omitempty"`
|
||||
}
|
||||
type ProjectCollection struct {
|
||||
types.Collection
|
||||
|
@ -5,21 +5,31 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
ProjectRoleTemplateType = "projectRoleTemplate"
|
||||
ProjectRoleTemplateFieldAPIVersion = "apiVersion"
|
||||
ProjectRoleTemplateFieldKind = "kind"
|
||||
ProjectRoleTemplateFieldObjectMeta = "objectMeta"
|
||||
ProjectRoleTemplateFieldProjectRoleTemplates = "projectRoleTemplates"
|
||||
ProjectRoleTemplateFieldRules = "rules"
|
||||
ProjectRoleTemplateType = "projectRoleTemplate"
|
||||
ProjectRoleTemplateFieldAnnotations = "annotations"
|
||||
ProjectRoleTemplateFieldCreated = "created"
|
||||
ProjectRoleTemplateFieldLabels = "labels"
|
||||
ProjectRoleTemplateFieldName = "name"
|
||||
ProjectRoleTemplateFieldOwnerReferences = "ownerReferences"
|
||||
ProjectRoleTemplateFieldProjectRoleTemplateIds = "projectRoleTemplateIds"
|
||||
ProjectRoleTemplateFieldRemoved = "removed"
|
||||
ProjectRoleTemplateFieldResourcePath = "resourcePath"
|
||||
ProjectRoleTemplateFieldRules = "rules"
|
||||
ProjectRoleTemplateFieldUuid = "uuid"
|
||||
)
|
||||
|
||||
type ProjectRoleTemplate struct {
|
||||
types.Resource
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
ObjectMeta ObjectMeta `json:"objectMeta,omitempty"`
|
||||
ProjectRoleTemplates []string `json:"projectRoleTemplates,omitempty"`
|
||||
Rules []PolicyRule `json:"rules,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
Created string `json:"created,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"`
|
||||
ProjectRoleTemplateIds []string `json:"projectRoleTemplateIds,omitempty"`
|
||||
Removed string `json:"removed,omitempty"`
|
||||
ResourcePath string `json:"resourcePath,omitempty"`
|
||||
Rules []PolicyRule `json:"rules,omitempty"`
|
||||
Uuid string `json:"uuid,omitempty"`
|
||||
}
|
||||
type ProjectRoleTemplateCollection struct {
|
||||
types.Collection
|
||||
|
@ -5,23 +5,37 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
ProjectRoleTemplateBindingType = "projectRoleTemplateBinding"
|
||||
ProjectRoleTemplateBindingFieldAPIVersion = "apiVersion"
|
||||
ProjectRoleTemplateBindingFieldKind = "kind"
|
||||
ProjectRoleTemplateBindingFieldObjectMeta = "objectMeta"
|
||||
ProjectRoleTemplateBindingFieldProjectName = "projectName"
|
||||
ProjectRoleTemplateBindingFieldProjectRoleTemplateName = "projectRoleTemplateName"
|
||||
ProjectRoleTemplateBindingFieldSubject = "subject"
|
||||
ProjectRoleTemplateBindingType = "projectRoleTemplateBinding"
|
||||
ProjectRoleTemplateBindingFieldAnnotations = "annotations"
|
||||
ProjectRoleTemplateBindingFieldCreated = "created"
|
||||
ProjectRoleTemplateBindingFieldLabels = "labels"
|
||||
ProjectRoleTemplateBindingFieldName = "name"
|
||||
ProjectRoleTemplateBindingFieldOwnerReferences = "ownerReferences"
|
||||
ProjectRoleTemplateBindingFieldProjectId = "projectId"
|
||||
ProjectRoleTemplateBindingFieldProjectRoleTemplateId = "projectRoleTemplateId"
|
||||
ProjectRoleTemplateBindingFieldRemoved = "removed"
|
||||
ProjectRoleTemplateBindingFieldResourcePath = "resourcePath"
|
||||
ProjectRoleTemplateBindingFieldSubjectKind = "subjectKind"
|
||||
ProjectRoleTemplateBindingFieldSubjectName = "subjectName"
|
||||
ProjectRoleTemplateBindingFieldSubjectNamespace = "subjectNamespace"
|
||||
ProjectRoleTemplateBindingFieldUuid = "uuid"
|
||||
)
|
||||
|
||||
type ProjectRoleTemplateBinding struct {
|
||||
types.Resource
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
ObjectMeta ObjectMeta `json:"objectMeta,omitempty"`
|
||||
ProjectName string `json:"projectName,omitempty"`
|
||||
ProjectRoleTemplateName string `json:"projectRoleTemplateName,omitempty"`
|
||||
Subject Subject `json:"subject,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
Created string `json:"created,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"`
|
||||
ProjectId string `json:"projectId,omitempty"`
|
||||
ProjectRoleTemplateId string `json:"projectRoleTemplateId,omitempty"`
|
||||
Removed string `json:"removed,omitempty"`
|
||||
ResourcePath string `json:"resourcePath,omitempty"`
|
||||
SubjectKind string `json:"subjectKind,omitempty"`
|
||||
SubjectName string `json:"subjectName,omitempty"`
|
||||
SubjectNamespace string `json:"subjectNamespace,omitempty"`
|
||||
Uuid string `json:"uuid,omitempty"`
|
||||
}
|
||||
type ProjectRoleTemplateBindingCollection struct {
|
||||
types.Collection
|
||||
|
@ -2,11 +2,11 @@ package client
|
||||
|
||||
const (
|
||||
ProjectSpecType = "projectSpec"
|
||||
ProjectSpecFieldClusterName = "clusterName"
|
||||
ProjectSpecFieldClusterId = "clusterId"
|
||||
ProjectSpecFieldDisplayName = "displayName"
|
||||
)
|
||||
|
||||
type ProjectSpec struct {
|
||||
ClusterName string `json:"clusterName,omitempty"`
|
||||
ClusterId string `json:"clusterId,omitempty"`
|
||||
DisplayName string `json:"displayName,omitempty"`
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ const (
|
||||
StatusFieldCode = "code"
|
||||
StatusFieldDetails = "details"
|
||||
StatusFieldKind = "kind"
|
||||
StatusFieldListMeta = "listMeta"
|
||||
StatusFieldListMeta = "metadata"
|
||||
StatusFieldMessage = "message"
|
||||
StatusFieldReason = "reason"
|
||||
StatusFieldStatus = "status"
|
||||
@ -14,10 +14,10 @@ const (
|
||||
|
||||
type Status struct {
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
Code int64 `json:"code,omitempty"`
|
||||
Code *int64 `json:"code,omitempty"`
|
||||
Details *StatusDetails `json:"details,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
ListMeta ListMeta `json:"listMeta,omitempty"`
|
||||
ListMeta *ListMeta `json:"metadata,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Reason string `json:"reason,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
|
@ -4,11 +4,11 @@ const (
|
||||
StatusCauseType = "statusCause"
|
||||
StatusCauseFieldField = "field"
|
||||
StatusCauseFieldMessage = "message"
|
||||
StatusCauseFieldType = "type"
|
||||
StatusCauseFieldType = "reason"
|
||||
)
|
||||
|
||||
type StatusCause struct {
|
||||
Field string `json:"field,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
Type string `json:"reason,omitempty"`
|
||||
}
|
||||
|
@ -15,6 +15,6 @@ type StatusDetails struct {
|
||||
Group string `json:"group,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
RetryAfterSeconds int64 `json:"retryAfterSeconds,omitempty"`
|
||||
RetryAfterSeconds *int64 `json:"retryAfterSeconds,omitempty"`
|
||||
UID string `json:"uid,omitempty"`
|
||||
}
|
||||
|
@ -6,36 +6,34 @@ import (
|
||||
|
||||
const (
|
||||
ClusterType = "cluster"
|
||||
ClusterFieldAPIVersion = "apiVersion"
|
||||
ClusterFieldAnnotations = "annotations"
|
||||
ClusterFieldAzureKubernetesServiceConfig = "azureKubernetesServiceConfig"
|
||||
ClusterFieldCreationTimestamp = "creationTimestamp"
|
||||
ClusterFieldDeletionTimestamp = "deletionTimestamp"
|
||||
ClusterFieldCreated = "created"
|
||||
ClusterFieldGoogleKubernetesEngineConfig = "googleKubernetesEngineConfig"
|
||||
ClusterFieldKind = "kind"
|
||||
ClusterFieldLabels = "labels"
|
||||
ClusterFieldName = "name"
|
||||
ClusterFieldNamespace = "namespace"
|
||||
ClusterFieldOwnerReferences = "ownerReferences"
|
||||
ClusterFieldRancherKubernetesEngineConfig = "rancherKubernetesEngineConfig"
|
||||
ClusterFieldRemoved = "removed"
|
||||
ClusterFieldResourcePath = "resourcePath"
|
||||
ClusterFieldStatus = "status"
|
||||
ClusterFieldUID = "uid"
|
||||
ClusterFieldUuid = "uuid"
|
||||
)
|
||||
|
||||
type Cluster struct {
|
||||
types.Resource
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
AzureKubernetesServiceConfig *AzureKubernetesServiceConfig `json:"azureKubernetesServiceConfig,omitempty"`
|
||||
CreationTimestamp string `json:"creationTimestamp,omitempty"`
|
||||
DeletionTimestamp string `json:"deletionTimestamp,omitempty"`
|
||||
Created string `json:"created,omitempty"`
|
||||
GoogleKubernetesEngineConfig *GoogleKubernetesEngineConfig `json:"googleKubernetesEngineConfig,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"`
|
||||
RancherKubernetesEngineConfig *RancherKubernetesEngineConfig `json:"rancherKubernetesEngineConfig,omitempty"`
|
||||
Status ClusterStatus `json:"status,omitempty"`
|
||||
UID string `json:"uid,omitempty"`
|
||||
Removed string `json:"removed,omitempty"`
|
||||
ResourcePath string `json:"resourcePath,omitempty"`
|
||||
Status *ClusterStatus `json:"status,omitempty"`
|
||||
Uuid string `json:"uuid,omitempty"`
|
||||
}
|
||||
type ClusterCollection struct {
|
||||
types.Collection
|
||||
|
@ -5,43 +5,41 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
ClusterNodeType = "clusterNode"
|
||||
ClusterNodeFieldAPIVersion = "apiVersion"
|
||||
ClusterNodeFieldAnnotations = "annotations"
|
||||
ClusterNodeFieldConfigSource = "configSource"
|
||||
ClusterNodeFieldCreationTimestamp = "creationTimestamp"
|
||||
ClusterNodeFieldDeletionTimestamp = "deletionTimestamp"
|
||||
ClusterNodeFieldExternalID = "externalID"
|
||||
ClusterNodeFieldKind = "kind"
|
||||
ClusterNodeFieldLabels = "labels"
|
||||
ClusterNodeFieldName = "name"
|
||||
ClusterNodeFieldNamespace = "namespace"
|
||||
ClusterNodeFieldPodCIDR = "podCIDR"
|
||||
ClusterNodeFieldProviderID = "providerID"
|
||||
ClusterNodeFieldStatus = "status"
|
||||
ClusterNodeFieldTaints = "taints"
|
||||
ClusterNodeFieldUID = "uid"
|
||||
ClusterNodeFieldUnschedulable = "unschedulable"
|
||||
ClusterNodeType = "clusterNode"
|
||||
ClusterNodeFieldAnnotations = "annotations"
|
||||
ClusterNodeFieldConfigSource = "configSource"
|
||||
ClusterNodeFieldCreated = "created"
|
||||
ClusterNodeFieldExternalID = "externalID"
|
||||
ClusterNodeFieldLabels = "labels"
|
||||
ClusterNodeFieldName = "name"
|
||||
ClusterNodeFieldOwnerReferences = "ownerReferences"
|
||||
ClusterNodeFieldPodCIDR = "podCIDR"
|
||||
ClusterNodeFieldProviderID = "providerID"
|
||||
ClusterNodeFieldRemoved = "removed"
|
||||
ClusterNodeFieldResourcePath = "resourcePath"
|
||||
ClusterNodeFieldStatus = "status"
|
||||
ClusterNodeFieldTaints = "taints"
|
||||
ClusterNodeFieldUnschedulable = "unschedulable"
|
||||
ClusterNodeFieldUuid = "uuid"
|
||||
)
|
||||
|
||||
type ClusterNode struct {
|
||||
types.Resource
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
ConfigSource *NodeConfigSource `json:"configSource,omitempty"`
|
||||
CreationTimestamp string `json:"creationTimestamp,omitempty"`
|
||||
DeletionTimestamp string `json:"deletionTimestamp,omitempty"`
|
||||
ExternalID string `json:"externalID,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
PodCIDR string `json:"podCIDR,omitempty"`
|
||||
ProviderID string `json:"providerID,omitempty"`
|
||||
Status NodeStatus `json:"status,omitempty"`
|
||||
Taints []Taint `json:"taints,omitempty"`
|
||||
UID string `json:"uid,omitempty"`
|
||||
Unschedulable bool `json:"unschedulable,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
ConfigSource *NodeConfigSource `json:"configSource,omitempty"`
|
||||
Created string `json:"created,omitempty"`
|
||||
ExternalID string `json:"externalID,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"`
|
||||
PodCIDR string `json:"podCIDR,omitempty"`
|
||||
ProviderID string `json:"providerID,omitempty"`
|
||||
Removed string `json:"removed,omitempty"`
|
||||
ResourcePath string `json:"resourcePath,omitempty"`
|
||||
Status *NodeStatus `json:"status,omitempty"`
|
||||
Taints []Taint `json:"taints,omitempty"`
|
||||
Unschedulable *bool `json:"unschedulable,omitempty"`
|
||||
Uuid string `json:"uuid,omitempty"`
|
||||
}
|
||||
type ClusterNodeCollection struct {
|
||||
types.Collection
|
||||
|
@ -15,7 +15,7 @@ const (
|
||||
type ClusterStatus struct {
|
||||
APIEndpoint string `json:"apiEndpoint,omitempty"`
|
||||
Allocatable map[string]string `json:"allocatable,omitempty"`
|
||||
AppliedSpec ClusterSpec `json:"appliedSpec,omitempty"`
|
||||
AppliedSpec *ClusterSpec `json:"appliedSpec,omitempty"`
|
||||
CACert string `json:"caCert,omitempty"`
|
||||
Capacity map[string]string `json:"capacity,omitempty"`
|
||||
ComponentStatuses []ClusterComponentStatus `json:"componentStatuses,omitempty"`
|
||||
|
@ -8,5 +8,5 @@ const (
|
||||
|
||||
type ContainerImage struct {
|
||||
Names []string `json:"names,omitempty"`
|
||||
SizeBytes int64 `json:"sizeBytes,omitempty"`
|
||||
SizeBytes *int64 `json:"sizeBytes,omitempty"`
|
||||
}
|
||||
|
@ -2,9 +2,9 @@ package client
|
||||
|
||||
const (
|
||||
DaemonEndpointType = "daemonEndpoint"
|
||||
DaemonEndpointFieldPort = "port"
|
||||
DaemonEndpointFieldPort = "Port"
|
||||
)
|
||||
|
||||
type DaemonEndpoint struct {
|
||||
Port int64 `json:"port,omitempty"`
|
||||
Port *int64 `json:"Port,omitempty"`
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ const (
|
||||
GoogleKubernetesEngineConfigFieldMasterVersion = "masterVersion"
|
||||
GoogleKubernetesEngineConfigFieldNodeCount = "nodeCount"
|
||||
GoogleKubernetesEngineConfigFieldNodeVersion = "nodeVersion"
|
||||
GoogleKubernetesEngineConfigFieldProjectID = "projectID"
|
||||
GoogleKubernetesEngineConfigFieldProjectID = "projectId"
|
||||
GoogleKubernetesEngineConfigFieldZone = "zone"
|
||||
)
|
||||
|
||||
@ -20,13 +20,13 @@ type GoogleKubernetesEngineConfig struct {
|
||||
ClusterIpv4Cidr string `json:"clusterIpv4Cidr,omitempty"`
|
||||
CredentialPath string `json:"credentialPath,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
DiskSizeGb int64 `json:"diskSizeGb,omitempty"`
|
||||
EnableAlphaFeature bool `json:"enableAlphaFeature,omitempty"`
|
||||
DiskSizeGb *int64 `json:"diskSizeGb,omitempty"`
|
||||
EnableAlphaFeature *bool `json:"enableAlphaFeature,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
MachineType string `json:"machineType,omitempty"`
|
||||
MasterVersion string `json:"masterVersion,omitempty"`
|
||||
NodeCount int64 `json:"nodeCount,omitempty"`
|
||||
NodeCount *int64 `json:"nodeCount,omitempty"`
|
||||
NodeVersion string `json:"nodeVersion,omitempty"`
|
||||
ProjectID string `json:"projectID,omitempty"`
|
||||
ProjectID string `json:"projectId,omitempty"`
|
||||
Zone string `json:"zone,omitempty"`
|
||||
}
|
||||
|
@ -4,11 +4,11 @@ const (
|
||||
KubeAPIServiceType = "kubeAPIService"
|
||||
KubeAPIServiceFieldExtraArgs = "extraArgs"
|
||||
KubeAPIServiceFieldImage = "image"
|
||||
KubeAPIServiceFieldServiceClusterIPRange = "serviceClusterIPRange"
|
||||
KubeAPIServiceFieldServiceClusterIPRange = "serviceClusterIpRange"
|
||||
)
|
||||
|
||||
type KubeAPIService struct {
|
||||
ExtraArgs map[string]string `json:"extraArgs,omitempty"`
|
||||
Image string `json:"image,omitempty"`
|
||||
ServiceClusterIPRange string `json:"serviceClusterIPRange,omitempty"`
|
||||
ServiceClusterIPRange string `json:"serviceClusterIpRange,omitempty"`
|
||||
}
|
||||
|
@ -2,15 +2,15 @@ package client
|
||||
|
||||
const (
|
||||
KubeControllerServiceType = "kubeControllerService"
|
||||
KubeControllerServiceFieldClusterCIDR = "clusterCIDR"
|
||||
KubeControllerServiceFieldClusterCIDR = "clusterCidr"
|
||||
KubeControllerServiceFieldExtraArgs = "extraArgs"
|
||||
KubeControllerServiceFieldImage = "image"
|
||||
KubeControllerServiceFieldServiceClusterIPRange = "serviceClusterIPRange"
|
||||
KubeControllerServiceFieldServiceClusterIPRange = "serviceClusterIpRange"
|
||||
)
|
||||
|
||||
type KubeControllerService struct {
|
||||
ClusterCIDR string `json:"clusterCIDR,omitempty"`
|
||||
ClusterCIDR string `json:"clusterCidr,omitempty"`
|
||||
ExtraArgs map[string]string `json:"extraArgs,omitempty"`
|
||||
Image string `json:"image,omitempty"`
|
||||
ServiceClusterIPRange string `json:"serviceClusterIPRange,omitempty"`
|
||||
ServiceClusterIPRange string `json:"serviceClusterIpRange,omitempty"`
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package client
|
||||
|
||||
const (
|
||||
KubeletServiceType = "kubeletService"
|
||||
KubeletServiceFieldClusterDNSServer = "clusterDNSServer"
|
||||
KubeletServiceFieldClusterDNSServer = "clusterDnsServer"
|
||||
KubeletServiceFieldClusterDomain = "clusterDomain"
|
||||
KubeletServiceFieldExtraArgs = "extraArgs"
|
||||
KubeletServiceFieldImage = "image"
|
||||
@ -10,7 +10,7 @@ const (
|
||||
)
|
||||
|
||||
type KubeletService struct {
|
||||
ClusterDNSServer string `json:"clusterDNSServer,omitempty"`
|
||||
ClusterDNSServer string `json:"clusterDnsServer,omitempty"`
|
||||
ClusterDomain string `json:"clusterDomain,omitempty"`
|
||||
ExtraArgs map[string]string `json:"extraArgs,omitempty"`
|
||||
Image string `json:"image,omitempty"`
|
||||
|
@ -6,5 +6,5 @@ const (
|
||||
)
|
||||
|
||||
type NodeDaemonEndpoints struct {
|
||||
KubeletEndpoint DaemonEndpoint `json:"kubeletEndpoint,omitempty"`
|
||||
KubeletEndpoint *DaemonEndpoint `json:"kubeletEndpoint,omitempty"`
|
||||
}
|
||||
|
@ -16,5 +16,5 @@ type NodeSpec struct {
|
||||
PodCIDR string `json:"podCIDR,omitempty"`
|
||||
ProviderID string `json:"providerID,omitempty"`
|
||||
Taints []Taint `json:"taints,omitempty"`
|
||||
Unschedulable bool `json:"unschedulable,omitempty"`
|
||||
Unschedulable *bool `json:"unschedulable,omitempty"`
|
||||
}
|
||||
|
@ -15,14 +15,14 @@ const (
|
||||
)
|
||||
|
||||
type NodeStatus struct {
|
||||
Addresses []NodeAddress `json:"addresses,omitempty"`
|
||||
Allocatable map[string]string `json:"allocatable,omitempty"`
|
||||
Capacity map[string]string `json:"capacity,omitempty"`
|
||||
Conditions []NodeCondition `json:"conditions,omitempty"`
|
||||
DaemonEndpoints NodeDaemonEndpoints `json:"daemonEndpoints,omitempty"`
|
||||
Images []ContainerImage `json:"images,omitempty"`
|
||||
NodeInfo NodeSystemInfo `json:"nodeInfo,omitempty"`
|
||||
Phase string `json:"phase,omitempty"`
|
||||
VolumesAttached []AttachedVolume `json:"volumesAttached,omitempty"`
|
||||
VolumesInUse []string `json:"volumesInUse,omitempty"`
|
||||
Addresses []NodeAddress `json:"addresses,omitempty"`
|
||||
Allocatable map[string]string `json:"allocatable,omitempty"`
|
||||
Capacity map[string]string `json:"capacity,omitempty"`
|
||||
Conditions []NodeCondition `json:"conditions,omitempty"`
|
||||
DaemonEndpoints *NodeDaemonEndpoints `json:"daemonEndpoints,omitempty"`
|
||||
Images []ContainerImage `json:"images,omitempty"`
|
||||
NodeInfo *NodeSystemInfo `json:"nodeInfo,omitempty"`
|
||||
Phase string `json:"phase,omitempty"`
|
||||
VolumesAttached []AttachedVolume `json:"volumesAttached,omitempty"`
|
||||
VolumesInUse []string `json:"volumesInUse,omitempty"`
|
||||
}
|
||||
|
@ -1,22 +1,26 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
ObjectMetaType = "objectMeta"
|
||||
ObjectMetaFieldAnnotations = "annotations"
|
||||
ObjectMetaFieldCreationTimestamp = "creationTimestamp"
|
||||
ObjectMetaFieldDeletionTimestamp = "deletionTimestamp"
|
||||
ObjectMetaFieldLabels = "labels"
|
||||
ObjectMetaFieldName = "name"
|
||||
ObjectMetaFieldNamespace = "namespace"
|
||||
ObjectMetaFieldUID = "uid"
|
||||
ObjectMetaType = "objectMeta"
|
||||
ObjectMetaFieldAnnotations = "annotations"
|
||||
ObjectMetaFieldCreated = "created"
|
||||
ObjectMetaFieldLabels = "labels"
|
||||
ObjectMetaFieldName = "name"
|
||||
ObjectMetaFieldNamespace = "namespace"
|
||||
ObjectMetaFieldOwnerReferences = "ownerReferences"
|
||||
ObjectMetaFieldRemoved = "removed"
|
||||
ObjectMetaFieldResourcePath = "resourcePath"
|
||||
ObjectMetaFieldUuid = "uuid"
|
||||
)
|
||||
|
||||
type ObjectMeta struct {
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
CreationTimestamp string `json:"creationTimestamp,omitempty"`
|
||||
DeletionTimestamp string `json:"deletionTimestamp,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
UID string `json:"uid,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
Created string `json:"created,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"`
|
||||
Removed string `json:"removed,omitempty"`
|
||||
ResourcePath string `json:"resourcePath,omitempty"`
|
||||
Uuid string `json:"uuid,omitempty"`
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ package client
|
||||
const (
|
||||
RancherKubernetesEngineConfigType = "rancherKubernetesEngineConfig"
|
||||
RancherKubernetesEngineConfigFieldAddons = "addons"
|
||||
RancherKubernetesEngineConfigFieldAuthentication = "authentication"
|
||||
RancherKubernetesEngineConfigFieldAuthentication = "auth"
|
||||
RancherKubernetesEngineConfigFieldHosts = "hosts"
|
||||
RancherKubernetesEngineConfigFieldNetwork = "network"
|
||||
RancherKubernetesEngineConfigFieldSSHKeyPath = "sshKeyPath"
|
||||
@ -11,10 +11,10 @@ const (
|
||||
)
|
||||
|
||||
type RancherKubernetesEngineConfig struct {
|
||||
Addons string `json:"addons,omitempty"`
|
||||
Authentication AuthConfig `json:"authentication,omitempty"`
|
||||
Hosts []RKEConfigHost `json:"hosts,omitempty"`
|
||||
Network NetworkConfig `json:"network,omitempty"`
|
||||
SSHKeyPath string `json:"sshKeyPath,omitempty"`
|
||||
Services RKEConfigServices `json:"services,omitempty"`
|
||||
Addons string `json:"addons,omitempty"`
|
||||
Authentication *AuthConfig `json:"auth,omitempty"`
|
||||
Hosts []RKEConfigHost `json:"hosts,omitempty"`
|
||||
Network *NetworkConfig `json:"network,omitempty"`
|
||||
SSHKeyPath string `json:"sshKeyPath,omitempty"`
|
||||
Services *RKEConfigServices `json:"services,omitempty"`
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ package client
|
||||
const (
|
||||
RKEConfigServicesType = "rkeConfigServices"
|
||||
RKEConfigServicesFieldEtcd = "etcd"
|
||||
RKEConfigServicesFieldKubeAPI = "kubeAPI"
|
||||
RKEConfigServicesFieldKubeAPI = "kubeApi"
|
||||
RKEConfigServicesFieldKubeController = "kubeController"
|
||||
RKEConfigServicesFieldKubelet = "kubelet"
|
||||
RKEConfigServicesFieldKubeproxy = "kubeproxy"
|
||||
@ -11,10 +11,10 @@ const (
|
||||
)
|
||||
|
||||
type RKEConfigServices struct {
|
||||
Etcd ETCDService `json:"etcd,omitempty"`
|
||||
KubeAPI KubeAPIService `json:"kubeAPI,omitempty"`
|
||||
KubeController KubeControllerService `json:"kubeController,omitempty"`
|
||||
Kubelet KubeletService `json:"kubelet,omitempty"`
|
||||
Kubeproxy KubeproxyService `json:"kubeproxy,omitempty"`
|
||||
Scheduler SchedulerService `json:"scheduler,omitempty"`
|
||||
Etcd *ETCDService `json:"etcd,omitempty"`
|
||||
KubeAPI *KubeAPIService `json:"kubeApi,omitempty"`
|
||||
KubeController *KubeControllerService `json:"kubeController,omitempty"`
|
||||
Kubelet *KubeletService `json:"kubelet,omitempty"`
|
||||
Kubeproxy *KubeproxyService `json:"kubeproxy,omitempty"`
|
||||
Scheduler *SchedulerService `json:"scheduler,omitempty"`
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ const (
|
||||
StatusFieldCode = "code"
|
||||
StatusFieldDetails = "details"
|
||||
StatusFieldKind = "kind"
|
||||
StatusFieldListMeta = "listMeta"
|
||||
StatusFieldListMeta = "metadata"
|
||||
StatusFieldMessage = "message"
|
||||
StatusFieldReason = "reason"
|
||||
StatusFieldStatus = "status"
|
||||
@ -14,10 +14,10 @@ const (
|
||||
|
||||
type Status struct {
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
Code int64 `json:"code,omitempty"`
|
||||
Code *int64 `json:"code,omitempty"`
|
||||
Details *StatusDetails `json:"details,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
ListMeta ListMeta `json:"listMeta,omitempty"`
|
||||
ListMeta *ListMeta `json:"metadata,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Reason string `json:"reason,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
|
@ -4,11 +4,11 @@ const (
|
||||
StatusCauseType = "statusCause"
|
||||
StatusCauseFieldField = "field"
|
||||
StatusCauseFieldMessage = "message"
|
||||
StatusCauseFieldType = "type"
|
||||
StatusCauseFieldType = "reason"
|
||||
)
|
||||
|
||||
type StatusCause struct {
|
||||
Field string `json:"field,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
Type string `json:"reason,omitempty"`
|
||||
}
|
||||
|
@ -15,6 +15,6 @@ type StatusDetails struct {
|
||||
Group string `json:"group,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
RetryAfterSeconds int64 `json:"retryAfterSeconds,omitempty"`
|
||||
RetryAfterSeconds *int64 `json:"retryAfterSeconds,omitempty"`
|
||||
UID string `json:"uid,omitempty"`
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ const (
|
||||
|
||||
type AWSElasticBlockStoreVolumeSource struct {
|
||||
FSType string `json:"fsType,omitempty"`
|
||||
Partition int64 `json:"partition,omitempty"`
|
||||
ReadOnly bool `json:"readOnly,omitempty"`
|
||||
Partition *int64 `json:"partition,omitempty"`
|
||||
ReadOnly *bool `json:"readOnly,omitempty"`
|
||||
VolumeID string `json:"volumeID,omitempty"`
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ package client
|
||||
const (
|
||||
AzureDiskVolumeSourceType = "azureDiskVolumeSource"
|
||||
AzureDiskVolumeSourceFieldCachingMode = "cachingMode"
|
||||
AzureDiskVolumeSourceFieldDataDiskURI = "dataDiskURI"
|
||||
AzureDiskVolumeSourceFieldDataDiskURI = "diskURI"
|
||||
AzureDiskVolumeSourceFieldDiskName = "diskName"
|
||||
AzureDiskVolumeSourceFieldFSType = "fsType"
|
||||
AzureDiskVolumeSourceFieldKind = "kind"
|
||||
@ -12,7 +12,7 @@ const (
|
||||
|
||||
type AzureDiskVolumeSource struct {
|
||||
CachingMode string `json:"cachingMode,omitempty"`
|
||||
DataDiskURI string `json:"dataDiskURI,omitempty"`
|
||||
DataDiskURI string `json:"diskURI,omitempty"`
|
||||
DiskName string `json:"diskName,omitempty"`
|
||||
FSType string `json:"fsType,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
|
@ -8,7 +8,7 @@ const (
|
||||
)
|
||||
|
||||
type AzureFileVolumeSource struct {
|
||||
ReadOnly bool `json:"readOnly,omitempty"`
|
||||
ReadOnly *bool `json:"readOnly,omitempty"`
|
||||
SecretName string `json:"secretName,omitempty"`
|
||||
ShareName string `json:"shareName,omitempty"`
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
CapabilitiesType = "capabilities"
|
||||
CapabilitiesFieldAdd = "add"
|
||||
CapabilitiesFieldDrop = "drop"
|
||||
CapabilitiesType = "capabilities"
|
||||
CapabilitiesFieldCapAdd = "capAdd"
|
||||
CapabilitiesFieldCapDrop = "capDrop"
|
||||
)
|
||||
|
||||
type Capabilities struct {
|
||||
Add []string `json:"add,omitempty"`
|
||||
Drop []string `json:"drop,omitempty"`
|
||||
CapAdd []string `json:"capAdd,omitempty"`
|
||||
CapDrop []string `json:"capDrop,omitempty"`
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ const (
|
||||
type CephFSVolumeSource struct {
|
||||
Monitors []string `json:"monitors,omitempty"`
|
||||
Path string `json:"path,omitempty"`
|
||||
ReadOnly bool `json:"readOnly,omitempty"`
|
||||
ReadOnly *bool `json:"readOnly,omitempty"`
|
||||
SecretFile string `json:"secretFile,omitempty"`
|
||||
SecretRef *LocalObjectReference `json:"secretRef,omitempty"`
|
||||
User string `json:"user,omitempty"`
|
||||
|
@ -9,6 +9,6 @@ const (
|
||||
|
||||
type CinderVolumeSource struct {
|
||||
FSType string `json:"fsType,omitempty"`
|
||||
ReadOnly bool `json:"readOnly,omitempty"`
|
||||
ReadOnly *bool `json:"readOnly,omitempty"`
|
||||
VolumeID string `json:"volumeID,omitempty"`
|
||||
}
|
||||
|
@ -10,10 +10,13 @@ type Client struct {
|
||||
Pod PodOperations
|
||||
Namespace NamespaceOperations
|
||||
Node NodeOperations
|
||||
ReplicaSet ReplicaSetOperations
|
||||
Deployment DeploymentOperations
|
||||
PersistentVolumeClaim PersistentVolumeClaimOperations
|
||||
StatefulSet StatefulSetOperations
|
||||
ReplicaSet ReplicaSetOperations
|
||||
ReplicationController ReplicationControllerOperations
|
||||
DaemonSet DaemonSetOperations
|
||||
Workload WorkloadOperations
|
||||
}
|
||||
|
||||
func NewClient(opts *clientbase.ClientOpts) (*Client, error) {
|
||||
@ -29,10 +32,13 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) {
|
||||
client.Pod = newPodClient(client)
|
||||
client.Namespace = newNamespaceClient(client)
|
||||
client.Node = newNodeClient(client)
|
||||
client.ReplicaSet = newReplicaSetClient(client)
|
||||
client.Deployment = newDeploymentClient(client)
|
||||
client.PersistentVolumeClaim = newPersistentVolumeClaimClient(client)
|
||||
client.StatefulSet = newStatefulSetClient(client)
|
||||
client.ReplicaSet = newReplicaSetClient(client)
|
||||
client.ReplicationController = newReplicationControllerClient(client)
|
||||
client.DaemonSet = newDaemonSetClient(client)
|
||||
client.Workload = newWorkloadClient(client)
|
||||
|
||||
return client, nil
|
||||
}
|
||||
|
@ -2,65 +2,65 @@ package client
|
||||
|
||||
const (
|
||||
ContainerType = "container"
|
||||
ContainerFieldAdd = "add"
|
||||
ContainerFieldAllowPrivilegeEscalation = "allowPrivilegeEscalation"
|
||||
ContainerFieldArgs = "args"
|
||||
ContainerFieldCapAdd = "capAdd"
|
||||
ContainerFieldCapDrop = "capDrop"
|
||||
ContainerFieldCommand = "command"
|
||||
ContainerFieldDrop = "drop"
|
||||
ContainerFieldEntrypoint = "entrypoint"
|
||||
ContainerFieldEnvironment = "environment"
|
||||
ContainerFieldEnvironmentFrom = "environmentFrom"
|
||||
ContainerFieldHealthcheck = "healthcheck"
|
||||
ContainerFieldImage = "image"
|
||||
ContainerFieldImagePullPolicy = "imagePullPolicy"
|
||||
ContainerFieldInitContainer = "initContainer"
|
||||
ContainerFieldLivenessProbe = "livenessProbe"
|
||||
ContainerFieldName = "name"
|
||||
ContainerFieldPorts = "ports"
|
||||
ContainerFieldPostStart = "postStart"
|
||||
ContainerFieldPreStop = "preStop"
|
||||
ContainerFieldPrivileged = "privileged"
|
||||
ContainerFieldReadOnlyRootFilesystem = "readOnlyRootFilesystem"
|
||||
ContainerFieldReadinessProbe = "readinessProbe"
|
||||
ContainerFieldPullPolicy = "pullPolicy"
|
||||
ContainerFieldReadOnly = "readOnly"
|
||||
ContainerFieldReadycheck = "readycheck"
|
||||
ContainerFieldResources = "resources"
|
||||
ContainerFieldRunAsNonRoot = "runAsNonRoot"
|
||||
ContainerFieldRunAsUser = "runAsUser"
|
||||
ContainerFieldScheduling = "scheduling"
|
||||
ContainerFieldStdin = "stdin"
|
||||
ContainerFieldStdinOnce = "stdinOnce"
|
||||
ContainerFieldTTY = "tty"
|
||||
ContainerFieldTerminationMessagePath = "terminationMessagePath"
|
||||
ContainerFieldTerminationMessagePolicy = "terminationMessagePolicy"
|
||||
ContainerFieldUid = "uid"
|
||||
ContainerFieldVolumeMounts = "volumeMounts"
|
||||
ContainerFieldWorkingDir = "workingDir"
|
||||
)
|
||||
|
||||
type Container struct {
|
||||
Add []string `json:"add,omitempty"`
|
||||
AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty"`
|
||||
Args []string `json:"args,omitempty"`
|
||||
CapAdd []string `json:"capAdd,omitempty"`
|
||||
CapDrop []string `json:"capDrop,omitempty"`
|
||||
Command []string `json:"command,omitempty"`
|
||||
Drop []string `json:"drop,omitempty"`
|
||||
Entrypoint []string `json:"entrypoint,omitempty"`
|
||||
Environment map[string]string `json:"environment,omitempty"`
|
||||
EnvironmentFrom []EnvironmentFrom `json:"environmentFrom,omitempty"`
|
||||
Healthcheck *Probe `json:"healthcheck,omitempty"`
|
||||
Image string `json:"image,omitempty"`
|
||||
ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
|
||||
InitContainer bool `json:"initContainer,omitempty"`
|
||||
LivenessProbe *Probe `json:"livenessProbe,omitempty"`
|
||||
InitContainer *bool `json:"initContainer,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Ports []ContainerPort `json:"ports,omitempty"`
|
||||
PostStart *Handler `json:"postStart,omitempty"`
|
||||
PreStop *Handler `json:"preStop,omitempty"`
|
||||
Privileged *bool `json:"privileged,omitempty"`
|
||||
ReadOnlyRootFilesystem *bool `json:"readOnlyRootFilesystem,omitempty"`
|
||||
ReadinessProbe *Probe `json:"readinessProbe,omitempty"`
|
||||
PullPolicy string `json:"pullPolicy,omitempty"`
|
||||
ReadOnly *bool `json:"readOnly,omitempty"`
|
||||
Readycheck *Probe `json:"readycheck,omitempty"`
|
||||
Resources *Resources `json:"resources,omitempty"`
|
||||
RunAsNonRoot *bool `json:"runAsNonRoot,omitempty"`
|
||||
RunAsUser *int64 `json:"runAsUser,omitempty"`
|
||||
Scheduling *Scheduling `json:"scheduling,omitempty"`
|
||||
Stdin bool `json:"stdin,omitempty"`
|
||||
StdinOnce bool `json:"stdinOnce,omitempty"`
|
||||
TTY bool `json:"tty,omitempty"`
|
||||
Stdin *bool `json:"stdin,omitempty"`
|
||||
StdinOnce *bool `json:"stdinOnce,omitempty"`
|
||||
TTY *bool `json:"tty,omitempty"`
|
||||
TerminationMessagePath string `json:"terminationMessagePath,omitempty"`
|
||||
TerminationMessagePolicy string `json:"terminationMessagePolicy,omitempty"`
|
||||
Uid *int64 `json:"uid,omitempty"`
|
||||
VolumeMounts []VolumeMount `json:"volumeMounts,omitempty"`
|
||||
WorkingDir string `json:"workingDir,omitempty"`
|
||||
}
|
||||
|
@ -8,5 +8,5 @@ const (
|
||||
|
||||
type ContainerImage struct {
|
||||
Names []string `json:"names,omitempty"`
|
||||
SizeBytes int64 `json:"sizeBytes,omitempty"`
|
||||
SizeBytes *int64 `json:"sizeBytes,omitempty"`
|
||||
}
|
||||
|
@ -9,8 +9,8 @@ const (
|
||||
)
|
||||
|
||||
type ContainerPort struct {
|
||||
ContainerPort int64 `json:"containerPort,omitempty"`
|
||||
ContainerPort *int64 `json:"containerPort,omitempty"`
|
||||
HostIP string `json:"hostIP,omitempty"`
|
||||
HostPort int64 `json:"hostPort,omitempty"`
|
||||
HostPort *int64 `json:"hostPort,omitempty"`
|
||||
Protocol string `json:"protocol,omitempty"`
|
||||
}
|
||||
|
@ -13,10 +13,10 @@ const (
|
||||
|
||||
type ContainerStateTerminated struct {
|
||||
ContainerID string `json:"containerID,omitempty"`
|
||||
ExitCode int64 `json:"exitCode,omitempty"`
|
||||
ExitCode *int64 `json:"exitCode,omitempty"`
|
||||
FinishedAt string `json:"finishedAt,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Reason string `json:"reason,omitempty"`
|
||||
Signal int64 `json:"signal,omitempty"`
|
||||
Signal *int64 `json:"signal,omitempty"`
|
||||
StartedAt string `json:"startedAt,omitempty"`
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ const (
|
||||
ContainerStatusFieldContainerID = "containerID"
|
||||
ContainerStatusFieldImage = "image"
|
||||
ContainerStatusFieldImageID = "imageID"
|
||||
ContainerStatusFieldLastTerminationState = "lastTerminationState"
|
||||
ContainerStatusFieldLastTerminationState = "lastState"
|
||||
ContainerStatusFieldName = "name"
|
||||
ContainerStatusFieldReady = "ready"
|
||||
ContainerStatusFieldRestartCount = "restartCount"
|
||||
@ -13,12 +13,12 @@ const (
|
||||
)
|
||||
|
||||
type ContainerStatus struct {
|
||||
ContainerID string `json:"containerID,omitempty"`
|
||||
Image string `json:"image,omitempty"`
|
||||
ImageID string `json:"imageID,omitempty"`
|
||||
LastTerminationState ContainerState `json:"lastTerminationState,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Ready bool `json:"ready,omitempty"`
|
||||
RestartCount int64 `json:"restartCount,omitempty"`
|
||||
State ContainerState `json:"state,omitempty"`
|
||||
ContainerID string `json:"containerID,omitempty"`
|
||||
Image string `json:"image,omitempty"`
|
||||
ImageID string `json:"imageID,omitempty"`
|
||||
LastTerminationState *ContainerState `json:"lastState,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Ready *bool `json:"ready,omitempty"`
|
||||
RestartCount *int64 `json:"restartCount,omitempty"`
|
||||
State *ContainerState `json:"state,omitempty"`
|
||||
}
|
||||
|
@ -6,5 +6,5 @@ const (
|
||||
)
|
||||
|
||||
type CPUInfo struct {
|
||||
Count int64 `json:"count,omitempty"`
|
||||
Count *int64 `json:"count,omitempty"`
|
||||
}
|
||||
|
@ -2,9 +2,9 @@ package client
|
||||
|
||||
const (
|
||||
DaemonEndpointType = "daemonEndpoint"
|
||||
DaemonEndpointFieldPort = "port"
|
||||
DaemonEndpointFieldPort = "Port"
|
||||
)
|
||||
|
||||
type DaemonEndpoint struct {
|
||||
Port int64 `json:"port,omitempty"`
|
||||
Port *int64 `json:"Port,omitempty"`
|
||||
}
|
||||
|
159
client/workload/v1/zz_generated_daemon_set.go
Normal file
159
client/workload/v1/zz_generated_daemon_set.go
Normal file
@ -0,0 +1,159 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
)
|
||||
|
||||
const (
|
||||
DaemonSetType = "daemonSet"
|
||||
DaemonSetFieldActiveDeadlineSeconds = "activeDeadlineSeconds"
|
||||
DaemonSetFieldAnnotations = "annotations"
|
||||
DaemonSetFieldAutomountServiceAccountToken = "automountServiceAccountToken"
|
||||
DaemonSetFieldBatchSize = "batchSize"
|
||||
DaemonSetFieldContainers = "containers"
|
||||
DaemonSetFieldCreated = "created"
|
||||
DaemonSetFieldDNSPolicy = "dnsPolicy"
|
||||
DaemonSetFieldDeploymentStrategy = "deploymentStrategy"
|
||||
DaemonSetFieldFsgid = "fsgid"
|
||||
DaemonSetFieldGids = "gids"
|
||||
DaemonSetFieldHostAliases = "hostAliases"
|
||||
DaemonSetFieldHostname = "hostname"
|
||||
DaemonSetFieldIPC = "ipc"
|
||||
DaemonSetFieldLabels = "labels"
|
||||
DaemonSetFieldName = "name"
|
||||
DaemonSetFieldNamespace = "namespace"
|
||||
DaemonSetFieldNet = "net"
|
||||
DaemonSetFieldNodeId = "nodeId"
|
||||
DaemonSetFieldOwnerReferences = "ownerReferences"
|
||||
DaemonSetFieldPID = "pid"
|
||||
DaemonSetFieldPriority = "priority"
|
||||
DaemonSetFieldPriorityClassName = "priorityClassName"
|
||||
DaemonSetFieldProjectID = "projectId"
|
||||
DaemonSetFieldPullSecrets = "pullSecrets"
|
||||
DaemonSetFieldRemoved = "removed"
|
||||
DaemonSetFieldResourcePath = "resourcePath"
|
||||
DaemonSetFieldRestart = "restart"
|
||||
DaemonSetFieldRevisionHistoryLimit = "revisionHistoryLimit"
|
||||
DaemonSetFieldRunAsNonRoot = "runAsNonRoot"
|
||||
DaemonSetFieldScale = "scale"
|
||||
DaemonSetFieldSchedulerName = "schedulerName"
|
||||
DaemonSetFieldServiceAccountName = "serviceAccountName"
|
||||
DaemonSetFieldStatus = "status"
|
||||
DaemonSetFieldSubdomain = "subdomain"
|
||||
DaemonSetFieldTerminationGracePeriodSeconds = "terminationGracePeriodSeconds"
|
||||
DaemonSetFieldTolerations = "tolerations"
|
||||
DaemonSetFieldUid = "uid"
|
||||
DaemonSetFieldUpdateStrategy = "updateStrategy"
|
||||
DaemonSetFieldUuid = "uuid"
|
||||
DaemonSetFieldVolumes = "volumes"
|
||||
DaemonSetFieldWorkloadAnnotations = "workloadAnnotations"
|
||||
DaemonSetFieldWorkloadLabels = "workloadLabels"
|
||||
)
|
||||
|
||||
type DaemonSet struct {
|
||||
types.Resource
|
||||
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty"`
|
||||
BatchSize string `json:"batchSize,omitempty"`
|
||||
Containers map[string]Container `json:"containers,omitempty"`
|
||||
Created string `json:"created,omitempty"`
|
||||
DNSPolicy string `json:"dnsPolicy,omitempty"`
|
||||
DeploymentStrategy *DeployStrategy `json:"deploymentStrategy,omitempty"`
|
||||
Fsgid *int64 `json:"fsgid,omitempty"`
|
||||
Gids []int64 `json:"gids,omitempty"`
|
||||
HostAliases map[string]HostAlias `json:"hostAliases,omitempty"`
|
||||
Hostname string `json:"hostname,omitempty"`
|
||||
IPC string `json:"ipc,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
Net string `json:"net,omitempty"`
|
||||
NodeId string `json:"nodeId,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"`
|
||||
PID string `json:"pid,omitempty"`
|
||||
Priority *int64 `json:"priority,omitempty"`
|
||||
PriorityClassName string `json:"priorityClassName,omitempty"`
|
||||
ProjectID string `json:"projectId,omitempty"`
|
||||
PullSecrets []LocalObjectReference `json:"pullSecrets,omitempty"`
|
||||
Removed string `json:"removed,omitempty"`
|
||||
ResourcePath string `json:"resourcePath,omitempty"`
|
||||
Restart string `json:"restart,omitempty"`
|
||||
RevisionHistoryLimit *int64 `json:"revisionHistoryLimit,omitempty"`
|
||||
RunAsNonRoot *bool `json:"runAsNonRoot,omitempty"`
|
||||
Scale *int64 `json:"scale,omitempty"`
|
||||
SchedulerName string `json:"schedulerName,omitempty"`
|
||||
ServiceAccountName string `json:"serviceAccountName,omitempty"`
|
||||
Status *DaemonSetStatus `json:"status,omitempty"`
|
||||
Subdomain string `json:"subdomain,omitempty"`
|
||||
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
|
||||
Tolerations []Toleration `json:"tolerations,omitempty"`
|
||||
Uid *int64 `json:"uid,omitempty"`
|
||||
UpdateStrategy *DaemonSetUpdateStrategy `json:"updateStrategy,omitempty"`
|
||||
Uuid string `json:"uuid,omitempty"`
|
||||
Volumes map[string]Volume `json:"volumes,omitempty"`
|
||||
WorkloadAnnotations map[string]string `json:"workloadAnnotations,omitempty"`
|
||||
WorkloadLabels map[string]string `json:"workloadLabels,omitempty"`
|
||||
}
|
||||
type DaemonSetCollection struct {
|
||||
types.Collection
|
||||
Data []DaemonSet `json:"data,omitempty"`
|
||||
client *DaemonSetClient
|
||||
}
|
||||
|
||||
type DaemonSetClient struct {
|
||||
apiClient *Client
|
||||
}
|
||||
|
||||
type DaemonSetOperations interface {
|
||||
List(opts *types.ListOpts) (*DaemonSetCollection, error)
|
||||
Create(opts *DaemonSet) (*DaemonSet, error)
|
||||
Update(existing *DaemonSet, updates interface{}) (*DaemonSet, error)
|
||||
ByID(id string) (*DaemonSet, error)
|
||||
Delete(container *DaemonSet) error
|
||||
}
|
||||
|
||||
func newDaemonSetClient(apiClient *Client) *DaemonSetClient {
|
||||
return &DaemonSetClient{
|
||||
apiClient: apiClient,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *DaemonSetClient) Create(container *DaemonSet) (*DaemonSet, error) {
|
||||
resp := &DaemonSet{}
|
||||
err := c.apiClient.Ops.DoCreate(DaemonSetType, container, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *DaemonSetClient) Update(existing *DaemonSet, updates interface{}) (*DaemonSet, error) {
|
||||
resp := &DaemonSet{}
|
||||
err := c.apiClient.Ops.DoUpdate(DaemonSetType, &existing.Resource, updates, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *DaemonSetClient) List(opts *types.ListOpts) (*DaemonSetCollection, error) {
|
||||
resp := &DaemonSetCollection{}
|
||||
err := c.apiClient.Ops.DoList(DaemonSetType, opts, resp)
|
||||
resp.client = c
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (cc *DaemonSetCollection) Next() (*DaemonSetCollection, error) {
|
||||
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
|
||||
resp := &DaemonSetCollection{}
|
||||
err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp)
|
||||
resp.client = cc.client
|
||||
return resp, err
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (c *DaemonSetClient) ByID(id string) (*DaemonSet, error) {
|
||||
resp := &DaemonSet{}
|
||||
err := c.apiClient.Ops.DoByID(DaemonSetType, id, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *DaemonSetClient) Delete(container *DaemonSet) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(DaemonSetType, &container.Resource)
|
||||
}
|
68
client/workload/v1/zz_generated_daemon_set_spec.go
Normal file
68
client/workload/v1/zz_generated_daemon_set_spec.go
Normal file
@ -0,0 +1,68 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
DaemonSetSpecType = "daemonSetSpec"
|
||||
DaemonSetSpecFieldActiveDeadlineSeconds = "activeDeadlineSeconds"
|
||||
DaemonSetSpecFieldAutomountServiceAccountToken = "automountServiceAccountToken"
|
||||
DaemonSetSpecFieldBatchSize = "batchSize"
|
||||
DaemonSetSpecFieldContainers = "containers"
|
||||
DaemonSetSpecFieldDNSPolicy = "dnsPolicy"
|
||||
DaemonSetSpecFieldDeploymentStrategy = "deploymentStrategy"
|
||||
DaemonSetSpecFieldFsgid = "fsgid"
|
||||
DaemonSetSpecFieldGids = "gids"
|
||||
DaemonSetSpecFieldHostAliases = "hostAliases"
|
||||
DaemonSetSpecFieldHostname = "hostname"
|
||||
DaemonSetSpecFieldIPC = "ipc"
|
||||
DaemonSetSpecFieldNet = "net"
|
||||
DaemonSetSpecFieldNodeId = "nodeId"
|
||||
DaemonSetSpecFieldObjectMeta = "metadata"
|
||||
DaemonSetSpecFieldPID = "pid"
|
||||
DaemonSetSpecFieldPriority = "priority"
|
||||
DaemonSetSpecFieldPriorityClassName = "priorityClassName"
|
||||
DaemonSetSpecFieldPullSecrets = "pullSecrets"
|
||||
DaemonSetSpecFieldRestart = "restart"
|
||||
DaemonSetSpecFieldRevisionHistoryLimit = "revisionHistoryLimit"
|
||||
DaemonSetSpecFieldRunAsNonRoot = "runAsNonRoot"
|
||||
DaemonSetSpecFieldScale = "scale"
|
||||
DaemonSetSpecFieldSchedulerName = "schedulerName"
|
||||
DaemonSetSpecFieldServiceAccountName = "serviceAccountName"
|
||||
DaemonSetSpecFieldSubdomain = "subdomain"
|
||||
DaemonSetSpecFieldTerminationGracePeriodSeconds = "terminationGracePeriodSeconds"
|
||||
DaemonSetSpecFieldTolerations = "tolerations"
|
||||
DaemonSetSpecFieldUid = "uid"
|
||||
DaemonSetSpecFieldUpdateStrategy = "updateStrategy"
|
||||
DaemonSetSpecFieldVolumes = "volumes"
|
||||
)
|
||||
|
||||
type DaemonSetSpec struct {
|
||||
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`
|
||||
AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty"`
|
||||
BatchSize string `json:"batchSize,omitempty"`
|
||||
Containers map[string]Container `json:"containers,omitempty"`
|
||||
DNSPolicy string `json:"dnsPolicy,omitempty"`
|
||||
DeploymentStrategy *DeployStrategy `json:"deploymentStrategy,omitempty"`
|
||||
Fsgid *int64 `json:"fsgid,omitempty"`
|
||||
Gids []int64 `json:"gids,omitempty"`
|
||||
HostAliases map[string]HostAlias `json:"hostAliases,omitempty"`
|
||||
Hostname string `json:"hostname,omitempty"`
|
||||
IPC string `json:"ipc,omitempty"`
|
||||
Net string `json:"net,omitempty"`
|
||||
NodeId string `json:"nodeId,omitempty"`
|
||||
ObjectMeta *ObjectMeta `json:"metadata,omitempty"`
|
||||
PID string `json:"pid,omitempty"`
|
||||
Priority *int64 `json:"priority,omitempty"`
|
||||
PriorityClassName string `json:"priorityClassName,omitempty"`
|
||||
PullSecrets []LocalObjectReference `json:"pullSecrets,omitempty"`
|
||||
Restart string `json:"restart,omitempty"`
|
||||
RevisionHistoryLimit *int64 `json:"revisionHistoryLimit,omitempty"`
|
||||
RunAsNonRoot *bool `json:"runAsNonRoot,omitempty"`
|
||||
Scale *int64 `json:"scale,omitempty"`
|
||||
SchedulerName string `json:"schedulerName,omitempty"`
|
||||
ServiceAccountName string `json:"serviceAccountName,omitempty"`
|
||||
Subdomain string `json:"subdomain,omitempty"`
|
||||
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
|
||||
Tolerations []Toleration `json:"tolerations,omitempty"`
|
||||
Uid *int64 `json:"uid,omitempty"`
|
||||
UpdateStrategy *DaemonSetUpdateStrategy `json:"updateStrategy,omitempty"`
|
||||
Volumes map[string]Volume `json:"volumes,omitempty"`
|
||||
}
|
26
client/workload/v1/zz_generated_daemon_set_status.go
Normal file
26
client/workload/v1/zz_generated_daemon_set_status.go
Normal file
@ -0,0 +1,26 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
DaemonSetStatusType = "daemonSetStatus"
|
||||
DaemonSetStatusFieldCollisionCount = "collisionCount"
|
||||
DaemonSetStatusFieldCurrentNumberScheduled = "currentNumberScheduled"
|
||||
DaemonSetStatusFieldDesiredNumberScheduled = "desiredNumberScheduled"
|
||||
DaemonSetStatusFieldNumberAvailable = "numberAvailable"
|
||||
DaemonSetStatusFieldNumberMisscheduled = "numberMisscheduled"
|
||||
DaemonSetStatusFieldNumberReady = "numberReady"
|
||||
DaemonSetStatusFieldNumberUnavailable = "numberUnavailable"
|
||||
DaemonSetStatusFieldObservedGeneration = "observedGeneration"
|
||||
DaemonSetStatusFieldUpdatedNumberScheduled = "updatedNumberScheduled"
|
||||
)
|
||||
|
||||
type DaemonSetStatus struct {
|
||||
CollisionCount *int64 `json:"collisionCount,omitempty"`
|
||||
CurrentNumberScheduled *int64 `json:"currentNumberScheduled,omitempty"`
|
||||
DesiredNumberScheduled *int64 `json:"desiredNumberScheduled,omitempty"`
|
||||
NumberAvailable *int64 `json:"numberAvailable,omitempty"`
|
||||
NumberMisscheduled *int64 `json:"numberMisscheduled,omitempty"`
|
||||
NumberReady *int64 `json:"numberReady,omitempty"`
|
||||
NumberUnavailable *int64 `json:"numberUnavailable,omitempty"`
|
||||
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
|
||||
UpdatedNumberScheduled *int64 `json:"updatedNumberScheduled,omitempty"`
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
DaemonSetUpdateStrategyType = "daemonSetUpdateStrategy"
|
||||
DaemonSetUpdateStrategyFieldRollingUpdate = "rollingUpdate"
|
||||
DaemonSetUpdateStrategyFieldType = "type"
|
||||
)
|
||||
|
||||
type DaemonSetUpdateStrategy struct {
|
||||
RollingUpdate *RollingUpdateDaemonSet `json:"rollingUpdate,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
}
|
14
client/workload/v1/zz_generated_deploy_config.go
Normal file
14
client/workload/v1/zz_generated_deploy_config.go
Normal file
@ -0,0 +1,14 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
DeployConfigType = "deployConfig"
|
||||
DeployConfigFieldBatchSize = "batchSize"
|
||||
DeployConfigFieldDeploymentStrategy = "deploymentStrategy"
|
||||
DeployConfigFieldScale = "scale"
|
||||
)
|
||||
|
||||
type DeployConfig struct {
|
||||
BatchSize string `json:"batchSize,omitempty"`
|
||||
DeploymentStrategy *DeployStrategy `json:"deploymentStrategy,omitempty"`
|
||||
Scale *int64 `json:"scale,omitempty"`
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
DeployParamsType = "deployParams"
|
||||
DeployParamsFieldMinReadySeconds = "minReadySeconds"
|
||||
DeployParamsFieldPodManagementPolicy = "podManagementPolicy"
|
||||
DeployParamsFieldProgressDeadlineSeconds = "progressDeadlineSeconds"
|
||||
DeployParamsFieldReplicas = "replicas"
|
||||
DeployParamsFieldRevisionHistoryLimit = "revisionHistoryLimit"
|
||||
)
|
||||
|
||||
type DeployParams struct {
|
||||
MinReadySeconds int64 `json:"minReadySeconds,omitempty"`
|
||||
PodManagementPolicy string `json:"podManagementPolicy,omitempty"`
|
||||
ProgressDeadlineSeconds *int64 `json:"progressDeadlineSeconds,omitempty"`
|
||||
Replicas *int64 `json:"replicas,omitempty"`
|
||||
RevisionHistoryLimit *int64 `json:"revisionHistoryLimit,omitempty"`
|
||||
}
|
18
client/workload/v1/zz_generated_deploy_strategy.go
Normal file
18
client/workload/v1/zz_generated_deploy_strategy.go
Normal file
@ -0,0 +1,18 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
DeployStrategyType = "deployStrategy"
|
||||
DeployStrategyFieldGlobalConfig = "globalConfig"
|
||||
DeployStrategyFieldJobConfig = "jobConfig"
|
||||
DeployStrategyFieldKind = "kind"
|
||||
DeployStrategyFieldOrderedConfig = "orderedConfig"
|
||||
DeployStrategyFieldParallelConfig = "parallelConfig"
|
||||
)
|
||||
|
||||
type DeployStrategy struct {
|
||||
GlobalConfig *DeploymentGlobalConfig `json:"globalConfig,omitempty"`
|
||||
JobConfig *DeploymentJobConfig `json:"jobConfig,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
OrderedConfig *DeploymentOrderedConfig `json:"orderedConfig,omitempty"`
|
||||
ParallelConfig *DeploymentParallelConfig `json:"parallelConfig,omitempty"`
|
||||
}
|
@ -5,39 +5,95 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
DeploymentType = "deployment"
|
||||
DeploymentFieldAPIVersion = "apiVersion"
|
||||
DeploymentFieldAnnotations = "annotations"
|
||||
DeploymentFieldCreationTimestamp = "creationTimestamp"
|
||||
DeploymentFieldDeletionTimestamp = "deletionTimestamp"
|
||||
DeploymentFieldDeploy = "deploy"
|
||||
DeploymentFieldKind = "kind"
|
||||
DeploymentFieldLabels = "labels"
|
||||
DeploymentFieldName = "name"
|
||||
DeploymentFieldNamespace = "namespace"
|
||||
DeploymentFieldPaused = "paused"
|
||||
DeploymentFieldStatus = "status"
|
||||
DeploymentFieldStrategy = "strategy"
|
||||
DeploymentFieldTemplate = "template"
|
||||
DeploymentFieldUID = "uid"
|
||||
DeploymentType = "deployment"
|
||||
DeploymentFieldActiveDeadlineSeconds = "activeDeadlineSeconds"
|
||||
DeploymentFieldAnnotations = "annotations"
|
||||
DeploymentFieldAutomountServiceAccountToken = "automountServiceAccountToken"
|
||||
DeploymentFieldBatchSize = "batchSize"
|
||||
DeploymentFieldContainers = "containers"
|
||||
DeploymentFieldCreated = "created"
|
||||
DeploymentFieldDNSPolicy = "dnsPolicy"
|
||||
DeploymentFieldDeploymentStrategy = "deploymentStrategy"
|
||||
DeploymentFieldFsgid = "fsgid"
|
||||
DeploymentFieldGids = "gids"
|
||||
DeploymentFieldHostAliases = "hostAliases"
|
||||
DeploymentFieldHostname = "hostname"
|
||||
DeploymentFieldIPC = "ipc"
|
||||
DeploymentFieldLabels = "labels"
|
||||
DeploymentFieldName = "name"
|
||||
DeploymentFieldNamespace = "namespace"
|
||||
DeploymentFieldNet = "net"
|
||||
DeploymentFieldNodeId = "nodeId"
|
||||
DeploymentFieldOwnerReferences = "ownerReferences"
|
||||
DeploymentFieldPID = "pid"
|
||||
DeploymentFieldPaused = "paused"
|
||||
DeploymentFieldPriority = "priority"
|
||||
DeploymentFieldPriorityClassName = "priorityClassName"
|
||||
DeploymentFieldProjectID = "projectId"
|
||||
DeploymentFieldPullSecrets = "pullSecrets"
|
||||
DeploymentFieldRemoved = "removed"
|
||||
DeploymentFieldResourcePath = "resourcePath"
|
||||
DeploymentFieldRestart = "restart"
|
||||
DeploymentFieldRevisionHistoryLimit = "revisionHistoryLimit"
|
||||
DeploymentFieldRunAsNonRoot = "runAsNonRoot"
|
||||
DeploymentFieldScale = "scale"
|
||||
DeploymentFieldSchedulerName = "schedulerName"
|
||||
DeploymentFieldServiceAccountName = "serviceAccountName"
|
||||
DeploymentFieldStatus = "status"
|
||||
DeploymentFieldSubdomain = "subdomain"
|
||||
DeploymentFieldTerminationGracePeriodSeconds = "terminationGracePeriodSeconds"
|
||||
DeploymentFieldTolerations = "tolerations"
|
||||
DeploymentFieldUid = "uid"
|
||||
DeploymentFieldUuid = "uuid"
|
||||
DeploymentFieldVolumes = "volumes"
|
||||
DeploymentFieldWorkloadAnnotations = "workloadAnnotations"
|
||||
DeploymentFieldWorkloadLabels = "workloadLabels"
|
||||
)
|
||||
|
||||
type Deployment struct {
|
||||
types.Resource
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
CreationTimestamp string `json:"creationTimestamp,omitempty"`
|
||||
DeletionTimestamp string `json:"deletionTimestamp,omitempty"`
|
||||
Deploy *DeployParams `json:"deploy,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
Paused bool `json:"paused,omitempty"`
|
||||
Status DeploymentStatus `json:"status,omitempty"`
|
||||
Strategy DeploymentStrategy `json:"strategy,omitempty"`
|
||||
Template PodTemplateSpec `json:"template,omitempty"`
|
||||
UID string `json:"uid,omitempty"`
|
||||
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty"`
|
||||
BatchSize string `json:"batchSize,omitempty"`
|
||||
Containers map[string]Container `json:"containers,omitempty"`
|
||||
Created string `json:"created,omitempty"`
|
||||
DNSPolicy string `json:"dnsPolicy,omitempty"`
|
||||
DeploymentStrategy *DeployStrategy `json:"deploymentStrategy,omitempty"`
|
||||
Fsgid *int64 `json:"fsgid,omitempty"`
|
||||
Gids []int64 `json:"gids,omitempty"`
|
||||
HostAliases map[string]HostAlias `json:"hostAliases,omitempty"`
|
||||
Hostname string `json:"hostname,omitempty"`
|
||||
IPC string `json:"ipc,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
Net string `json:"net,omitempty"`
|
||||
NodeId string `json:"nodeId,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"`
|
||||
PID string `json:"pid,omitempty"`
|
||||
Paused *bool `json:"paused,omitempty"`
|
||||
Priority *int64 `json:"priority,omitempty"`
|
||||
PriorityClassName string `json:"priorityClassName,omitempty"`
|
||||
ProjectID string `json:"projectId,omitempty"`
|
||||
PullSecrets []LocalObjectReference `json:"pullSecrets,omitempty"`
|
||||
Removed string `json:"removed,omitempty"`
|
||||
ResourcePath string `json:"resourcePath,omitempty"`
|
||||
Restart string `json:"restart,omitempty"`
|
||||
RevisionHistoryLimit *int64 `json:"revisionHistoryLimit,omitempty"`
|
||||
RunAsNonRoot *bool `json:"runAsNonRoot,omitempty"`
|
||||
Scale *int64 `json:"scale,omitempty"`
|
||||
SchedulerName string `json:"schedulerName,omitempty"`
|
||||
ServiceAccountName string `json:"serviceAccountName,omitempty"`
|
||||
Status *DeploymentStatus `json:"status,omitempty"`
|
||||
Subdomain string `json:"subdomain,omitempty"`
|
||||
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
|
||||
Tolerations []Toleration `json:"tolerations,omitempty"`
|
||||
Uid *int64 `json:"uid,omitempty"`
|
||||
Uuid string `json:"uuid,omitempty"`
|
||||
Volumes map[string]Volume `json:"volumes,omitempty"`
|
||||
WorkloadAnnotations map[string]string `json:"workloadAnnotations,omitempty"`
|
||||
WorkloadLabels map[string]string `json:"workloadLabels,omitempty"`
|
||||
}
|
||||
type DeploymentCollection struct {
|
||||
types.Collection
|
||||
|
12
client/workload/v1/zz_generated_deployment_global_config.go
Normal file
12
client/workload/v1/zz_generated_deployment_global_config.go
Normal file
@ -0,0 +1,12 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
DeploymentGlobalConfigType = "deploymentGlobalConfig"
|
||||
DeploymentGlobalConfigFieldMinReadySeconds = "minReadySeconds"
|
||||
DeploymentGlobalConfigFieldOnDelete = "onDelete"
|
||||
)
|
||||
|
||||
type DeploymentGlobalConfig struct {
|
||||
MinReadySeconds *int64 `json:"minReadySeconds,omitempty"`
|
||||
OnDelete *bool `json:"onDelete,omitempty"`
|
||||
}
|
14
client/workload/v1/zz_generated_deployment_job_config.go
Normal file
14
client/workload/v1/zz_generated_deployment_job_config.go
Normal file
@ -0,0 +1,14 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
DeploymentJobConfigType = "deploymentJobConfig"
|
||||
DeploymentJobConfigFieldActiveDeadlineSeconds = "activeDeadlineSeconds"
|
||||
DeploymentJobConfigFieldBatchLimit = "batchLimit"
|
||||
DeploymentJobConfigFieldOnDelete = "onDelete"
|
||||
)
|
||||
|
||||
type DeploymentJobConfig struct {
|
||||
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`
|
||||
BatchLimit *int64 `json:"batchLimit,omitempty"`
|
||||
OnDelete *bool `json:"onDelete,omitempty"`
|
||||
}
|
14
client/workload/v1/zz_generated_deployment_ordered_config.go
Normal file
14
client/workload/v1/zz_generated_deployment_ordered_config.go
Normal file
@ -0,0 +1,14 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
DeploymentOrderedConfigType = "deploymentOrderedConfig"
|
||||
DeploymentOrderedConfigFieldOnDelete = "onDelete"
|
||||
DeploymentOrderedConfigFieldPartition = "partition"
|
||||
DeploymentOrderedConfigFieldPartitionSize = "partitionSize"
|
||||
)
|
||||
|
||||
type DeploymentOrderedConfig struct {
|
||||
OnDelete *bool `json:"onDelete,omitempty"`
|
||||
Partition *int64 `json:"partition,omitempty"`
|
||||
PartitionSize *int64 `json:"partitionSize,omitempty"`
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
DeploymentParallelConfigType = "deploymentParallelConfig"
|
||||
DeploymentParallelConfigFieldMinReadySeconds = "minReadySeconds"
|
||||
DeploymentParallelConfigFieldProgressDeadlineSeconds = "progressDeadlineSeconds"
|
||||
DeploymentParallelConfigFieldStartFirst = "startFirst"
|
||||
)
|
||||
|
||||
type DeploymentParallelConfig struct {
|
||||
MinReadySeconds *int64 `json:"minReadySeconds,omitempty"`
|
||||
ProgressDeadlineSeconds *int64 `json:"progressDeadlineSeconds,omitempty"`
|
||||
StartFirst *bool `json:"startFirst,omitempty"`
|
||||
}
|
@ -1,16 +1,68 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
DeploymentSpecType = "deploymentSpec"
|
||||
DeploymentSpecFieldDeploy = "deploy"
|
||||
DeploymentSpecFieldPaused = "paused"
|
||||
DeploymentSpecFieldStrategy = "strategy"
|
||||
DeploymentSpecFieldTemplate = "template"
|
||||
DeploymentSpecType = "deploymentSpec"
|
||||
DeploymentSpecFieldActiveDeadlineSeconds = "activeDeadlineSeconds"
|
||||
DeploymentSpecFieldAutomountServiceAccountToken = "automountServiceAccountToken"
|
||||
DeploymentSpecFieldBatchSize = "batchSize"
|
||||
DeploymentSpecFieldContainers = "containers"
|
||||
DeploymentSpecFieldDNSPolicy = "dnsPolicy"
|
||||
DeploymentSpecFieldDeploymentStrategy = "deploymentStrategy"
|
||||
DeploymentSpecFieldFsgid = "fsgid"
|
||||
DeploymentSpecFieldGids = "gids"
|
||||
DeploymentSpecFieldHostAliases = "hostAliases"
|
||||
DeploymentSpecFieldHostname = "hostname"
|
||||
DeploymentSpecFieldIPC = "ipc"
|
||||
DeploymentSpecFieldNet = "net"
|
||||
DeploymentSpecFieldNodeId = "nodeId"
|
||||
DeploymentSpecFieldObjectMeta = "metadata"
|
||||
DeploymentSpecFieldPID = "pid"
|
||||
DeploymentSpecFieldPaused = "paused"
|
||||
DeploymentSpecFieldPriority = "priority"
|
||||
DeploymentSpecFieldPriorityClassName = "priorityClassName"
|
||||
DeploymentSpecFieldPullSecrets = "pullSecrets"
|
||||
DeploymentSpecFieldRestart = "restart"
|
||||
DeploymentSpecFieldRevisionHistoryLimit = "revisionHistoryLimit"
|
||||
DeploymentSpecFieldRunAsNonRoot = "runAsNonRoot"
|
||||
DeploymentSpecFieldScale = "scale"
|
||||
DeploymentSpecFieldSchedulerName = "schedulerName"
|
||||
DeploymentSpecFieldServiceAccountName = "serviceAccountName"
|
||||
DeploymentSpecFieldSubdomain = "subdomain"
|
||||
DeploymentSpecFieldTerminationGracePeriodSeconds = "terminationGracePeriodSeconds"
|
||||
DeploymentSpecFieldTolerations = "tolerations"
|
||||
DeploymentSpecFieldUid = "uid"
|
||||
DeploymentSpecFieldVolumes = "volumes"
|
||||
)
|
||||
|
||||
type DeploymentSpec struct {
|
||||
Deploy *DeployParams `json:"deploy,omitempty"`
|
||||
Paused bool `json:"paused,omitempty"`
|
||||
Strategy DeploymentStrategy `json:"strategy,omitempty"`
|
||||
Template PodTemplateSpec `json:"template,omitempty"`
|
||||
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`
|
||||
AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty"`
|
||||
BatchSize string `json:"batchSize,omitempty"`
|
||||
Containers map[string]Container `json:"containers,omitempty"`
|
||||
DNSPolicy string `json:"dnsPolicy,omitempty"`
|
||||
DeploymentStrategy *DeployStrategy `json:"deploymentStrategy,omitempty"`
|
||||
Fsgid *int64 `json:"fsgid,omitempty"`
|
||||
Gids []int64 `json:"gids,omitempty"`
|
||||
HostAliases map[string]HostAlias `json:"hostAliases,omitempty"`
|
||||
Hostname string `json:"hostname,omitempty"`
|
||||
IPC string `json:"ipc,omitempty"`
|
||||
Net string `json:"net,omitempty"`
|
||||
NodeId string `json:"nodeId,omitempty"`
|
||||
ObjectMeta *ObjectMeta `json:"metadata,omitempty"`
|
||||
PID string `json:"pid,omitempty"`
|
||||
Paused *bool `json:"paused,omitempty"`
|
||||
Priority *int64 `json:"priority,omitempty"`
|
||||
PriorityClassName string `json:"priorityClassName,omitempty"`
|
||||
PullSecrets []LocalObjectReference `json:"pullSecrets,omitempty"`
|
||||
Restart string `json:"restart,omitempty"`
|
||||
RevisionHistoryLimit *int64 `json:"revisionHistoryLimit,omitempty"`
|
||||
RunAsNonRoot *bool `json:"runAsNonRoot,omitempty"`
|
||||
Scale *int64 `json:"scale,omitempty"`
|
||||
SchedulerName string `json:"schedulerName,omitempty"`
|
||||
ServiceAccountName string `json:"serviceAccountName,omitempty"`
|
||||
Subdomain string `json:"subdomain,omitempty"`
|
||||
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
|
||||
Tolerations []Toleration `json:"tolerations,omitempty"`
|
||||
Uid *int64 `json:"uid,omitempty"`
|
||||
Volumes map[string]Volume `json:"volumes,omitempty"`
|
||||
}
|
||||
|
@ -13,12 +13,12 @@ const (
|
||||
)
|
||||
|
||||
type DeploymentStatus struct {
|
||||
AvailableReplicas int64 `json:"availableReplicas,omitempty"`
|
||||
AvailableReplicas *int64 `json:"availableReplicas,omitempty"`
|
||||
CollisionCount *int64 `json:"collisionCount,omitempty"`
|
||||
Conditions []DeploymentCondition `json:"conditions,omitempty"`
|
||||
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
|
||||
ReadyReplicas int64 `json:"readyReplicas,omitempty"`
|
||||
Replicas int64 `json:"replicas,omitempty"`
|
||||
UnavailableReplicas int64 `json:"unavailableReplicas,omitempty"`
|
||||
UpdatedReplicas int64 `json:"updatedReplicas,omitempty"`
|
||||
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
|
||||
ReadyReplicas *int64 `json:"readyReplicas,omitempty"`
|
||||
Replicas *int64 `json:"replicas,omitempty"`
|
||||
UnavailableReplicas *int64 `json:"unavailableReplicas,omitempty"`
|
||||
UpdatedReplicas *int64 `json:"updatedReplicas,omitempty"`
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ const (
|
||||
)
|
||||
|
||||
type EnvironmentFrom struct {
|
||||
Optional bool `json:"optional,omitempty"`
|
||||
Optional *bool `json:"optional,omitempty"`
|
||||
Prefix string `json:"prefix,omitempty"`
|
||||
Source string `json:"source,omitempty"`
|
||||
SourceKey string `json:"sourceKey,omitempty"`
|
||||
|
@ -6,13 +6,13 @@ const (
|
||||
FCVolumeSourceFieldLun = "lun"
|
||||
FCVolumeSourceFieldReadOnly = "readOnly"
|
||||
FCVolumeSourceFieldTargetWWNs = "targetWWNs"
|
||||
FCVolumeSourceFieldWWIDs = "wwiDs"
|
||||
FCVolumeSourceFieldWWIDs = "wwids"
|
||||
)
|
||||
|
||||
type FCVolumeSource struct {
|
||||
FSType string `json:"fsType,omitempty"`
|
||||
Lun *int64 `json:"lun,omitempty"`
|
||||
ReadOnly bool `json:"readOnly,omitempty"`
|
||||
ReadOnly *bool `json:"readOnly,omitempty"`
|
||||
TargetWWNs []string `json:"targetWWNs,omitempty"`
|
||||
WWIDs []string `json:"wwiDs,omitempty"`
|
||||
WWIDs []string `json:"wwids,omitempty"`
|
||||
}
|
||||
|
@ -13,6 +13,6 @@ type FlexVolumeSource struct {
|
||||
Driver string `json:"driver,omitempty"`
|
||||
FSType string `json:"fsType,omitempty"`
|
||||
Options map[string]string `json:"options,omitempty"`
|
||||
ReadOnly bool `json:"readOnly,omitempty"`
|
||||
ReadOnly *bool `json:"readOnly,omitempty"`
|
||||
SecretRef *LocalObjectReference `json:"secretRef,omitempty"`
|
||||
}
|
||||
|
@ -11,6 +11,6 @@ const (
|
||||
type GCEPersistentDiskVolumeSource struct {
|
||||
FSType string `json:"fsType,omitempty"`
|
||||
PDName string `json:"pdName,omitempty"`
|
||||
Partition int64 `json:"partition,omitempty"`
|
||||
ReadOnly bool `json:"readOnly,omitempty"`
|
||||
Partition *int64 `json:"partition,omitempty"`
|
||||
ReadOnly *bool `json:"readOnly,omitempty"`
|
||||
}
|
||||
|
@ -2,13 +2,13 @@ package client
|
||||
|
||||
const (
|
||||
GlusterfsVolumeSourceType = "glusterfsVolumeSource"
|
||||
GlusterfsVolumeSourceFieldEndpointsName = "endpointsName"
|
||||
GlusterfsVolumeSourceFieldEndpointsName = "endpoints"
|
||||
GlusterfsVolumeSourceFieldPath = "path"
|
||||
GlusterfsVolumeSourceFieldReadOnly = "readOnly"
|
||||
)
|
||||
|
||||
type GlusterfsVolumeSource struct {
|
||||
EndpointsName string `json:"endpointsName,omitempty"`
|
||||
EndpointsName string `json:"endpoints,omitempty"`
|
||||
Path string `json:"path,omitempty"`
|
||||
ReadOnly bool `json:"readOnly,omitempty"`
|
||||
ReadOnly *bool `json:"readOnly,omitempty"`
|
||||
}
|
||||
|
@ -18,5 +18,5 @@ type Handler struct {
|
||||
Path string `json:"path,omitempty"`
|
||||
Port string `json:"port,omitempty"`
|
||||
Scheme string `json:"scheme,omitempty"`
|
||||
TCP bool `json:"tcp,omitempty"`
|
||||
TCP *bool `json:"tcp,omitempty"`
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package client
|
||||
|
||||
const (
|
||||
ISCSIVolumeSourceType = "iscsiVolumeSource"
|
||||
ISCSIVolumeSourceFieldDiscoveryCHAPAuth = "discoveryCHAPAuth"
|
||||
ISCSIVolumeSourceFieldDiscoveryCHAPAuth = "chapAuthDiscovery"
|
||||
ISCSIVolumeSourceFieldFSType = "fsType"
|
||||
ISCSIVolumeSourceFieldIQN = "iqn"
|
||||
ISCSIVolumeSourceFieldISCSIInterface = "iscsiInterface"
|
||||
@ -11,20 +11,20 @@ const (
|
||||
ISCSIVolumeSourceFieldPortals = "portals"
|
||||
ISCSIVolumeSourceFieldReadOnly = "readOnly"
|
||||
ISCSIVolumeSourceFieldSecretRef = "secretRef"
|
||||
ISCSIVolumeSourceFieldSessionCHAPAuth = "sessionCHAPAuth"
|
||||
ISCSIVolumeSourceFieldSessionCHAPAuth = "chapAuthSession"
|
||||
ISCSIVolumeSourceFieldTargetPortal = "targetPortal"
|
||||
)
|
||||
|
||||
type ISCSIVolumeSource struct {
|
||||
DiscoveryCHAPAuth bool `json:"discoveryCHAPAuth,omitempty"`
|
||||
DiscoveryCHAPAuth *bool `json:"chapAuthDiscovery,omitempty"`
|
||||
FSType string `json:"fsType,omitempty"`
|
||||
IQN string `json:"iqn,omitempty"`
|
||||
ISCSIInterface string `json:"iscsiInterface,omitempty"`
|
||||
InitiatorName string `json:"initiatorName,omitempty"`
|
||||
Lun int64 `json:"lun,omitempty"`
|
||||
Lun *int64 `json:"lun,omitempty"`
|
||||
Portals []string `json:"portals,omitempty"`
|
||||
ReadOnly bool `json:"readOnly,omitempty"`
|
||||
ReadOnly *bool `json:"readOnly,omitempty"`
|
||||
SecretRef *LocalObjectReference `json:"secretRef,omitempty"`
|
||||
SessionCHAPAuth bool `json:"sessionCHAPAuth,omitempty"`
|
||||
SessionCHAPAuth *bool `json:"chapAuthSession,omitempty"`
|
||||
TargetPortal string `json:"targetPortal,omitempty"`
|
||||
}
|
||||
|
@ -6,5 +6,5 @@ const (
|
||||
)
|
||||
|
||||
type MemoryInfo struct {
|
||||
MemTotalKiB int64 `json:"memTotalKiB,omitempty"`
|
||||
MemTotalKiB *int64 `json:"memTotalKiB,omitempty"`
|
||||
}
|
||||
|
@ -5,31 +5,43 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
NamespaceType = "namespace"
|
||||
NamespaceFieldAPIVersion = "apiVersion"
|
||||
NamespaceFieldAnnotations = "annotations"
|
||||
NamespaceFieldCreationTimestamp = "creationTimestamp"
|
||||
NamespaceFieldDeletionTimestamp = "deletionTimestamp"
|
||||
NamespaceFieldKind = "kind"
|
||||
NamespaceFieldLabels = "labels"
|
||||
NamespaceFieldName = "name"
|
||||
NamespaceFieldNamespace = "namespace"
|
||||
NamespaceFieldStatus = "status"
|
||||
NamespaceFieldUID = "uid"
|
||||
NamespaceType = "namespace"
|
||||
NamespaceFieldAnnotations = "annotations"
|
||||
NamespaceFieldAnswers = "answers"
|
||||
NamespaceFieldCreated = "created"
|
||||
NamespaceFieldExternalID = "externalId"
|
||||
NamespaceFieldLabels = "labels"
|
||||
NamespaceFieldName = "name"
|
||||
NamespaceFieldNamespace = "namespace"
|
||||
NamespaceFieldOwnerReferences = "ownerReferences"
|
||||
NamespaceFieldProjectID = "projectId"
|
||||
NamespaceFieldPrune = "prune"
|
||||
NamespaceFieldRemoved = "removed"
|
||||
NamespaceFieldResourcePath = "resourcePath"
|
||||
NamespaceFieldStatus = "status"
|
||||
NamespaceFieldTags = "tags"
|
||||
NamespaceFieldTemplates = "templates"
|
||||
NamespaceFieldUuid = "uuid"
|
||||
)
|
||||
|
||||
type Namespace struct {
|
||||
types.Resource
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
CreationTimestamp string `json:"creationTimestamp,omitempty"`
|
||||
DeletionTimestamp string `json:"deletionTimestamp,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
Status NamespaceStatus `json:"status,omitempty"`
|
||||
UID string `json:"uid,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
Answers map[string]interface{} `json:"answers,omitempty"`
|
||||
Created string `json:"created,omitempty"`
|
||||
ExternalID string `json:"externalId,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"`
|
||||
ProjectID string `json:"projectId,omitempty"`
|
||||
Prune *bool `json:"prune,omitempty"`
|
||||
Removed string `json:"removed,omitempty"`
|
||||
ResourcePath string `json:"resourcePath,omitempty"`
|
||||
Status *NamespaceStatus `json:"status,omitempty"`
|
||||
Tags []string `json:"tags,omitempty"`
|
||||
Templates map[string]string `json:"templates,omitempty"`
|
||||
Uuid string `json:"uuid,omitempty"`
|
||||
}
|
||||
type NamespaceCollection struct {
|
||||
types.Collection
|
||||
|
@ -9,6 +9,6 @@ const (
|
||||
|
||||
type NFSVolumeSource struct {
|
||||
Path string `json:"path,omitempty"`
|
||||
ReadOnly bool `json:"readOnly,omitempty"`
|
||||
ReadOnly *bool `json:"readOnly,omitempty"`
|
||||
Server string `json:"server,omitempty"`
|
||||
}
|
||||
|
@ -5,43 +5,61 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
NodeType = "node"
|
||||
NodeFieldAPIVersion = "apiVersion"
|
||||
NodeFieldAnnotations = "annotations"
|
||||
NodeFieldConfigSource = "configSource"
|
||||
NodeFieldCreationTimestamp = "creationTimestamp"
|
||||
NodeFieldDeletionTimestamp = "deletionTimestamp"
|
||||
NodeFieldExternalID = "externalID"
|
||||
NodeFieldKind = "kind"
|
||||
NodeFieldLabels = "labels"
|
||||
NodeFieldName = "name"
|
||||
NodeFieldNamespace = "namespace"
|
||||
NodeFieldPodCIDR = "podCIDR"
|
||||
NodeFieldProviderID = "providerID"
|
||||
NodeFieldStatus = "status"
|
||||
NodeFieldTaints = "taints"
|
||||
NodeFieldUID = "uid"
|
||||
NodeFieldUnschedulable = "unschedulable"
|
||||
NodeType = "node"
|
||||
NodeFieldAllocatable = "allocatable"
|
||||
NodeFieldAnnotations = "annotations"
|
||||
NodeFieldCapacity = "capacity"
|
||||
NodeFieldConfigSource = "configSource"
|
||||
NodeFieldCreated = "created"
|
||||
NodeFieldExternalID = "externalID"
|
||||
NodeFieldHostname = "hostname"
|
||||
NodeFieldIPAddress = "ipAddress"
|
||||
NodeFieldInfo = "info"
|
||||
NodeFieldLabels = "labels"
|
||||
NodeFieldName = "name"
|
||||
NodeFieldOwnerReferences = "ownerReferences"
|
||||
NodeFieldPhase = "phase"
|
||||
NodeFieldPodCIDR = "podCIDR"
|
||||
NodeFieldProviderID = "providerID"
|
||||
NodeFieldRemoved = "removed"
|
||||
NodeFieldResourcePath = "resourcePath"
|
||||
NodeFieldState = "state"
|
||||
NodeFieldTaints = "taints"
|
||||
NodeFieldTransitioning = "transitioning"
|
||||
NodeFieldTransitioningMessage = "transitioningMessage"
|
||||
NodeFieldUnschedulable = "unschedulable"
|
||||
NodeFieldUuid = "uuid"
|
||||
NodeFieldVolumesAttached = "volumesAttached"
|
||||
NodeFieldVolumesInUse = "volumesInUse"
|
||||
)
|
||||
|
||||
type Node struct {
|
||||
types.Resource
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
ConfigSource *NodeConfigSource `json:"configSource,omitempty"`
|
||||
CreationTimestamp string `json:"creationTimestamp,omitempty"`
|
||||
DeletionTimestamp string `json:"deletionTimestamp,omitempty"`
|
||||
ExternalID string `json:"externalID,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
PodCIDR string `json:"podCIDR,omitempty"`
|
||||
ProviderID string `json:"providerID,omitempty"`
|
||||
Status NodeStatus `json:"status,omitempty"`
|
||||
Taints []Taint `json:"taints,omitempty"`
|
||||
UID string `json:"uid,omitempty"`
|
||||
Unschedulable bool `json:"unschedulable,omitempty"`
|
||||
Allocatable map[string]string `json:"allocatable,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
Capacity map[string]string `json:"capacity,omitempty"`
|
||||
ConfigSource *NodeConfigSource `json:"configSource,omitempty"`
|
||||
Created string `json:"created,omitempty"`
|
||||
ExternalID string `json:"externalID,omitempty"`
|
||||
Hostname string `json:"hostname,omitempty"`
|
||||
IPAddress string `json:"ipAddress,omitempty"`
|
||||
Info *NodeInfo `json:"info,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"`
|
||||
Phase string `json:"phase,omitempty"`
|
||||
PodCIDR string `json:"podCIDR,omitempty"`
|
||||
ProviderID string `json:"providerID,omitempty"`
|
||||
Removed string `json:"removed,omitempty"`
|
||||
ResourcePath string `json:"resourcePath,omitempty"`
|
||||
State string `json:"state,omitempty"`
|
||||
Taints []Taint `json:"taints,omitempty"`
|
||||
Transitioning string `json:"transitioning,omitempty"`
|
||||
TransitioningMessage string `json:"transitioningMessage,omitempty"`
|
||||
Unschedulable *bool `json:"unschedulable,omitempty"`
|
||||
Uuid string `json:"uuid,omitempty"`
|
||||
VolumesAttached map[string]AttachedVolume `json:"volumesAttached,omitempty"`
|
||||
VolumesInUse []string `json:"volumesInUse,omitempty"`
|
||||
}
|
||||
type NodeCollection struct {
|
||||
types.Collection
|
||||
|
@ -6,5 +6,5 @@ const (
|
||||
)
|
||||
|
||||
type NodeDaemonEndpoints struct {
|
||||
KubeletEndpoint DaemonEndpoint `json:"kubeletEndpoint,omitempty"`
|
||||
KubeletEndpoint *DaemonEndpoint `json:"kubeletEndpoint,omitempty"`
|
||||
}
|
||||
|
@ -9,8 +9,8 @@ const (
|
||||
)
|
||||
|
||||
type NodeInfo struct {
|
||||
CPU CPUInfo `json:"cpu,omitempty"`
|
||||
Kubernetes KubernetesInfo `json:"kubernetes,omitempty"`
|
||||
Memory MemoryInfo `json:"memory,omitempty"`
|
||||
OS OSInfo `json:"os,omitempty"`
|
||||
CPU *CPUInfo `json:"cpu,omitempty"`
|
||||
Kubernetes *KubernetesInfo `json:"kubernetes,omitempty"`
|
||||
Memory *MemoryInfo `json:"memory,omitempty"`
|
||||
OS *OSInfo `json:"os,omitempty"`
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user