This repository has been archived by the owner on May 25, 2021. It is now read-only.
forked from rancher/types
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
74 lines (65 loc) · 1.63 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package schema
import (
"github.com/rancher/norman/types"
m "github.com/rancher/norman/types/mapper"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
var (
handlerMapper = &m.UnionEmbed{
Fields: []m.UnionMapping{
{
FieldName: "exec",
CheckFields: []string{"command"},
},
{
FieldName: "tcpSocket",
CheckFields: []string{"tcp", "port"},
},
{
FieldName: "httpGet",
CheckFields: []string{"port"},
},
},
}
)
type ScalingGroup struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec interface{} `json:"spec"`
Status interface{} `json:"status"`
}
type handlerOverride struct {
TCP bool
}
type EnvironmentFrom struct {
Source string `norman:"type=enum,options=field|resource|configMap|secret"`
SourceName string
SourceKey string
Prefix string
Optional bool
TargetKey string
}
type Scheduling struct {
Node *NodeScheduling
Tolerate []v1.Toleration
Scheduler string
Priority *int64
PriorityClassName string
}
type NodeScheduling struct {
NodeName string `json:"nodeName" norman:"type=reference[/v3/schemas/node]"`
RequireAll []string
RequireAny []string
Preferred []string
}
type projectOverride struct {
types.Namespaced
ProjectID string `norman:"type=reference[/v3/schemas/project],noupdate"`
}
type Target struct {
Addresses []string `json:"addresses"`
NotReadyAddresses []string `json:"notReadyAddresses"`
Port *int32 `json:"port"`
Protocol string `json:"protocol" norman:"type=enum,options=TCP|UDP"`
}