Skip to content

Commit 70ce6a8

Browse files
committed
fix: change the offline client from seed peer to peer
Signed-off-by: BruceAko <chongzhi@hust.edu.cn>
1 parent 61e0147 commit 70ce6a8

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
lines changed

test/e2e/v2/leave_host_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ var _ = Describe("Clients go offline normally and abnormally", func() {
5858
hostCount := util.Servers[util.SeedClientServerName].Replicas + util.Servers[util.ClientServerName].Replicas
5959
Expect(getHostCountFromScheduler(schedulerClient)).To(Equal(hostCount))
6060

61-
podName, err := util.GetClientPodName()
61+
podName, err := util.GetClientPodName(1)
6262
Expect(err).NotTo(HaveOccurred())
6363

6464
out, err := util.KubeCtlCommand("-n", util.DragonflyNamespace, "delete", "pod", podName).CombinedOutput()
6565
fmt.Println(string(out))
6666
Expect(err).NotTo(HaveOccurred())
6767
Expect(getHostCountFromScheduler(schedulerClient)).To(Equal(hostCount))
6868

69-
podName, err = util.GetClientPodName()
69+
podName, err = util.GetClientPodName(1)
7070
Expect(err).NotTo(HaveOccurred())
7171

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

test/e2e/v2/util/constants.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ var Servers = map[string]server{
5757
Name: ClientServerName,
5858
Namespace: DragonflyNamespace,
5959
LogDirName: "dfdaemon",
60-
Replicas: 1,
60+
Replicas: 2,
6161
},
6262
}

test/e2e/v2/util/exec.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func KubeCtlCopyCommand(ns, pod, source, target string) *exec.Cmd {
103103
}
104104

105105
func ClientExec() (*PodExec, error) {
106-
podName, err := GetClientPodName()
106+
podName, err := GetClientPodName(0)
107107
if err != nil {
108108
return nil, err
109109
}
@@ -126,9 +126,9 @@ func ManagerExec(n int) (*PodExec, error) {
126126
return NewPodExec(DragonflyNamespace, podName, "manager"), nil
127127
}
128128

129-
func GetClientPodName() (string, error) {
129+
func GetClientPodName(n int) (string, error) {
130130
out, err := KubeCtlCommand("-n", DragonflyNamespace, "get", "pod", "-l", "component=client",
131-
"-o", fmt.Sprintf("jsonpath='{range .items[0]}{.metadata.name}{end}'")).CombinedOutput()
131+
"-o", fmt.Sprintf("jsonpath='{range .items[%d]}{.metadata.name}{end}'", n)).CombinedOutput()
132132
if err != nil {
133133
return "", err
134134
}

test/testdata/kind/config-v2.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ networking:
44
ipFamily: dual
55
nodes:
66
- role: control-plane
7+
image: kindest/node:v1.23.4
8+
extraMounts:
9+
- hostPath: ./test/testdata/containerd/config-v2.toml
10+
containerPath: /etc/containerd/config.toml
11+
- hostPath: /tmp/artifact
12+
containerPath: /tmp/artifact
13+
- hostPath: /dev/fuse
14+
containerPath: /dev/fuse
15+
- role: worker
716
image: kindest/node:v1.23.4
817
extraPortMappings:
918
- containerPort: 4001
@@ -22,3 +31,12 @@ nodes:
2231
containerPath: /tmp/artifact
2332
- hostPath: /dev/fuse
2433
containerPath: /dev/fuse
34+
- role: worker
35+
image: kindest/node:v1.23.4
36+
extraMounts:
37+
- hostPath: ./test/testdata/containerd/config-v2.toml
38+
containerPath: /etc/containerd/config.toml
39+
- hostPath: /tmp/artifact
40+
containerPath: /tmp/artifact
41+
- hostPath: /dev/fuse
42+
containerPath: /dev/fuse

0 commit comments

Comments
 (0)