From 61035ae126a6729a99f8688bba1259b10d2ea3ea Mon Sep 17 00:00:00 2001 From: shubham Date: Mon, 12 Jul 2021 18:18:14 +0530 Subject: [PATCH] fix sanity test Signed-off-by: shubham --- .github/workflows/build.yaml | 3 ++- cmd/manager/main.go | 2 +- deploy/hostpath-sc.yaml | 24 ++++++++++++++++++++++++ pkg/controllers/jivavolume_controller.go | 4 ++-- 4 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 deploy/hostpath-sc.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5de984f..a4d9ce8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -106,7 +106,8 @@ jobs: - name: Running tests run: | - kubectl apply -f https://raw.githubusercontent.com/openebs/openebs/master/k8s/openebs-operator.yaml + kubectl apply -f https://openebs.github.io/charts/hostpath-operator.yaml + kubectl apply -f deploy/hostpath-sc.yaml kubectl apply -f deploy/operator.yaml kubectl apply -f deploy/jiva-csi.yaml ./ci/ci.sh diff --git a/cmd/manager/main.go b/cmd/manager/main.go index 792ed62..b03d6e8 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -78,7 +78,7 @@ func main() { os.Exit(1) } - duration := 5 * time.Second + duration := 30 * time.Second mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ Scheme: scheme, diff --git a/deploy/hostpath-sc.yaml b/deploy/hostpath-sc.yaml new file mode 100644 index 0000000..a34eb02 --- /dev/null +++ b/deploy/hostpath-sc.yaml @@ -0,0 +1,24 @@ +#Sample storage classes for OpenEBS Local PV +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: openebs-hostpath + annotations: + openebs.io/cas-type: local + cas.openebs.io/config: | + # hostpath type will create a PV by + # creating a sub-directory under the + # BASEPATH provided below. + - name: StorageType + value: "hostpath" + # Specify the location (directory) where + # where PV(volume) data will be saved. + # A sub-directory with pv-name will be + # created. When the volume is deleted, + # the PV sub-directory will be deleted. + #Default value is /var/openebs/local + - name: BasePath + value: "/var/openebs/local/" +provisioner: openebs.io/local +volumeBindingMode: WaitForFirstConsumer +reclaimPolicy: Delete diff --git a/pkg/controllers/jivavolume_controller.go b/pkg/controllers/jivavolume_controller.go index 161a05a..6eb420e 100644 --- a/pkg/controllers/jivavolume_controller.go +++ b/pkg/controllers/jivavolume_controller.go @@ -142,7 +142,7 @@ func (r *JivaVolumeReconciler) Reconcile(ctx context.Context, req ctrl.Request) // log err only, as controller must be in container creating state // don't return err as it will dump stack trace unneccesary logrus.Infof("failed to get controller pod ip for volume %s: %s", instance.Name, err.Error()) - time.Sleep(5 * time.Second) + time.Sleep(1 * time.Second) } } @@ -1233,7 +1233,7 @@ func (r *JivaVolumeReconciler) getAndUpdateVolumeStatus(cr *openebsiov1alpha1.Ji err = r.updatePodIPMap(cr) if err != nil { logrus.Infof("failed to get controller pod ip for volume %s: %s", cr.Name, err.Error()) - time.Sleep(5 * time.Second) + time.Sleep(1 * time.Second) } }