-
Notifications
You must be signed in to change notification settings - Fork 44
apis: conformance: add traffic distribution and internal traffic policies fields #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ import ( | |
| . "github.com/onsi/gomega" | ||
| corev1 "k8s.io/api/core/v1" | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| "k8s.io/utils/ptr" | ||
| "sigs.k8s.io/mcs-api/pkg/apis/v1alpha1" | ||
| ) | ||
|
|
||
|
|
@@ -179,6 +180,38 @@ func testClusterIPServiceImport() { | |
| }) | ||
| }) | ||
|
|
||
| Context("", func() { | ||
| BeforeEach(func() { | ||
| t.helloService.Spec.InternalTrafficPolicy = ptr.To(corev1.ServiceInternalTrafficPolicyCluster) | ||
| }) | ||
| Specify("The InternalTrafficPolicy for a ClusterSetIP ServiceImport should match the exported service's InternalTrafficPolicy", | ||
| Label(RequiredLabel), func() { | ||
| AddReportEntry(SpecRefReportEntry, "https://github.com/kubernetes/enhancements/tree/master/keps/sig-multicluster/1645-multi-cluster-services-api#internal-traffic-policy") | ||
|
|
||
| t.awaitServiceImport(&clients[0], helloServiceName, false, func(g Gomega, serviceImport *v1alpha1.ServiceImport) { | ||
| g.Expect(serviceImport.Spec.InternalTrafficPolicy).To(Equal(t.helloService.Spec.InternalTrafficPolicy), reportNonConformant( | ||
| "The InternalTrafficPolicy of the ServiceImport does not match the exported Service's InternalTrafficPolicy")) | ||
| }) | ||
| }, | ||
| ) | ||
| }) | ||
|
|
||
| Context("", func() { | ||
| BeforeEach(func() { | ||
| t.helloService.Spec.TrafficDistribution = ptr.To(corev1.ServiceTrafficDistributionPreferClose) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As a heads up, this API is in a bit of flux for Service, see KEP-3015 and kubernetes/kubernetes#130844
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be fine no? It's already graduating to stable in kube 1.35 and was already beta/enabled by default in kube 1.34. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is graduating, but also being replaced by PreferSameZone and PreferSameNode is being added for more explicit semantics. |
||
| }) | ||
| Specify("The TrafficDistribution for a ClusterSetIP ServiceImport should match the exported service's TrafficDistribution", | ||
| Label(RequiredLabel), func() { | ||
| AddReportEntry(SpecRefReportEntry, "https://github.com/kubernetes/enhancements/tree/master/keps/sig-multicluster/1645-multi-cluster-services-api#traffic-distribution") | ||
|
|
||
| t.awaitServiceImport(&clients[0], helloServiceName, false, func(g Gomega, serviceImport *v1alpha1.ServiceImport) { | ||
| g.Expect(serviceImport.Spec.TrafficDistribution).To(Equal(t.helloService.Spec.TrafficDistribution), reportNonConformant( | ||
| "The TrafficDistribution of the ServiceImport does not match the exported Service's TrafficDistribution")) | ||
| }) | ||
| }, | ||
| ) | ||
| }) | ||
|
|
||
| Specify("An IP should be allocated for a ClusterSetIP ServiceImport", Label(RequiredLabel), func() { | ||
| AddReportEntry(SpecRefReportEntry, "https://github.com/kubernetes/enhancements/tree/master/keps/sig-multicluster/1645-multi-cluster-services-api#clustersetip") | ||
|
|
||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍