From c408dd370a7c5df70bb47e9c4e0ac8348da33f0d Mon Sep 17 00:00:00 2001 From: EvgenyUglov <63835199+EvgenyUglov@users.noreply.github.com> Date: Thu, 23 Jan 2025 15:49:55 -0500 Subject: [PATCH] Use common CSM baseimage (#416) * Use CSM baseimage * Fixing lint issues * Fixing lint issues * Fixing lint issues * Fixing lint issues --- .github/workflows/go-version.yaml | 2 +- buildubimicro.sh | 24 ---------------------- docker.mk | 22 +++++--------------- samples/secret/secret.yaml | 20 +++++++++--------- samples/volumesnapshotclass/snapclass.yaml | 2 +- tests/e2e/driver/resources/sc.yaml | 4 ++-- tests/e2e/k8s/e2e-values.yaml | 6 +++--- tests/sanity/helm/secret.yaml | 20 +++++++++--------- 8 files changed, 32 insertions(+), 68 deletions(-) delete mode 100755 buildubimicro.sh diff --git a/.github/workflows/go-version.yaml b/.github/workflows/go-version.yaml index 1ba387ea..51df53be 100644 --- a/.github/workflows/go-version.yaml +++ b/.github/workflows/go-version.yaml @@ -9,7 +9,7 @@ # Reusable workflow to perform go version update on Golang based projects name: Go Version Update -on: +on: # yamllint disable-line rule:truthy workflow_dispatch: repository_dispatch: types: [go-update-workflow] diff --git a/buildubimicro.sh b/buildubimicro.sh deleted file mode 100755 index 72c4e351..00000000 --- a/buildubimicro.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# -# Copyright © 2023 Dell Inc., or its subsidiaries. All Rights Reserved. -# -# 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. -# - -microcontainer=$(buildah from $1) -micromount=$(buildah mount $microcontainer) -dnf install --installroot $micromount --releasever=9 --nodocs --setopt install_weak_deps=false --setopt=reposdir=/etc/yum.repos.d/ e2fsprogs xfsprogs nfs-utils nfs4-acl-tools acl which device-mapper-multipath util-linux -y -dnf clean all --installroot $micromount -buildah umount $microcontainer -buildah commit $microcontainer csipowerstore-ubimicro -echo "$(buildah images | grep csipowerstore-ubimicro)" \ No newline at end of file diff --git a/docker.mk b/docker.mk index 48bace31..b7b56dbc 100644 --- a/docker.mk +++ b/docker.mk @@ -36,12 +36,6 @@ endif # set the GOVERSION export GOVERSION="1.21" -# Add 'build-base-image' as a dependency if UBI Micro is used as the base image. -# This is required to load all the depedent packages into UBI Miro image. -ifeq ($(DOCKER_FILE), docker-files/Dockerfile.ubi.micro) - DEPENDENCIES=build-base-image -endif - # figure out if podman or docker should be used (use podman if found) ifneq (, $(shell which podman 2>/dev/null)) BUILDER=podman @@ -49,26 +43,20 @@ else BUILDER=docker endif -docker: $(DEPENDENCIES) +docker: download-csm-common @echo "MAJOR $(MAJOR) MINOR $(MINOR) PATCH $(PATCH) RELNOTE $(RELNOTE) SEMVER $(SEMVER)" @echo "$(DOCKER_FILE)" - $(BUILDER) build -f $(DOCKER_FILE) -t "$(DOCKER_REGISTRY)/$(DOCKER_IMAGE_NAME):v$(MAJOR).$(MINOR).$(PATCH)$(RELNOTE)" --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) --build-arg BASEIMAGE=$(BASEIMAGE) . + $(BUILDER) build -f $(DOCKER_FILE) -t "$(DOCKER_REGISTRY)/$(DOCKER_IMAGE_NAME):v$(MAJOR).$(MINOR).$(PATCH)$(RELNOTE)" --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) --build-arg BASEIMAGE=$(CSM_BASEIMAGE) . -docker-no-cache: $(DEPENDENCIES) +docker-no-cache: download-csm-common @echo "MAJOR $(MAJOR) MINOR $(MINOR) PATCH $(PATCH) RELNOTE $(RELNOTE) SEMVER $(SEMVER)" @echo "$(DOCKER_FILE) --no-cache" - $(BUILDER) build --no-cache -f $(DOCKER_FILE) -t "$(DOCKER_REGISTRY)/$(DOCKER_IMAGE_NAME):v$(MAJOR).$(MINOR).$(PATCH)$(RELNOTE)" --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) --build-arg BASEIMAGE=$(BASEIMAGE) . + $(BUILDER) build --no-cache -f $(DOCKER_FILE) -t "$(DOCKER_REGISTRY)/$(DOCKER_IMAGE_NAME):v$(MAJOR).$(MINOR).$(PATCH)$(RELNOTE)" --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) --build-arg BASEIMAGE=$(CSM_BASEIMAGE) . push: echo "MAJOR $(MAJOR) MINOR $(MINOR) PATCH $(PATCH) RELNOTE $(RELNOTE) SEMVER $(SEMVER)" $(BUILDER) push "$(DOCKER_REGISTRY)/$(DOCKER_IMAGE_NAME):v$(MAJOR).$(MINOR).$(PATCH)$(RELNOTE)" -build-base-image: download-csm-common - $(eval include csm-common.mk) - @echo "Building base image from $(DEFAULT_BASEIMAGE) and loading dependencies..." - ./buildubimicro.sh $(DEFAULT_BASEIMAGE) - @echo "Base image build: SUCCESS" - $(eval BASEIMAGE=localhost/csipowerstore-ubimicro:latest) - download-csm-common: curl -O -L https://raw.githubusercontent.com/dell/csm/main/config/csm-common.mk + $(eval include csm-common.mk) diff --git a/samples/secret/secret.yaml b/samples/secret/secret.yaml index 67ff1983..d3b7eb58 100644 --- a/samples/secret/secret.yaml +++ b/samples/secret/secret.yaml @@ -19,9 +19,9 @@ # kubectl create secret generic powerstore-config -n csi-powerstore --from-file=config=secret.yaml # arrays: - # endpoint: full URL path to the PowerStore API - # Allowed Values: https://*.*.*.*/api/rest or https://abc.com/api/rest - # Default Value: None + # endpoint: full URL path to the PowerStore API + # Allowed Values: https://*.*.*.*/api/rest or https://abc.com/api/rest + # Default Value: None - endpoint: "https://10.0.0.1/api/rest" # globalID: unique id of the PowerStore array @@ -84,10 +84,10 @@ arrays: # Default value: "0777" # nfsAcls: "0777" - # To add more PowerStore arrays, uncomment the following lines and provide the required values - #- endpoint: "https://11.0.0.1/api/rest" - # globalID: "unique" - # username: "user" - # password: "password" - # skipCertificateValidation: true - # blockProtocol: "FC" +# To add more PowerStore arrays, uncomment the following lines and provide the required values +# - endpoint: "https://11.0.0.1/api/rest" +# globalID: "unique" +# username: "user" +# password: "password" +# skipCertificateValidation: true +# blockProtocol: "FC" diff --git a/samples/volumesnapshotclass/snapclass.yaml b/samples/volumesnapshotclass/snapclass.yaml index 16bf147c..478d7f47 100644 --- a/samples/volumesnapshotclass/snapclass.yaml +++ b/samples/volumesnapshotclass/snapclass.yaml @@ -18,5 +18,5 @@ apiVersion: snapshot.storage.k8s.io/v1 kind: VolumeSnapshotClass metadata: name: powerstore-snapshot -driver: "csi-powerstore.dellemc.com" #driver name from values.yaml +driver: "csi-powerstore.dellemc.com" # driver name from values.yaml deletionPolicy: Delete diff --git a/tests/e2e/driver/resources/sc.yaml b/tests/e2e/driver/resources/sc.yaml index f78d40e1..9af56cbf 100644 --- a/tests/e2e/driver/resources/sc.yaml +++ b/tests/e2e/driver/resources/sc.yaml @@ -15,10 +15,10 @@ kind: StorageClass metadata: name: powerstore-metro parameters: - arrayID: "unique" # PowerStore Global ID + arrayID: "unique" # PowerStore Global ID replication.storage.dell.com/isReplicationEnabled: "true" replication.storage.dell.com/mode: METRO - replication.storage.dell.com/remoteSystem: "system-ID" # Remote PowerStore system name + replication.storage.dell.com/remoteSystem: "system-ID" # Remote PowerStore system name provisioner: csi-powerstore.dellemc.com reclaimPolicy: Delete volumeBindingMode: Immediate diff --git a/tests/e2e/k8s/e2e-values.yaml b/tests/e2e/k8s/e2e-values.yaml index 87ecc373..9ab2978c 100644 --- a/tests/e2e/k8s/e2e-values.yaml +++ b/tests/e2e/k8s/e2e-values.yaml @@ -26,9 +26,9 @@ execCommand: "while true ; do sleep 2 ; done" # config for externalAccess e2e test suite externalAccess: - endPoint: "https://10.0.0.1/api/rest" # array's endpoint + endPoint: "https://10.0.0.1/api/rest" # array's endpoint userName: "user" password: "password" - externalAccessIP: "10.0.0.1/25" # IP configured in values.yaml file while installing the driver + externalAccessIP: "10.0.0.1/25" # IP configured in values.yaml file while installing the driver NASServer: "nas-server" - testStatefulset: true # if wanted to test ExternalAccess with Deployment as well as with Statefulset resource + testStatefulset: true # if wanted to test ExternalAccess with Deployment as well as with Statefulset resource diff --git a/tests/sanity/helm/secret.yaml b/tests/sanity/helm/secret.yaml index fd92932b..f0a4cc4a 100644 --- a/tests/sanity/helm/secret.yaml +++ b/tests/sanity/helm/secret.yaml @@ -19,9 +19,9 @@ # kubectl create secret generic powerstore-config -n csi-powerstore --from-file=config=secret.yaml # arrays: - # endpoint: full URL path to the PowerStore API - # Allowed Values: https://*.*.*.*/api/rest or https://abc.com/api/rest - # Default Value: None + # endpoint: full URL path to the PowerStore API + # Allowed Values: https://*.*.*.*/api/rest or https://abc.com/api/rest + # Default Value: None - endpoint: "https://10.0.0.1/api/rest" # globalID: unique id of the PowerStore array @@ -84,10 +84,10 @@ arrays: # Default value: "0777" # nfsAcls: "0777" - # To add more PowerStore arrays, uncomment the following lines and provide the required values - #- endpoint: "https://11.0.0.1/api/rest" - # globalID: "unique" - # username: "user" - # password: "password" - # skipCertificateValidation: true - # blockProtocol: "FC" +# To add more PowerStore arrays, uncomment the following lines and provide the required values +# - endpoint: "https://11.0.0.1/api/rest" +# globalID: "unique" +# username: "user" +# password: "password" +# skipCertificateValidation: true +# blockProtocol: "FC"