Skip to content

Commit 3df40dc

Browse files
committed
fix: list hosts
Signed-off-by: BruceAko <chongzhi@hust.edu.cn>
1 parent b9cf420 commit 3df40dc

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

.github/workflows/e2e-v2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ permissions:
1616
env:
1717
KIND_VERSION: v0.12.0
1818
CONTAINERD_VERSION: v1.5.2
19-
KIND_CONFIG_PATH: test/testdata/kind/config-v2.yaml
19+
KIND_CONFIG_PATH: test/testdata/kind/config-v2-nydus.yaml
2020
DRAGONFLY_CHARTS_PATH: deploy/helm-charts/charts/dragonfly
2121
DRAGONFLY_FILE_SERVER_PATH: test/testdata/k8s/file-server.yaml
2222

pkg/rpc/scheduler/client/client_v2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ func (v *v2) ListHosts(ctx context.Context, opts ...grpc.CallOption) (*scheduler
260260
defer cancel()
261261

262262
return v.SchedulerClient.ListHosts(
263-
context.WithValue(ctx, pkgbalancer.ContextKey, ""),
263+
context.WithValue(ctx, pkgbalancer.ContextKey, "123"),
264264
new(emptypb.Empty),
265265
opts...,
266266
)

scheduler/service/service_v2.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,10 @@ func (v *V2) ListHosts(ctx context.Context) (*schedulerv2.ListHostsResponse, err
769769
DisableShared: host.DisableShared,
770770
}
771771
}
772+
resHosts = append(resHosts, &commonv2.Host{
773+
Id: "我自己添加的",
774+
Type: uint32(len(hosts)),
775+
})
772776

773777
resp := &schedulerv2.ListHostsResponse{
774778
Hosts: resHosts,

test/e2e/v2/leave_host_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ var _ = Describe("Clients go offline normally and abnormally", func() {
6060
fmt.Println("hostCount:", hostCount, getHostCountFromScheduler(schedulerClient))
6161
//Expect(getHostCountFromScheduler(schedulerClient)).To(Equal(hostCount))
6262

63-
podName, err := util.GetClientPodName(1)
63+
podName, err := util.GetClientPodName(0)
6464
Expect(err).NotTo(HaveOccurred())
6565

6666
out, err := util.KubeCtlCommand("-n", util.DragonflyNamespace, "delete", "pod", podName).CombinedOutput()
@@ -69,7 +69,7 @@ var _ = Describe("Clients go offline normally and abnormally", func() {
6969
fmt.Println("hostCount:", hostCount, getHostCountFromScheduler(schedulerClient))
7070
//Expect(getHostCountFromScheduler(schedulerClient)).To(Equal(hostCount))
7171

72-
podName, err = util.GetClientPodName(1)
72+
podName, err = util.GetClientPodName(0)
7373
Expect(err).NotTo(HaveOccurred())
7474

7575
out, err = util.KubeCtlCommand("-n", util.DragonflyNamespace, "delete", "pod", podName, "--force", "--grace-period=0").CombinedOutput()

0 commit comments

Comments
 (0)