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