Skip to content

Commit 7dbcbd1

Browse files
committed
apis: reintroduce the existing ServiceExport conflict types
Signed-off-by: Arthur Outhenin-Chalandre <[email protected]>
1 parent 0ad94d6 commit 7dbcbd1

File tree

1 file changed

+34
-28
lines changed

1 file changed

+34
-28
lines changed

pkg/apis/v1alpha1/serviceexport.go

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const (
6767
// This will be false if the service is found to be unexportable
6868
// (ExternalName, not found).
6969
//
70-
// Deprecated: use ServiceExportConditionAccepted instead
70+
// Deprecated: use ServiceExportConditionValid instead
7171
ServiceExportValid = "Valid"
7272
// ServiceExportConflict means that there is a conflict between two
7373
// exports for the same Service. When "True", the condition message
@@ -76,7 +76,7 @@ const (
7676
// Users should not expect detailed per-cluster information in the
7777
// conflict message.
7878
//
79-
// Deprecated: use ServiceExportConditionConflicted instead
79+
// Deprecated: use ServiceExportConditionConflict instead
8080
ServiceExportConflict = "Conflict"
8181
)
8282

@@ -114,14 +114,14 @@ func NewServiceExportCondition(t ServiceExportConditionType, status metav1.Condi
114114
}
115115

116116
const (
117-
// ServiceExportConditionAccepted is true when the Service Export is accepted.
117+
// ServiceExportConditionValid is true when the Service Export is valid.
118118
// This does not indicate whether or not the configuration has been exported
119119
// to a control plane / data plane.
120120
//
121121
//
122122
// Possible reasons for this condition to be true are:
123123
//
124-
// * "Accepted"
124+
// * "Valid"
125125
//
126126
// Possible reasons for this condition to be False are:
127127
//
@@ -131,33 +131,31 @@ const (
131131
// Controllers may raise this condition with other reasons,
132132
// but should prefer to use the reasons listed above to improve
133133
// interoperability.
134-
ServiceExportConditionAccepted ServiceExportConditionType = "Accepted"
134+
ServiceExportConditionValid ServiceExportConditionType = "Valid"
135135

136-
// ServiceExportReasonAccepted is used with the "Accepted" condition when the
136+
// ServiceExportReasonValid is used with the "Valid" condition when the
137137
// condition is True.
138-
ServiceExportReasonAccepted ServiceExportConditionReason = "Accepted"
138+
ServiceExportReasonValid ServiceExportConditionReason = "Valid"
139139

140-
// ServiceExportReasonNoService is used with the "Accepted" condition when
140+
// ServiceExportReasonNoService is used with the "Valid" condition when
141141
// the associated Service does not exist.
142142
ServiceExportReasonNoService ServiceExportConditionReason = "NoService"
143143

144-
// ServiceExportReasonInvalidServiceType is used with the "Accepted"
144+
// ServiceExportReasonInvalidServiceType is used with the "Valid"
145145
// condition when the associated Service has an invalid type
146146
// (per the KEP at least the ExternalName type).
147147
ServiceExportReasonInvalidServiceType ServiceExportConditionReason = "InvalidServiceType"
148148
)
149149

150150
const (
151-
// ServiceExportConditionExported is true when the service is exported to some
152-
// control plane or data plane. This condition might not makes sense
153-
// for every implementation, particularly if they function in a "pull mode"
154-
// rather than actually exporting the service, and in that case implementations
155-
// do not have do use this Condition type at all.
151+
// ServiceExportConditionReady is true when the service is exported
152+
// to some control plane or data plane or ready to be pulled.
156153
//
157154
//
158155
// Possible reasons for this condition to be true are:
159156
//
160157
// * "Exported"
158+
// * "Ready"
161159
//
162160
// Possible reasons for this condition to be False are:
163161
//
@@ -171,24 +169,32 @@ const (
171169
// Controllers may raise this condition with other reasons,
172170
// but should prefer to use the reasons listed above to improve
173171
// interoperability.
174-
ServiceExportConditionExported ServiceExportConditionType = "Exported"
172+
ServiceExportConditionReady ServiceExportConditionType = "Ready"
175173

176-
// ServiceExportReasonExported is used with the "Exported" condition
177-
// when the condition is True.
174+
// ServiceExportReasonExported is used with the "Ready" condition
175+
// when the condition is True and the service has been exported.
176+
// This would be used when an implementation exports a service
177+
// to a control plane or data plane.
178178
ServiceExportReasonExported ServiceExportConditionReason = "Exported"
179179

180-
// ServiceExportReasonPending is used with the "Exported" condition
180+
// ServiceExportReasonReady is used with the "Ready" condition
181+
// when the condition is True and the service has been exported.
182+
// This would typically be used in an implementation that uses a
183+
// pull model.
184+
ServiceExportReasonReady ServiceExportConditionReason = "Ready"
185+
186+
// ServiceExportReasonPending is used with the "Ready" condition
181187
// when the service is in the process of being exported.
182188
ServiceExportReasonPending ServiceExportConditionReason = "Pending"
183189

184-
// ServiceExportReasonFailed is used with the "Exported" condition
190+
// ServiceExportReasonFailed is used with the "Ready" condition
185191
// when the service failed to be exported with the message providing
186192
// the specific reason.
187193
ServiceExportReasonFailed ServiceExportConditionReason = "Failed"
188194
)
189195

190196
const (
191-
// ServiceExportConditionConflicted indicates that some property of an
197+
// ServiceExportConditionConflict indicates that some property of an
192198
// exported service has conflicting values across the constituent
193199
// ServiceExports. This condition must be at least raised on the
194200
// conflicting ServiceExport and is recommended to be raised on all on
@@ -214,40 +220,40 @@ const (
214220
// Controllers may raise this condition with other reasons,
215221
// but should prefer to use the reasons listed above to improve
216222
// interoperability.
217-
ServiceExportConditionConflicted ServiceExportConditionType = "Conflicted"
223+
ServiceExportConditionConflict ServiceExportConditionType = "Conflict"
218224

219-
// ServiceExportReasonPortConflict is used with the "Conflicted" condition
225+
// ServiceExportReasonPortConflict is used with the "Conflict" condition
220226
// when the exported service has a conflict related to port configuration.
221227
// This includes when ports on resulting imported services would have
222228
// duplicated names (including unnamed/empty name) or duplicated
223229
// port/protocol pairs.
224230
ServiceExportReasonPortConflict ServiceExportConditionReason = "PortConflict"
225231

226-
// ServiceExportReasonTypeConflict is used with the "Conflicted" condition
232+
// ServiceExportReasonTypeConflict is used with the "Conflict" condition
227233
// when the exported service has a conflict related to the service type
228234
// (eg headless vs non-headless).
229235
ServiceExportReasonTypeConflict ServiceExportConditionReason = "TypeConflict"
230236

231-
// ServiceExportReasonSessionAffinityConflict is used with the "Conflicted"
237+
// ServiceExportReasonSessionAffinityConflict is used with the "Conflict"
232238
// condition when the exported service has a conflict related to session affinity.
233239
ServiceExportReasonSessionAffinityConflict ServiceExportConditionReason = "SessionAffinityConflict"
234240

235241
// ServiceExportReasonSessionAffinityConfigConflict is used with the
236-
// "Conflicted" condition when the exported service has a conflict related
242+
// "Conflict" condition when the exported service has a conflict related
237243
// to session affinity config.
238244
ServiceExportReasonSessionAffinityConfigConflict ServiceExportConditionReason = "SessionAffinityConfigConflict"
239245

240-
// ServiceExportReasonLabelsConflict is used with the "Conflicted"
246+
// ServiceExportReasonLabelsConflict is used with the "Conflict"
241247
// condition when the ServiceExport has a conflict related to exported
242248
// labels.
243249
ServiceExportReasonLabelsConflict ServiceExportConditionReason = "LabelsConflict"
244250

245-
// ServiceExportReasonAnnotationsConflict is used with the "Conflicted"
251+
// ServiceExportReasonAnnotationsConflict is used with the "Conflict"
246252
// condition when the ServiceExport has a conflict related to exported
247253
// annotations.
248254
ServiceExportReasonAnnotationsConflict ServiceExportConditionReason = "AnnotationsConflict"
249255

250-
// ServiceExportReasonNoConflicts is used with the "Conflicted" condition
256+
// ServiceExportReasonNoConflicts is used with the "Conflict" condition
251257
// when the condition is False.
252258
ServiceExportReasonNoConflicts ServiceExportConditionReason = "NoConflicts"
253259
)

0 commit comments

Comments
 (0)