Skip to content

Commit 042a670

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

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

pkg/apis/v1alpha1/serviceimport.go

Lines changed: 45 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,42 @@ type ServiceImportList struct {
141147
// +listType=set
142148
Items []ServiceImport `json:"items"`
143149
}
150+
151+
const (
152+
// ServiceImportConditionReady is true when the Service Import is ready.
153+
//
154+
//
155+
// Possible reasons for this condition to be true are:
156+
//
157+
// * "Ready"
158+
// * "PartialIPFamilyCompatibility"
159+
//
160+
// Possible reasons for this condition to be False are:
161+
//
162+
// * "Progressing"
163+
// * "PartialIPFamilyCompatibility"
164+
// * "IPFamilyNotSupported"
165+
//
166+
// Controllers may raise this condition with other reasons,
167+
// but should prefer to use the reasons listed above to improve
168+
// interoperability.
169+
ServiceImportConditionReady = "Ready"
170+
171+
// ServiceImportReasonReady is used with the "Ready" condition when the
172+
// condition is True.
173+
ServiceImportReasonReady = "Ready"
174+
175+
// ServiceExportReasonPartialIPFamilyCompatibility is used with the "Ready"
176+
// condition when the local cluster partially supports the imported service
177+
// IP families.
178+
ServiceExportReasonPartialIPFamilyCompatibility = "PartialIPFamilyCompatibility"
179+
180+
// ServiceExportReasonProgressing is used with the "Ready" condition when
181+
// the ServiceImport is in the process of being created or updated.
182+
ServiceExportReasonProgressing = "Progressing"
183+
184+
// ServiceExportReasonIPFamilyNotSupported is used with the "Ready"
185+
// condition when the service can not be imported due to IP families
186+
// mismatch.
187+
ServiceExportReasonIPFamilyNotSupported = "IPFamilyNotSupported"
188+
)

0 commit comments

Comments
 (0)