Skip to content

Commit

Permalink
KEP 1645: update conditions in ServiceExport after KEP-1623
Browse files Browse the repository at this point in the history
Also swap the "2/5 cluster disagree" in the conflict reason so that it's
clear that the disagree sentence is for what we export and not from
the oldest Service that we conflict with.

Signed-off-by: Arthur Outhenin-Chalandre <[email protected]>
  • Loading branch information
MrFreezeex committed May 30, 2024
1 parent 4758de0 commit 773826d
Showing 1 changed file with 6 additions and 25 deletions.
31 changes: 6 additions & 25 deletions keps/sig-multicluster/1645-multi-cluster-services-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -422,42 +422,22 @@ type ServiceExportStatus struct {
// +patchMergeKey=type
// +listType=map
// +listMapKey=type
Conditions []ServiceExportCondition `json:"conditions,omitempty"`
Conditions []metav1.Condition `json:"conditions,omitempty"`
}

// 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"
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 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"`
ServiceExportConflict = "Conflict"
}
```
```yaml
Expand All @@ -471,13 +451,14 @@ status:
- type: Ready
status: "True"
lastTransitionTime: "2020-03-30T01:33:51Z"
- type: InvalidService
- type: Valid
status: "False"
lastTransitionTime: "2020-03-30T01:33:55Z"
reason: "Service type ExternalName is not supported"
- type: Conflict
status: "True"
lastTransitionTime: "2020-03-30T01:33:55Z"
message: "Conflicting type. Using \"ClusterSetIP\" from oldest service export in \"cluster-1\". 2/5 clusters disagree."
reason: "Conflicting type. 2/5 clusters disagree. Using \"ClusterSetIP\" from oldest service export in \"cluster-1\"."
```

To export a service, a `ServiceExport` should be created within the cluster and
Expand Down

0 comments on commit 773826d

Please sign in to comment.