@@ -66,13 +66,17 @@ const (
66
66
// service export has been recognized as valid by an mcs-controller.
67
67
// This will be false if the service is found to be unexportable
68
68
// (ExternalName, not found).
69
+ //
70
+ // Deprecated: use ServiceExportConditionValid instead
69
71
ServiceExportValid = "Valid"
70
72
// ServiceExportConflict means that there is a conflict between two
71
73
// exports for the same Service. When "True", the condition message
72
74
// should contain enough information to diagnose the conflict:
73
75
// field(s) under contention, which cluster won, and why.
74
76
// Users should not expect detailed per-cluster information in the
75
77
// conflict message.
78
+ //
79
+ // Deprecated: use ServiceExportConditionConflict instead
76
80
ServiceExportConflict = "Conflict"
77
81
)
78
82
@@ -88,3 +92,133 @@ type ServiceExportList struct {
88
92
// +listType=set
89
93
Items []ServiceExport `json:"items"`
90
94
}
95
+
96
+ // ServiceExportConditionType is a type of condition associated with ServiceExport.
97
+ // This type should be used with the ServiceExportStatus.Conditions
98
+ // field.
99
+ type ServiceExportConditionType string
100
+
101
+ // ServiceExportConditionReason defines the set of reasons that explain
102
+ // why a particular conflict condition type has been raised.
103
+ type ServiceExportConditionReason string
104
+
105
+ const (
106
+ // ServiceExportConditionValid is true when the Service Export is valid. This does
107
+ // not indicate whether or not the configuration has been exported to
108
+ // a control plane / data plane.
109
+ //
110
+ //
111
+ // Possible reasons for this condition to be true are:
112
+ //
113
+ // * "Valid"
114
+ //
115
+ // Possible reasons for this condition to be False are:
116
+ //
117
+ // * "NoService"
118
+ // * "InvalidServiceType"
119
+ //
120
+ // Controllers may raise this condition with other reasons,
121
+ // but should prefer to use the reasons listed above to improve
122
+ // interoperability.
123
+ ServiceExportConditionValid ServiceExportConditionType = "Valid"
124
+
125
+ // ServiceExportReasonValid is used with the "Valid" condition when the
126
+ // condition is True.
127
+ ServiceExportReasonValid ServiceExportConditionReason = "Valid"
128
+
129
+ // ServiceExportReasonNoService is used with the "Valid" condition when
130
+ // the associated Service does not exist.
131
+ ServiceExportReasonNoService ServiceExportConditionReason = "NoService"
132
+
133
+ // ServiceExportReasonInvalidServiceType is used with the "Valid"
134
+ // condition when the associated Service has an invalid type
135
+ // (per the KEP at least the ExternalName type).
136
+ ServiceExportReasonInvalidServiceType ServiceExportConditionReason = "InvalidServiceType"
137
+ )
138
+
139
+ const (
140
+ // ServiceExportConditionExported is true when the service is exported to some
141
+ // control plane or data plane.
142
+ //
143
+ //
144
+ // Possible reasons for this condition to be true are:
145
+ //
146
+ // * "Exported"
147
+ //
148
+ // Possible reasons for this condition to be False are:
149
+ //
150
+ // * "Invalid"
151
+ // * "Pending"
152
+ //
153
+ // Possible reasons for this condition to be Unknown are:
154
+ //
155
+ // * "Pending"
156
+ //
157
+ // Controllers may raise this condition with other reasons,
158
+ // but should prefer to use the reasons listed above to improve
159
+ // interoperability.
160
+ ServiceExportConditionExported ServiceExportConditionType = "Exported"
161
+
162
+ // ServiceExportReasonExported is used with the "Exported" condition
163
+ // when the condition is True.
164
+ ServiceExportReasonExported ServiceExportConditionReason = "Exported"
165
+
166
+ // ServiceExportReasonInvalid is used with the "Exported" condition
167
+ // when the exported service is invalid and will not be exported.
168
+ ServiceExportReasonInvalid ServiceExportConditionReason = "Invalid"
169
+
170
+ // ServiceExportReasonPending is used with the "Exported" condition
171
+ // when the service is going to be exported.
172
+ ServiceExportReasonPending ServiceExportConditionReason = "Pending"
173
+ )
174
+
175
+ const (
176
+ // ConflictConditionConflict indicates that the controller was unable
177
+ // to resolve conflict for a ServiceExport. This condition must be at
178
+ // least raised on the conflicting ServiceExport and is recommended to
179
+ // be raised on all on all the constituent `ServiceExport`s if feasible.
180
+ //
181
+ //
182
+ // Possible reasons for this condition to be true are:
183
+ //
184
+ // * "PortsConflict"
185
+ // * "TypeConflict"
186
+ // * "SessionAffinityConflict"
187
+ // * "SessionAffinityConfigConflict"
188
+ // * "MultipleConflicts"
189
+ //
190
+ // Possible reasons for this condition to be False are:
191
+ //
192
+ // * "NoConflicts"
193
+ //
194
+ // Controllers may raise this condition with other reasons,
195
+ // but should prefer to use the reasons listed above to improve
196
+ // interoperability.
197
+ ServiceExportConditionConflict ServiceExportConditionType = "Conflict"
198
+
199
+ // ServiceExportReasonPortsConflict is used with the "Conflict" condition
200
+ // when the exported service have a conflict related to ports.
201
+ ServiceExportReasonPortsConflict ServiceExportConditionReason = "PortsConflict"
202
+
203
+ // ServiceExportReasonTypeConflict is used with the "Conflict" condition
204
+ // when the exported service have a conflict related to type.
205
+ ServiceExportReasonTypeConflict ServiceExportConditionReason = "TypeConflict"
206
+
207
+ // ServiceExportReasonSessionAffinityConflict is used with the "Conflict"
208
+ // condition when the exported service have a conflict related to session affinity.
209
+ ServiceExportReasonSessionAffinityConflict ServiceExportConditionReason = "SessionAffinityConflict"
210
+
211
+ // ServiceExportReasonSessionAffinityConfigConflict is used with the
212
+ // "Conflict" condition when the exported service have a conflict related
213
+ // to session affinity config.
214
+ ServiceExportReasonSessionAffinityConfigConflict ServiceExportConditionReason = "SessionAffinityConfigConflict"
215
+
216
+ // ServiceexportReasonMultipleConflicts is used with the "Conflict"
217
+ // condition when the exported service have multiple conflicts if the
218
+ // implementation coalesce those.
219
+ ServiceExportReasonMultipleConflicts ServiceExportConditionReason = "MultipleConflicts"
220
+
221
+ // ServiceExportReasonNoConflicts is used with the "Conflict" condition
222
+ // when the condition is False.
223
+ ServiceExportReasonNoConflicts ServiceExportConditionReason = "NoConflicts"
224
+ )
0 commit comments