Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
Signed-off-by: zwwhdls <[email protected]>
  • Loading branch information
zwwhdls committed Sep 19, 2024
1 parent fa32e50 commit d1e7bb6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
8 changes: 5 additions & 3 deletions pkg/juicefs/mount/builder/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ var (
Env: []corev1.EnvVar{{
Name: "JFS_FOREGROUND",
Value: "1",
}, {
Name: JfsCommEnv,
Value: "tmp/fuse_fd_csi_comm.sock",
}},
EnvFrom: []corev1.EnvFromSource{{
SecretRef: &corev1.SecretEnvSource{
Expand All @@ -119,6 +116,11 @@ var (
Privileged: &isPrivileged,
RunAsUser: &rootUser,
},
Lifecycle: &corev1.Lifecycle{
PreStop: &corev1.Handler{
Exec: &corev1.ExecAction{Command: []string{"sh", "-c", "+e", fmt.Sprintf("umount %s -l; rmdir %s; exit 0", "/jfs/default-imagenet", "/jfs/default-imagenet")}},
},
},
Ports: []corev1.ContainerPort{
{
Name: "metrics",
Expand Down
6 changes: 0 additions & 6 deletions pkg/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,17 +592,11 @@ func parseClientVersion(ce bool, version string) ClientVersion {

func SupportUpgradeRecreate(ce bool, version string) bool {
v := parseClientVersion(ce, version)
if v.Dev {
return false
}
return supportFusePass(v)
}

func SupportUpgradeBinary(ce bool, version string) bool {
v := parseClientVersion(ce, version)
if v.Dev {
return false
}
return supportUpgradeBinary(v)
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/util/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ func TestClientVersion_SupportFusePass(t *testing.T) {
{
name: "dev",
image: "juicedata/mount:ee-nightly",
want: true,
want: false,
},
{
name: "ce-1.2.1",
Expand All @@ -690,7 +690,7 @@ func TestClientVersion_SupportFusePass(t *testing.T) {
},
{
name: "ee-5.1.0",
image: "juicedata/mount:ee-v5.1.0-xxx",
image: "juicedata/mount:ee-5.1.0-xxx",
want: true,
},
}
Expand Down

0 comments on commit d1e7bb6

Please sign in to comment.