From be300159e70842c150941b77df1a180bd3a84e2a Mon Sep 17 00:00:00 2001 From: cheyang Date: Thu, 3 Feb 2022 12:10:56 +0800 Subject: [PATCH] Build docker image (#1409) * Build docker image, To #37688693 Signed-off-by: cheyang * Build docker image, To #37688693 Signed-off-by: cheyang --- charts/fluid/fluid/Chart.yaml | 2 +- charts/fluid/fluid/values.yaml | 20 ++++---- pkg/utils/kubeclient/daemonset_test.go | 65 ++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 11 deletions(-) create mode 100644 pkg/utils/kubeclient/daemonset_test.go diff --git a/charts/fluid/fluid/Chart.yaml b/charts/fluid/fluid/Chart.yaml index f59d8c3569a..9df641847de 100644 --- a/charts/fluid/fluid/Chart.yaml +++ b/charts/fluid/fluid/Chart.yaml @@ -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-935578a +appVersion: 0.7.0-6997fad home: https://github.com/fluid-cloudnative/fluid keywords: - category:data diff --git a/charts/fluid/fluid/values.yaml b/charts/fluid/fluid/values.yaml index 407bb818dd4..b3541a24891 100644 --- a/charts/fluid/fluid/values.yaml +++ b/charts/fluid/fluid/values.yaml @@ -6,7 +6,7 @@ workdir: /tmp dataset: controller: - image: fluidcloudnative/dataset-controller:v0.7.0-935578a + image: fluidcloudnative/dataset-controller:v0.7.0-6997fad csi: recoverFusePeriod: -1 @@ -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-935578a + image: fluidcloudnative/fluid-csi:v0.7.0-6997fad kubelet: rootDir: /var/lib/kubelet @@ -28,9 +28,9 @@ runtime: portRange: 20000-26000 enabled: true init: - image: fluidcloudnative/init-users:v0.7.0-935578a + image: fluidcloudnative/init-users:v0.7.0-6997fad controller: - image: fluidcloudnative/alluxioruntime-controller:v0.7.0-935578a + image: fluidcloudnative/alluxioruntime-controller:v0.7.0-6997fad runtime: image: registry.aliyuncs.com/alluxio/alluxio:release-2.7.2-SNAPSHOT-3714f2b fuse: @@ -44,19 +44,19 @@ runtime: fuse: image: registry.cn-shanghai.aliyuncs.com/jindofs/jindo-fuse:3.8.0 controller: - image: fluidcloudnative/jindoruntime-controller:v0.7.0-935578a + image: fluidcloudnative/jindoruntime-controller:v0.7.0-6997fad init: portCheck: enabled: false - image: fluidcloudnative/init-users:v0.7.0-935578a + image: fluidcloudnative/init-users:v0.7.0-6997fad goosefs: runtimeWorkers: 3 portRange: 26000-32000 enabled: false init: - image: fluidcloudnative/init-users:v0.7.0-935578a + image: fluidcloudnative/init-users:v0.7.0-6997fad controller: - image: fluidcloudnative/goosefsruntime-controller:v0.7.0-935578a + image: fluidcloudnative/goosefsruntime-controller:v0.7.0-6997fad runtime: image: ccr.ccs.tencentyun.com/qcloud/goosefs:v1.1.0-kona_jdk11 fuse: @@ -64,12 +64,12 @@ runtime: juicefs: enabled: false controller: - image: fluidcloudnative/juicefsruntime-controller:v0.7.0-935578a + image: fluidcloudnative/juicefsruntime-controller:v0.7.0-6997fad fuse: image: juicedata/juicefs-csi-driver:v0.11.0 webhook: enabled: true - image: fluidcloudnative/fluid-webhook:v0.7.0-935578a + image: fluidcloudnative/fluid-webhook:v0.7.0-6997fad replicas: 1 diff --git a/pkg/utils/kubeclient/daemonset_test.go b/pkg/utils/kubeclient/daemonset_test.go new file mode 100644 index 00000000000..213e4fc48fb --- /dev/null +++ b/pkg/utils/kubeclient/daemonset_test.go @@ -0,0 +1,65 @@ +/* +Copyright 2021 The Fluid Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package kubeclient + +import ( + "testing" + + "github.com/fluid-cloudnative/fluid/pkg/utils/fake" + appsv1 "k8s.io/api/apps/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +func TestGetDaemonset(t *testing.T) { + name := "test" + namespace := "default" + ds := &appsv1.DaemonSet{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Namespace: namespace, + }, + Spec: appsv1.DaemonSetSpec{}, + Status: appsv1.DaemonSetStatus{ + NumberUnavailable: 1, + NumberReady: 1, + }, + } + + objs := []runtime.Object{} + objs = append(objs, ds.DeepCopy()) + s := runtime.NewScheme() + _ = appsv1.AddToScheme(s) + fakeClient := fake.NewFakeClientWithScheme(s, objs...) + + _, err := GetDaemonset(fakeClient, name, namespace) + if err != nil { + t.Errorf("failed to call GetDaemonset due to %v with name %s and namespace %s", + err, + name, + namespace) + } + + _, err = GetDaemonset(fakeClient, "notFound", namespace) + if err == nil { + t.Errorf("failed to call GetDaemonset due to %v with name %s and namespace %s", + err, + name, + namespace) + } + +}