Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Lan Liang <gcslyp@gmail.com>
  • Loading branch information
liangyuanpeng committed Jul 23, 2024
1 parent 5b1d300 commit aaa1d06
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci-schedule-compatibility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
schedule:
# Run this workflow "At 20:00 UTC on Sunday and Saturday"
- cron: '0 20 * * 0,6'
pull_request:

jobs:
e2e:
Expand All @@ -13,11 +14,11 @@ jobs:
strategy:
# max-parallel limits the max number of jobs running at the same time.
# We set it to 5 to avoid too many jobs running at the same time, causing the CI to fail because of resource limitations.
max-parallel: 5
max-parallel: 20
fail-fast: false
matrix:
kubeapiserver-version: [ v1.23.4, v1.24.2, v1.25.0, v1.26.0, v1.27.3, v1.28.0, v1.29.0, v1.30.0 ]
karmada-version: [ master, release-1.10, release-1.9, release-1.8 ]
kubeapiserver-version: [ v1.26.0, v1.27.3, v1.28.0, v1.29.0, v1.30.0 ]
karmada-version: [ pr ]
env:
KARMADA_APISERVER_VERSION: ${{ matrix.kubeapiserver-version }}
steps:
Expand All @@ -40,7 +41,6 @@ jobs:
# Number of commits to fetch. 0 indicates all history for all branches and tags.
# We need to guess version via git tags.
fetch-depth: 0
ref: ${{ matrix.karmada-version }}
- name: install Go
uses: actions/setup-go@v5
with:
Expand Down
24 changes: 13 additions & 11 deletions test/e2e/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ import (
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/apimachinery/pkg/util/rand"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/version"
"k8s.io/klog/v2"
"k8s.io/utils/ptr"

clusterv1alpha1 "github.com/karmada-io/karmada/pkg/apis/cluster/v1alpha1"
policyv1alpha1 "github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1"
Expand Down Expand Up @@ -169,22 +167,23 @@ var _ = ginkgo.Describe("[resource-status collection] resource status collection
ginkgo.It("service status collection testing", func() {
svcLoadBalancer := corev1.LoadBalancerStatus{}

vinfo, err := kubeClient.Discovery().ServerVersion()
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
kversion, err := version.ParseSemantic(vinfo.GitVersion)
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
// vinfo, err := kubeClient.Discovery().ServerVersion()
// gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
// kversion, err := version.ParseSemantic(vinfo.GitVersion)
// gomega.Expect(err).ShouldNot(gomega.HaveOccurred())

// simulate the update of the service status in member clusters.
ginkgo.By("Update service status in member clusters", func() {
for index, clusterName := range framework.ClusterNames() {
clusterClient := framework.GetClusterClient(clusterName)
gomega.Expect(clusterClient).ShouldNot(gomega.BeNil())

ingresses := []corev1.LoadBalancerIngress{{IP: fmt.Sprintf("172.19.1.%d", index+6), IPMode: ptr.To(corev1.LoadBalancerIPModeVIP)}}
// TODO: Once karmada-apiserver v1.30 deploy by default,delete the following three lines, see https://github.com/karmada-io/karmada/pull/5141
if kversion.LessThan(version.MustParseSemantic("v1.30.0")) {
ingresses = []corev1.LoadBalancerIngress{{IP: fmt.Sprintf("172.19.1.%d", index+6)}}
}
// ingresses := []corev1.LoadBalancerIngress{{IP: fmt.Sprintf("172.19.1.%d", index+6), IPMode: ptr.To(corev1.LoadBalancerIPModeVIP)}}
// // TODO: Once karmada-apiserver v1.30 deploy by default,delete the following three lines, see https://github.com/karmada-io/karmada/pull/5141
// if kversion.LessThan(version.MustParseSemantic("v1.30.0")) {
// ingresses = []corev1.LoadBalancerIngress{{IP: fmt.Sprintf("172.19.1.%d", index+6)}}
// }
ingresses := []corev1.LoadBalancerIngress{{IP: fmt.Sprintf("172.19.1.%d", index+6)}}
for _, ingress := range ingresses {
svcLoadBalancer.Ingress = append(svcLoadBalancer.Ingress, corev1.LoadBalancerIngress{
IP: ingress.IP,
Expand All @@ -210,6 +209,9 @@ var _ = ginkgo.Describe("[resource-status collection] resource status collection
latestSvc, err := kubeClient.CoreV1().Services(serviceNamespace).Get(context.TODO(), serviceName, metav1.GetOptions{})
g.Expect(err).NotTo(gomega.HaveOccurred())

if len(latestSvc.Status.LoadBalancer.Ingress) > 0 && latestSvc.Status.LoadBalancer.Ingress[0].IPMode != nil {
latestSvc.Status.LoadBalancer.Ingress[0].IPMode = nil
}
klog.Infof("the latest serviceStatus loadBalancer: %v", latestSvc.Status.LoadBalancer)
return reflect.DeepEqual(latestSvc.Status.LoadBalancer, svcLoadBalancer), nil
}, pollTimeout, pollInterval).Should(gomega.Equal(true))
Expand Down

0 comments on commit aaa1d06

Please sign in to comment.