...
1 package api
2
3 import (
4 conditions "github.com/openshift/custom-resource-status/conditions/v1"
5 corev1 "k8s.io/api/core/v1"
6 )
7
8
9 type Phase string
10
11 const (
12
13 PhaseDeploying Phase = "Deploying"
14
15
16 PhaseDeployed Phase = "Deployed"
17
18
19 PhaseDeleting Phase = "Deleting"
20
21
22 PhaseDeleted Phase = "Deleted"
23
24
25 PhaseError Phase = "Error"
26
27
28 PhaseUpgrading Phase = "Upgrading"
29
30
31 PhaseEmpty Phase = ""
32 )
33
34
35 type Status struct {
36 Phase Phase `json:"phase,omitempty"`
37
38 Conditions []conditions.Condition `json:"conditions,omitempty" optional:"true"`
39
40 OperatorVersion string `json:"operatorVersion,omitempty" optional:"true"`
41
42 TargetVersion string `json:"targetVersion,omitempty" optional:"true"`
43
44 ObservedVersion string `json:"observedVersion,omitempty" optional:"true"`
45 }
46
47
48
49 type NodePlacement struct {
50
51
52
53
54
55
56
57 NodeSelector map[string]string `json:"nodeSelector,omitempty"`
58
59
60
61
62
63
64
65 Affinity *corev1.Affinity `json:"affinity,omitempty"`
66
67
68
69
70
71
72 Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
73 }
74
75
76 func (in *Status) DeepCopyInto(out *Status) {
77 *out = *in
78 if in.Conditions != nil {
79 in, out := &in.Conditions, &out.Conditions
80 *out = make([]conditions.Condition, len(*in))
81 for i := range *in {
82 (*in)[i].DeepCopyInto(&(*out)[i])
83 }
84 }
85 }
86
87
88 func (in *NodePlacement) DeepCopyInto(out *NodePlacement) {
89 *out = *in
90 if in.NodeSelector != nil {
91 in, out := &in.NodeSelector, &out.NodeSelector
92 *out = make(map[string]string, len(*in))
93 for key, val := range *in {
94 (*out)[key] = val
95 }
96 }
97 if in.Affinity != nil {
98 in, out := &in.Affinity, &out.Affinity
99 *out = new(corev1.Affinity)
100 (*in).DeepCopyInto(*out)
101 }
102 if in.Tolerations != nil {
103 in, out := &in.Tolerations, &out.Tolerations
104 *out = make([]corev1.Toleration, len(*in))
105 for i := range *in {
106 (*in)[i].DeepCopyInto(&(*out)[i])
107 }
108 }
109 return
110 }
111
112
113 func (in *NodePlacement) DeepCopy() *NodePlacement {
114 if in == nil {
115 return nil
116 }
117 out := new(NodePlacement)
118 in.DeepCopyInto(out)
119 return out
120 }
121
122
123 func (NodePlacement) SwaggerDoc() map[string]string {
124 return map[string]string{
125 "": "NodePlacement describes node scheduling configuration.",
126 "nodeSelector": "nodeSelector is the node selector applied to the relevant kind of pods\nIt specifies a map of key-value pairs: for the pod to be eligible to run on a node,\nthe node must have each of the indicated key-value pairs as labels\n(it can have additional labels as well).\nSee https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector\n+kubebuilder:validation:Optional\n+optional",
127 "affinity": "affinity enables pod affinity/anti-affinity placement expanding the types of constraints\nthat can be expressed with nodeSelector.\naffinity is going to be applied to the relevant kind of pods in parallel with nodeSelector\nSee https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity\n+kubebuilder:validation:Optional\n+optional",
128 "tolerations": "tolerations is a list of tolerations applied to the relevant kind of pods\nSee https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ for more info.\nThese are additional tolerations other than default ones.\n+kubebuilder:validation:Optional\n+optional",
129 }
130 }
131
View as plain text