Skip to content

Commit

Permalink
Merge 172233e into be30015
Browse files Browse the repository at this point in the history
  • Loading branch information
cheyang authored Feb 3, 2022
2 parents be30015 + 172233e commit 9053844
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 16 deletions.
2 changes: 1 addition & 1 deletion charts/fluid/fluid/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ version: 0.7.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 0.7.0-6997fad
appVersion: 0.7.0-73135a0
home: https://github.com/fluid-cloudnative/fluid
keywords:
- category:data
Expand Down
20 changes: 10 additions & 10 deletions charts/fluid/fluid/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ workdir: /tmp

dataset:
controller:
image: fluidcloudnative/dataset-controller:v0.7.0-6997fad
image: fluidcloudnative/dataset-controller:v0.7.0-73135a0

csi:
recoverFusePeriod: -1
Expand All @@ -15,7 +15,7 @@ csi:
registrar:
image: registry.aliyuncs.com/acs/csi-node-driver-registrar:v1.2.0
plugins:
image: fluidcloudnative/fluid-csi:v0.7.0-6997fad
image: fluidcloudnative/fluid-csi:v0.7.0-73135a0
kubelet:
rootDir: /var/lib/kubelet

Expand All @@ -28,9 +28,9 @@ runtime:
portRange: 20000-26000
enabled: true
init:
image: fluidcloudnative/init-users:v0.7.0-6997fad
image: fluidcloudnative/init-users:v0.7.0-73135a0
controller:
image: fluidcloudnative/alluxioruntime-controller:v0.7.0-6997fad
image: fluidcloudnative/alluxioruntime-controller:v0.7.0-73135a0
runtime:
image: registry.aliyuncs.com/alluxio/alluxio:release-2.7.2-SNAPSHOT-3714f2b
fuse:
Expand All @@ -44,32 +44,32 @@ runtime:
fuse:
image: registry.cn-shanghai.aliyuncs.com/jindofs/jindo-fuse:3.8.0
controller:
image: fluidcloudnative/jindoruntime-controller:v0.7.0-6997fad
image: fluidcloudnative/jindoruntime-controller:v0.7.0-73135a0
init:
portCheck:
enabled: false
image: fluidcloudnative/init-users:v0.7.0-6997fad
image: fluidcloudnative/init-users:v0.7.0-73135a0
goosefs:
runtimeWorkers: 3
portRange: 26000-32000
enabled: false
init:
image: fluidcloudnative/init-users:v0.7.0-6997fad
image: fluidcloudnative/init-users:v0.7.0-73135a0
controller:
image: fluidcloudnative/goosefsruntime-controller:v0.7.0-6997fad
image: fluidcloudnative/goosefsruntime-controller:v0.7.0-73135a0
runtime:
image: ccr.ccs.tencentyun.com/qcloud/goosefs:v1.1.0-kona_jdk11
fuse:
image: ccr.ccs.tencentyun.com/qcloud/goosefs:v1.1.0-kona_jdk11
juicefs:
enabled: false
controller:
image: fluidcloudnative/juicefsruntime-controller:v0.7.0-6997fad
image: fluidcloudnative/juicefsruntime-controller:v0.7.0-73135a0
fuse:
image: juicedata/juicefs-csi-driver:v0.11.0

webhook:
enabled: true
image: fluidcloudnative/fluid-webhook:v0.7.0-6997fad
image: fluidcloudnative/fluid-webhook:v0.7.0-73135a0
replicas: 1

7 changes: 3 additions & 4 deletions pkg/ddc/base/runtime_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,12 @@ func (info *RuntimeInfo) getFuseDaemonset() (ds *appsv1.DaemonSet, err error) {
return
}

chartName := ""
var fuseName string
switch info.runtimeType {
case common.JindoRuntime:
chartName = common.JindoChartName
fuseName = info.name + "-" + common.JindoChartName + "-fuse"
default:
chartName = info.runtimeType
fuseName = info.name + "-fuse"
}
fuseName := info.name + "-" + chartName + "-fuse"
return kubeclient.GetDaemonset(info.client, fuseName, info.GetNamespace())
}
82 changes: 81 additions & 1 deletion pkg/ddc/base/runtime_helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
datav1alpha1 "github.com/fluid-cloudnative/fluid/api/v1alpha1"
"github.com/fluid-cloudnative/fluid/pkg/common"
"github.com/fluid-cloudnative/fluid/pkg/utils/fake"
"sigs.k8s.io/controller-runtime/pkg/client"

appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -196,7 +197,7 @@ func TestGetTemplateToInjectForFuse(t *testing.T) {
},
fuse: &appsv1.DaemonSet{
ObjectMeta: metav1.ObjectMeta{
Name: "dataset1-alluxio-fuse",
Name: "dataset1-fuse",
Namespace: "big-data",
},
Spec: appsv1.DaemonSetSpec{
Expand Down Expand Up @@ -500,3 +501,82 @@ func TestGetTemplateToInjectForFuse(t *testing.T) {
}
}
}

func TestGetFuseDaemonset(t *testing.T) {
type testCase struct {
name string
namespace string
runtimeType string
ds *appsv1.DaemonSet
setClient bool
wantErr bool
}

tests := []testCase{
{
name: "alluxio",
namespace: "default",
runtimeType: common.ALLUXIO_RUNTIME,
ds: &appsv1.DaemonSet{
ObjectMeta: metav1.ObjectMeta{
Name: "alluxio-fuse",
Namespace: "default",
},
},
setClient: true,
wantErr: false,
}, {
name: "jindo",
namespace: "default",
runtimeType: common.JindoRuntime,
ds: &appsv1.DaemonSet{
ObjectMeta: metav1.ObjectMeta{
Name: "jindo-jindofs-fuse",
Namespace: "default",
},
},
setClient: true,
wantErr: false,
}, {
name: "noclient",
namespace: "default",
runtimeType: common.JindoRuntime,
ds: &appsv1.DaemonSet{
ObjectMeta: metav1.ObjectMeta{
Name: "jindo-jindofs-fuse",
Namespace: "default",
},
},
setClient: false,
wantErr: true,
},
}

for _, test := range tests {
var fakeClient client.Client
if test.setClient {
objs := []runtime.Object{}
s := runtime.NewScheme()
_ = corev1.AddToScheme(s)
_ = datav1alpha1.AddToScheme(s)
_ = appsv1.AddToScheme(s)
objs = append(objs, test.ds)
fakeClient = fake.NewFakeClientWithScheme(s, objs...)
}

runtimeInfo := RuntimeInfo{
name: test.name,
namespace: test.namespace,
runtimeType: test.runtimeType,
}

if fakeClient != nil {
runtimeInfo.SetClient(fakeClient)
}

_, err := runtimeInfo.getFuseDaemonset()
if (err == nil) == test.wantErr {
t.Errorf("testcase %s is failed, want err %v, got err %v", test.name, test.wantErr, err)
}
}
}

0 comments on commit 9053844

Please sign in to comment.