Skip to content

Commit aa87408

Browse files
committed
apis: add ServiceImport condition
Signed-off-by: Arthur Outhenin-Chalandre <[email protected]>
1 parent a23ff80 commit aa87408

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

pkg/apis/v1alpha1/serviceimport.go

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ type ServiceImportStatus struct {
120120
// +listType=map
121121
// +listMapKey=cluster
122122
Clusters []ClusterStatus `json:"clusters,omitempty"`
123+
// +optional
124+
// +patchStrategy=merge
125+
// +patchMergeKey=type
126+
// +listType=map
127+
// +listMapKey=type
128+
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
123129
}
124130

125131
// ClusterStatus contains service configuration mapped to a specific source cluster
@@ -141,3 +147,51 @@ type ServiceImportList struct {
141147
// +listType=set
142148
Items []ServiceImport `json:"items"`
143149
}
150+
151+
// ServiceImportConditionType is a type of condition associated with ServiceExport.
152+
// This type should be used with the ServiceImportStatus.Conditions
153+
// field.
154+
type ServiceImportConditionType string
155+
156+
// ServiceImportConditionReason defines the set of reasons that explain
157+
// why a particular ServiceImport condition type has been raised.
158+
type ServiceImportConditionReason string
159+
160+
const (
161+
// ServiceImportConditionReady is true when the Service Import is ready.
162+
//
163+
//
164+
// Possible reasons for this condition to be true are:
165+
//
166+
// * "Ready"
167+
// * "PartialIPFamilyCompatibility"
168+
//
169+
// Possible reasons for this condition to be False are:
170+
//
171+
// * "Progressing"
172+
// * "PartialIPFamilyCompatibility"
173+
// * "IPFamilyNotSupported"
174+
//
175+
// Controllers may raise this condition with other reasons,
176+
// but should prefer to use the reasons listed above to improve
177+
// interoperability.
178+
ServiceImportConditionReady ServiceImportConditionType = "Ready"
179+
180+
// ServiceImportReasonReady is used with the "Ready" condition when the
181+
// condition is True.
182+
ServiceImportReasonReady ServiceImportConditionReason = "Ready"
183+
184+
// ServiceExportReasonPartialIPFamilyCompatibility is used with the "Ready"
185+
// condition when the local cluster partially supports the imported service
186+
// IP families.
187+
ServiceExportReasonPartialIPFamilyCompatibility ServiceImportConditionReason = "PartialIPFamilyCompatibility"
188+
189+
// ServiceExportReasonProgressing is used with the "Ready" condition when
190+
// the ServiceImport is in the process of being created or updated.
191+
ServiceExportReasonProgressing ServiceImportConditionReason = "ServiceExportReasonProgressing"
192+
193+
// ServiceExportReasonIPFamilyNotSupported is used with the "Ready"
194+
// condition when the service can not be imported due to IP families
195+
// mismatch.
196+
ServiceExportReasonIPFamilyNotSupported ServiceImportConditionReason = "IPFamilyNotSupported"
197+
)

0 commit comments

Comments
 (0)