From be055412b9d1b4e1a9ea713be758fda0ea966282 Mon Sep 17 00:00:00 2001 From: Mayank <33252549+mynktl@users.noreply.github.com> Date: Mon, 13 Sep 2021 13:44:15 +0530 Subject: [PATCH] fix(integration-test): fixing test to use apps/v1 for deployment (#170) * removing example/00-prereqs.yaml * updating k8s version to v1.20.1 in github workflow * updating velero version to v1.6.0 in github workflow * updated github workflow to use velero/velero-plugin-for-aws-amd64 version v1.2.0 Signed-off-by: mayank --- .github/workflows/build.yml | 4 +- .github/workflows/pull_request.yml | 4 +- example/00-prereqs.yaml | 208 ----------------------------- script/install-velero.sh | 3 +- tests/k8s/status.go | 6 +- 5 files changed, 9 insertions(+), 216 deletions(-) delete mode 100644 example/00-prereqs.yaml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5146788e..838b78e9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,7 +59,7 @@ jobs: uses: manusa/actions-setup-minikube@v2.3.0 with: minikube version: v1.16.0 - kubernetes version: v1.13.0 + kubernetes version: v1.20.1 github token: ${{ secrets.GITHUB_TOKEN }} - name: Build images locally @@ -69,7 +69,7 @@ jobs: run: | kubectl cluster-info echo "KUBECONFIG=$HOME/.kube/config" >> $GITHUB_ENV - echo "VELERO_RELEASE=v1.0.0" >> $GITHUB_ENV + echo "VELERO_RELEASE=v1.6.0" >> $GITHUB_ENV echo "OPENEBS_RELEASE=master" >> $GITHUB_ENV - name: Installation diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 70da663b..06cd9726 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -59,7 +59,7 @@ jobs: uses: manusa/actions-setup-minikube@v2.3.0 with: minikube version: v1.16.0 - kubernetes version: v1.13.0 + kubernetes version: v1.20.1 github token: ${{ secrets.GITHUB_TOKEN }} - name: Build images locally @@ -69,7 +69,7 @@ jobs: run: | kubectl cluster-info echo "KUBECONFIG=$HOME/.kube/config" >> $GITHUB_ENV - echo "VELERO_RELEASE=v1.0.0" >> $GITHUB_ENV + echo "VELERO_RELEASE=v1.6.0" >> $GITHUB_ENV echo "OPENEBS_RELEASE=master" >> $GITHUB_ENV - name: Installation diff --git a/example/00-prereqs.yaml b/example/00-prereqs.yaml deleted file mode 100644 index 438c6258..00000000 --- a/example/00-prereqs.yaml +++ /dev/null @@ -1,208 +0,0 @@ -# Copyright 2017 the Heptio Ark contributors. -# -# 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. - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: backups.velero.io - labels: - component: velero -spec: - group: velero.io - version: v1 - scope: Namespaced - names: - plural: backups - kind: Backup - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: schedules.velero.io - labels: - component: velero -spec: - group: velero.io - version: v1 - scope: Namespaced - names: - plural: schedules - kind: Schedule - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: restores.velero.io - labels: - component: velero -spec: - group: velero.io - version: v1 - scope: Namespaced - names: - plural: restores - kind: Restore - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: downloadrequests.velero.io - labels: - component: velero -spec: - group: velero.io - version: v1 - scope: Namespaced - names: - plural: downloadrequests - kind: DownloadRequest - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: deletebackuprequests.velero.io - labels: - component: velero -spec: - group: velero.io - version: v1 - scope: Namespaced - names: - plural: deletebackuprequests - kind: DeleteBackupRequest - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: podvolumebackups.velero.io - labels: - component: velero -spec: - group: velero.io - version: v1 - scope: Namespaced - names: - plural: podvolumebackups - kind: PodVolumeBackup - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: podvolumerestores.velero.io - labels: - component: velero -spec: - group: velero.io - version: v1 - scope: Namespaced - names: - plural: podvolumerestores - kind: PodVolumeRestore - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: resticrepositories.velero.io - labels: - component: velero -spec: - group: velero.io - version: v1 - scope: Namespaced - names: - plural: resticrepositories - kind: ResticRepository - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: backupstoragelocations.velero.io - labels: - component: velero -spec: - group: velero.io - version: v1 - scope: Namespaced - names: - plural: backupstoragelocations - kind: BackupStorageLocation - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: volumesnapshotlocations.velero.io - labels: - component: velero -spec: - group: velero.io - version: v1 - scope: Namespaced - names: - plural: volumesnapshotlocations - kind: VolumeSnapshotLocation - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: serverstatusrequests.velero.io - labels: - component: velero -spec: - group: velero.io - version: v1 - scope: Namespaced - names: - plural: serverstatusrequests - kind: ServerStatusRequest ---- -apiVersion: v1 -kind: Namespace -metadata: - name: velero - ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: velero - namespace: velero - labels: - component: velero - ---- -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: ClusterRoleBinding -metadata: - name: velero - labels: - component: velero -subjects: - - kind: ServiceAccount - namespace: velero - name: velero -roleRef: - kind: ClusterRole - name: cluster-admin - apiGroup: rbac.authorization.k8s.io diff --git a/script/install-velero.sh b/script/install-velero.sh index 085d7620..c6a6682e 100755 --- a/script/install-velero.sh +++ b/script/install-velero.sh @@ -55,7 +55,7 @@ export MAPI_ADDR="http://${MAPI_SVC_ADDR}:5656" export KUBERNETES_SERVICE_HOST="127.0.0.1" export KUBECONFIG=$HOME/.kube/config -wget -nv -O velero.tar.gz https://github.com/heptio/velero/releases/download/${VELERO_RELEASE}/velero-${VELERO_RELEASE}-linux-amd64.tar.gz +wget -nv -O velero.tar.gz https://github.com/vmware-tanzu/velero/releases/download/${VELERO_RELEASE}/velero-${VELERO_RELEASE}-linux-amd64.tar.gz mkdir velero tar xf velero.tar.gz -C velero velero=$PWD/velero/velero-${VELERO_RELEASE}-linux-amd64/velero @@ -103,6 +103,7 @@ ${velero} install \ --bucket $BUCKET \ --secret-file ./script/minio-credentials \ --backup-location-config region=${REGION},s3ForcePathStyle="true",s3Url=http://${MINIO_SERVER_IP}:9000 \ + --plugins velero/velero-plugin-for-aws-amd64:v1.2.0 \ --wait sed "s/MINIO_ENDPOINT/http:\/\/$MINIO_SERVER_IP\:9000/" script/volumesnapshotlocation.yaml > /tmp/s.yaml diff --git a/tests/k8s/status.go b/tests/k8s/status.go index aea11024..6b28dced 100644 --- a/tests/k8s/status.go +++ b/tests/k8s/status.go @@ -69,7 +69,7 @@ func (k *KubeClient) WaitForDeployment(labelSelector, ns string) error { var ready bool dumpLog := 0 for { - deploymentList, err := k.ExtensionsV1beta1(). + deploymentList, err := k.AppsV1(). Deployments(ns). List(context.TODO(), metav1.ListOptions{ LabelSelector: labelSelector, @@ -83,7 +83,7 @@ func (k *KubeClient) WaitForDeployment(labelSelector, ns string) error { } for _, d := range deploymentList.Items { - o, err := k.ExtensionsV1beta1(). + o, err := k.AppsV1(). Deployments(d.Namespace). Get(context.TODO(), d.Name, metav1.GetOptions{}) if err != nil { @@ -134,7 +134,7 @@ func (k *KubeClient) WaitForPod(podName, podNamespace string) error { func (k *KubeClient) WaitForDeploymentCleanup(labelSelector, ns string) error { dumpLog := 0 for { - deploymentList, err := k.ExtensionsV1beta1(). + deploymentList, err := k.AppsV1(). Deployments(ns). List(context.TODO(), metav1.ListOptions{ LabelSelector: labelSelector,