diff --git a/.github/workflows/e2e-v2.yml b/.github/workflows/e2e-v2.yml index c68f33b9ad8..e7cb3ec4587 100644 --- a/.github/workflows/e2e-v2.yml +++ b/.github/workflows/e2e-v2.yml @@ -16,7 +16,7 @@ permissions: env: KIND_VERSION: v0.12.0 CONTAINERD_VERSION: v1.5.2 - KIND_CONFIG_PATH: test/testdata/kind/config-v2.yaml + KIND_CONFIG_PATH: test/testdata/kind/config-v2-nydus.yaml DRAGONFLY_CHARTS_PATH: deploy/helm-charts/charts/dragonfly DRAGONFLY_FILE_SERVER_PATH: test/testdata/k8s/file-server.yaml @@ -113,10 +113,6 @@ jobs: config: ${{ env.KIND_CONFIG_PATH }} cluster_name: kind - - name: Add taint to node - run: | - kubectl taint nodes kind-worker2 key=value:NoSchedule - - name: Setup dragonfly run: | helm install --wait --timeout 15m --dependency-update --create-namespace --namespace dragonfly-system -f ${{ matrix.charts-config }} dragonfly ${{ env.DRAGONFLY_CHARTS_PATH }} diff --git a/pkg/rpc/scheduler/client/client_v2.go b/pkg/rpc/scheduler/client/client_v2.go index 0044178c7e2..c5e99b0f0bc 100644 --- a/pkg/rpc/scheduler/client/client_v2.go +++ b/pkg/rpc/scheduler/client/client_v2.go @@ -260,7 +260,7 @@ func (v *v2) ListHosts(ctx context.Context, opts ...grpc.CallOption) (*scheduler defer cancel() return v.SchedulerClient.ListHosts( - context.WithValue(ctx, pkgbalancer.ContextKey, ""), + context.WithValue(ctx, pkgbalancer.ContextKey, "123"), new(emptypb.Empty), opts..., ) diff --git a/scheduler/service/service_v2.go b/scheduler/service/service_v2.go index c3dbadf0806..bfad95c6664 100644 --- a/scheduler/service/service_v2.go +++ b/scheduler/service/service_v2.go @@ -769,6 +769,10 @@ func (v *V2) ListHosts(ctx context.Context) (*schedulerv2.ListHostsResponse, err DisableShared: host.DisableShared, } } + resHosts = append(resHosts, &commonv2.Host{ + Id: "我自己添加的", + Type: uint32(len(hosts)), + }) resp := &schedulerv2.ListHostsResponse{ Hosts: resHosts, diff --git a/test/e2e/v2/leave_host_test.go b/test/e2e/v2/leave_host_test.go index 1480c28c6e3..95d8c13aecf 100644 --- a/test/e2e/v2/leave_host_test.go +++ b/test/e2e/v2/leave_host_test.go @@ -60,7 +60,7 @@ var _ = Describe("Clients go offline normally and abnormally", func() { fmt.Println("hostCount:", hostCount, getHostCountFromScheduler(schedulerClient)) //Expect(getHostCountFromScheduler(schedulerClient)).To(Equal(hostCount)) - podName, err := util.GetClientPodName(1) + podName, err := util.GetClientPodName(0) Expect(err).NotTo(HaveOccurred()) out, err := util.KubeCtlCommand("-n", util.DragonflyNamespace, "delete", "pod", podName).CombinedOutput() @@ -69,7 +69,7 @@ var _ = Describe("Clients go offline normally and abnormally", func() { fmt.Println("hostCount:", hostCount, getHostCountFromScheduler(schedulerClient)) //Expect(getHostCountFromScheduler(schedulerClient)).To(Equal(hostCount)) - podName, err = util.GetClientPodName(1) + podName, err = util.GetClientPodName(0) Expect(err).NotTo(HaveOccurred()) out, err = util.KubeCtlCommand("-n", util.DragonflyNamespace, "delete", "pod", podName, "--force", "--grace-period=0").CombinedOutput() diff --git a/test/testdata/charts/config-v2.yaml b/test/testdata/charts/config-v2.yaml index 6ab98298194..b38b563daec 100644 --- a/test/testdata/charts/config-v2.yaml +++ b/test/testdata/charts/config-v2.yaml @@ -45,7 +45,7 @@ scheduler: memory: "4Gi" service: type: NodePort - nodePort: 30802 + nodePort: 30804 extraVolumeMounts: - name: logs mountPath: "/var/log/" diff --git a/test/testdata/kind/config-v2-nydus.yaml b/test/testdata/kind/config-v2-nydus.yaml index 030b79c88b0..28eb5f1aa5b 100644 --- a/test/testdata/kind/config-v2-nydus.yaml +++ b/test/testdata/kind/config-v2-nydus.yaml @@ -12,8 +12,8 @@ nodes: - containerPort: 4003 hostPort: 4003 protocol: TCP - - containerPort: 30802 - hostPort: 8002 + - containerPort: 30804 + hostPort: 8004 protocol: TCP extraMounts: - hostPath: ./test/testdata/containerd/config-v2.toml diff --git a/test/testdata/kind/config-v2.yaml b/test/testdata/kind/config-v2.yaml index 772a8be4351..ed88f0b4cbe 100644 --- a/test/testdata/kind/config-v2.yaml +++ b/test/testdata/kind/config-v2.yaml @@ -21,8 +21,8 @@ nodes: - containerPort: 4003 hostPort: 4003 protocol: TCP - - containerPort: 30802 - hostPort: 8002 + - containerPort: 30804 + hostPort: 8004 protocol: TCP extraMounts: - hostPath: ./test/testdata/containerd/config-v2.toml