From 9620adecd2390c74a67257795e34eb3fa03c6946 Mon Sep 17 00:00:00 2001 From: Arthur Outhenin-Chalandre Date: Thu, 26 Jun 2025 16:09:52 +0200 Subject: [PATCH] KEP 1645: updates ServiceExport conditions ServiceExport conditions in the KEP are not reflecting what's actually done in the CRD as this predates the addition of the Condition type in Kubernetes. This commit essentially put back all the condition types that we actually have in MCS-API code and change the reference in the example (the regular kubernetes type requires a message to be added!) Signed-off-by: Arthur Outhenin-Chalandre --- .../1645-multi-cluster-services-api/README.md | 59 +++++++------------ 1 file changed, 21 insertions(+), 38 deletions(-) diff --git a/keps/sig-multicluster/1645-multi-cluster-services-api/README.md b/keps/sig-multicluster/1645-multi-cluster-services-api/README.md index 689daaee3cb..4ce6a0ed07b 100644 --- a/keps/sig-multicluster/1645-multi-cluster-services-api/README.md +++ b/keps/sig-multicluster/1645-multi-cluster-services-api/README.md @@ -435,43 +435,23 @@ type ServiceExportStatus struct { // +patchMergeKey=type // +listType=map // +listMapKey=type - Conditions []ServiceExportCondition `json:"conditions,omitempty"` + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` } -// ServiceExportConditionType identifies a specific condition. -type ServiceExportConditionType string - -const { - // ServiceExportValid means that the service referenced by this - // service export has been recognized as valid by an mcs-controller. - // This will be false if the service is found to be unexportable - // (ExternalName, not found). - ServiceExportValid ServiceExportConditionType = "Valid" - // ServiceExportConflict means that there is a conflict between two - // exports for the same Service. When "True", the condition message - // should contain enough information to diagnose the conflict: - // field(s) under contention, which cluster won, and why. - // Users should not expect detailed per-cluster information in the - // conflict message. - ServiceExportConflict ServiceExportConditionType = "Conflict" -} - -// ServiceExportCondition contains details for the current condition of this -// service export. -// -// Once KEP-1623 (sig-api-machinery/1623-standardize-conditions) is -// implemented, this will be replaced by metav1.Condition. -type ServiceExportCondition struct { - Type ServiceExportConditionType `json:"type"` - // Status is one of {"True", "False", "Unknown"} - Status corev1.ConditionStatus `json:"status"` - // +optional - LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` - // +optional - Reason *string `json:"reason,omitempty"` - // +optional - Message *string `json:"message,omitempty"` -} +const ( + // ServiceExportValid means that the service referenced by this + // service export has been recognized as valid by an mcs-controller. + // This will be false if the service is found to be unexportable + // (ExternalName, not found). + ServiceExportValid = "Valid" + // ServiceExportConflict means that there is a conflict between two + // exports for the same Service. When "True", the condition message + // should contain enough information to diagnose the conflict: + // field(s) under contention, which cluster won, and why. + // Users should not expect detailed per-cluster information in the + // conflict message. + ServiceExportConflict = "Conflict" +) ``` ```yaml apiVersion: multicluster.k8s.io/v1alpha1 @@ -483,9 +463,11 @@ status: conditions: - type: Ready status: "True" + message: "Service export is ready" lastTransitionTime: "2020-03-30T01:33:51Z" - - type: InvalidService - status: "False" + - type: Valid + status: "True" + message: "Service export is valid" lastTransitionTime: "2020-03-30T01:33:55Z" - type: Conflict status: "True" @@ -704,7 +686,8 @@ this cluster. complicate deployments by even attempting to stretch them across clusters. Instead, regular `ExternalName` type `Services` should be created in each cluster individually. If a `ServiceExport` is created for an `ExternalName` - service, an `InvalidService` condition will be set on the export. + service, a condition type `Valid` with a `false` status will be set on the + `ServiceExport`. #### ClusterSetIP