Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update names of test images and its refs #130

Merged
merged 2 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ VERSION ?= v1.1.0
IMAGE_BUILDER ?= docker
IMAGE_BUILD_CMD ?= buildx
REGISTRY ?= docker.io/warmmetal
PLATFORM ?= linux/amd64

export IMG = $(REGISTRY)/csi-image:$(VERSION)

Expand Down Expand Up @@ -35,17 +36,18 @@ integration:

.PHONY: image
image:
$(IMAGE_BUILDER) $(IMAGE_BUILD_CMD) build -t $(REGISTRY)/csi-image:$(VERSION) --push .
$(IMAGE_BUILDER) $(IMAGE_BUILD_CMD) build --platform=$(PLATFORM) -t $(REGISTRY)/csi-image:$(VERSION) --push .

.PHONY: local
local:
$(IMAGE_BUILDER) $(IMAGE_BUILD_CMD) build -t $(REGISTRY)/csi-image:$(VERSION) --load .
$(IMAGE_BUILDER) $(IMAGE_BUILD_CMD) build --platform=$(PLATFORM) -t $(REGISTRY)/csi-image:$(VERSION) --load .

.PHONY: test-deps
test-deps:
$(IMAGE_BUILDER) $(IMAGE_BUILD_CMD) build --push -t $(REGISTRY)/csi-image-test:stat-fs -f csi-image-test:stat-fs.dockerfile hack/integration-test-image
$(IMAGE_BUILDER) $(IMAGE_BUILD_CMD) build --push -t $(REGISTRY)/csi-image-test:check-fs -f csi-image-test:check-fs.dockerfile hack/integration-test-image
$(IMAGE_BUILDER) $(IMAGE_BUILD_CMD) build --push -t $(REGISTRY)/csi-image-test:write-check -f csi-image-test:write-check.dockerfile hack/integration-test-image
$(IMAGE_BUILDER) $(IMAGE_BUILD_CMD) build --platform=$(PLATFORM) --push -t $(REGISTRY)/container-image-csi-driver-test:simple-fs -f hack/integration-test-image/container-image-csi-driver-test:simple-fs.dockerfile hack/integration-test-image
$(IMAGE_BUILDER) $(IMAGE_BUILD_CMD) build --platform=$(PLATFORM) --push -t $(REGISTRY)/container-image-csi-driver-test:stat-fs -f hack/integration-test-image/container-image-csi-driver-test:stat-fs.dockerfile hack/integration-test-image
$(IMAGE_BUILDER) $(IMAGE_BUILD_CMD) build --platform=$(PLATFORM) --push -t $(REGISTRY)/container-image-csi-driver-test:check-fs -f hack/integration-test-image/container-image-csi-driver-test:check-fs.dockerfile hack/integration-test-image
$(IMAGE_BUILDER) $(IMAGE_BUILD_CMD) build --platform=$(PLATFORM) --push -t $(REGISTRY)/container-image-csi-driver-test:write-check -f hack/integration-test-image/container-image-csi-driver-test:write-check.dockerfile hack/integration-test-image

.PHONY: install-util
install-util:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ spec:
spec:
containers:
- name: ephemeral-volume
image: docker.io/warmmetal/csi-image-test:check-fs
image: docker.io/warmmetal/container-image-csi-driver-test:check-fs
env:
- name: TARGET
value: /target
Expand All @@ -120,7 +120,7 @@ spec:
# nodePublishSecretRef:
# name: "ImagePullSecret name in the same namespace"
volumeAttributes:
image: "docker.io/warmmetal/csi-image-test:simple-fs"
image: "docker.io/warmmetal/container-image-csi-driver-test:simple-fs"
# # set pullAlways if you want to ignore local images
# pullAlways: "true"
backoffLimit: 0
Expand All @@ -133,7 +133,7 @@ For pre-provisioned PVs, `volumeHandle` instead of the attribute **image**, spec
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-test-csi-image-test-simple-fs
name: pv-test-container-image-csi-driver-test-simple-fs
spec:
storageClassName: csi-image.warm-metal.tech
capacity:
Expand All @@ -143,7 +143,7 @@ spec:
persistentVolumeReclaimPolicy: Retain
csi:
driver: csi-image.warm-metal.tech
volumeHandle: "docker.io/warmmetal/csi-image-test:simple-fs"
volumeHandle: "docker.io/warmmetal/container-image-csi-driver-test:simple-fs"
# nodePublishSecretRef:
# name: "name of the ImagePullSecret"
# namespace: "namespace of the secret"
Expand Down
6 changes: 3 additions & 3 deletions hack/ci/setup_docker_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ lib::start_cluster_docker $@
set -e
echo "Install a private registry"
lib::install_private_registry
minikube ssh -p csi-image-test -- sudo ctr -n k8s.io i pull docker.io/warmmetal/csi-image-test:simple-fs
minikube ssh -p csi-image-test -- sudo ctr -n k8s.io i tag --force docker.io/warmmetal/csi-image-test:simple-fs localhost:31000/warmmetal/csi-image-test:simple-fs
minikube ssh -p csi-image-test -- sudo ctr -n k8s.io i push localhost:31000/warmmetal/csi-image-test:simple-fs --plain-http --user warmmetal:warmmetal
minikube ssh -p container-image-csi-driver-test -- sudo ctr -n k8s.io i pull docker.io/warmmetal/container-image-csi-driver-test:simple-fs
minikube ssh -p container-image-csi-driver-test -- sudo ctr -n k8s.io i tag --force docker.io/warmmetal/container-image-csi-driver-test:simple-fs localhost:31000/warmmetal/container-image-csi-driver-test:simple-fs
minikube ssh -p container-image-csi-driver-test -- sudo ctr -n k8s.io i push localhost:31000/warmmetal/container-image-csi-driver-test:simple-fs --plain-http --user warmmetal:warmmetal
set +e
6 changes: 3 additions & 3 deletions hack/ci/setup_private_registry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ source $(dirname "$0")/../lib/cluster.sh
set -e
echo "Install a private registry"
lib::install_private_registry
docker pull docker.io/warmmetal/csi-image-test:simple-fs
docker tag docker.io/warmmetal/csi-image-test:simple-fs localhost:5000/warmmetal/csi-image-test:simple-fs
docker pull docker.io/warmmetal/container-image-csi-driver-test:simple-fs
docker tag docker.io/warmmetal/container-image-csi-driver-test:simple-fs localhost:5000/warmmetal/container-image-csi-driver-test:simple-fs
docker login -u warmmetal -p warmmetal localhost:5000
docker push localhost:5000/warmmetal/csi-image-test:simple-fs
docker push localhost:5000/warmmetal/container-image-csi-driver-test:simple-fs
set +e
8 changes: 4 additions & 4 deletions hack/helper/prepare_containerd_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ lib::install_driver

echo "Install a private registry"
lib::install_private_registry
minikube ssh -p csi-image-test -- sudo ctr -n k8s.io i pull docker.io/warmmetal/csi-image-test:simple-fs
minikube ssh -p csi-image-test -- sudo ctr -n k8s.io i tag --force docker.io/warmmetal/csi-image-test:simple-fs localhost:31000/warmmetal/csi-image-test:simple-fs
minikube ssh -p csi-image-test -- sudo ctr -n k8s.io i push localhost:31000/warmmetal/csi-image-test:simple-fs --plain-http --user warmmetal:warmmetal
minikube ssh -p container-image-csi-driver-test -- sudo ctr -n k8s.io i pull docker.io/warmmetal/container-image-csi-driver-test:simple-fs
minikube ssh -p container-image-csi-driver-test -- sudo ctr -n k8s.io i tag --force docker.io/warmmetal/container-image-csi-driver-test:simple-fs localhost:31000/warmmetal/container-image-csi-driver-test:simple-fs
minikube ssh -p container-image-csi-driver-test -- sudo ctr -n k8s.io i push localhost:31000/warmmetal/container-image-csi-driver-test:simple-fs --plain-http --user warmmetal:warmmetal

set +x
set +e
set +e
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM docker.io/library/golang:1.16-alpine as builder
WORKDIR /go/src/csi-image-test
WORKDIR /go/src/container-image-csi-driver-test
COPY write_check.go .
RUN GO111MODULE=off go build -o write_check

FROM alpine:3
ENV TARGET=""
WORKDIR /
COPY --from=builder /go/src/csi-image-test/write_check .
COPY --from=builder /go/src/container-image-csi-driver-test/write_check .
ENTRYPOINT ["/write_check"]
8 changes: 4 additions & 4 deletions hack/lib/cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ source $(dirname "${BASH_SOURCE[0]}")/utils.sh

function lib::start_cluster_containerd() {
local version=${1:-stable}
minikube start -p csi-image-test \
minikube start -p container-image-csi-driver-test \
--kubernetes-version=${version} \
--container-runtime=containerd \
--insecure-registry=localhost:31000
}

function lib::start_cluster_crio() {
local version=${1:-stable}
minikube start -p csi-image-test \
minikube start -p container-image-csi-driver-test \
--kubernetes-version=${version} \
--container-runtime=cri-o \
--insecure-registry=localhost:31000
}

function lib::start_cluster_docker() {
local version=${1:-stable}
minikube start -p csi-image-test \
minikube start -p container-image-csi-driver-test \
--kubernetes-version=${version} \
--container-runtime=docker \
--insecure-registry=localhost:31000
Expand Down Expand Up @@ -101,7 +101,7 @@ function lib::install_private_registry() {
if [ "$(docker inspect -f='{{json .NetworkSettings.Networks.kind}}' 'private-registry')" = 'null' ]; then
docker network connect "kind" "private-registry"
fi

cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: ConfigMap
Expand Down
4 changes: 2 additions & 2 deletions sample/ephemeral-volume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
spec:
containers:
- name: ephemeral-volume
image: docker.io/warmmetal/csi-image-test:check-fs
image: docker.io/warmmetal/container-image-csi-driver-test:check-fs
env:
- name: TARGET
value: /target
Expand All @@ -22,7 +22,7 @@ spec:
csi:
driver: csi-image.warm-metal.tech
volumeAttributes:
image: "docker.io/warmmetal/csi-image-test:simple-fs"
image: "docker.io/warmmetal/container-image-csi-driver-test:simple-fs"
# # set pullAlways if you want to ignore local images
# pullAlways: "true"
# # set secret if the image is private
Expand Down
12 changes: 6 additions & 6 deletions sample/pre-provisioned-pv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ provisioner: csi-image.warm-metal.tech
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-test-csi-image-test-simple-fs
name: pv-test-container-image-csi-driver-test-simple-fs
spec:
storageClassName: csi-image.warm-metal.tech
capacity:
Expand All @@ -17,7 +17,7 @@ spec:
persistentVolumeReclaimPolicy: Retain
csi:
driver: csi-image.warm-metal.tech
volumeHandle: "docker.io/warmmetal/csi-image-test:simple-fs"
volumeHandle: "docker.io/warmmetal/container-image-csi-driver-test:simple-fs"
# volumeAttributes:
# # set pullAlways if you want to ignore local images
# pullAlways: "true"
Expand All @@ -28,15 +28,15 @@ spec:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-test-csi-image-test-simple-fs
name: pvc-test-container-image-csi-driver-test-simple-fs
spec:
storageClassName: csi-image.warm-metal.tech
accessModes:
- ReadOnlyMany
resources:
requests:
storage: 5Gi
volumeName: pv-test-csi-image-test-simple-fs
volumeName: pv-test-container-image-csi-driver-test-simple-fs
---
apiVersion: batch/v1
kind: Job
Expand All @@ -49,7 +49,7 @@ spec:
spec:
containers:
- name: pre-provisioned-pv
image: docker.io/warmmetal/csi-image-test:check-fs
image: docker.io/warmmetal/container-image-csi-driver-test:check-fs
env:
- name: TARGET
value: /target
Expand All @@ -60,5 +60,5 @@ spec:
volumes:
- name: target
persistentVolumeClaim:
claimName: pvc-test-csi-image-test-simple-fs
claimName: pvc-test-container-image-csi-driver-test-simple-fs
backoffLimit: 0
12 changes: 5 additions & 7 deletions test/e2e/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ import (
"k8s.io/kubernetes/test/e2e/storage/testsuites"
)

type driver struct {
}
type driver struct{}

func (d driver) GetVolume(config *testsuites.PerTestConfig, volumeNumber int) (attributes map[string]string, shared bool, readOnly bool) {
return map[string]string{"image": "docker.io/warmmetal/csi-image-test:simple-fs"}, true, false
return map[string]string{"image": "docker.io/warmmetal/container-image-csi-driver-test:simple-fs"}, true, false
}

func (d driver) GetCSIDriverName(config *testsuites.PerTestConfig) string {
Expand All @@ -28,7 +27,7 @@ func (d driver) GetPersistentVolumeSource(readOnly bool, fsType string, testVolu
return &v1.PersistentVolumeSource{
CSI: &v1.CSIPersistentVolumeSource{
Driver: "csi-image.warm-metal.tech",
VolumeHandle: "docker.io/warmmetal/csi-image-test:simple-fs",
VolumeHandle: "docker.io/warmmetal/container-image-csi-driver-test:simple-fs",
ReadOnly: true,
},
}, &v1.VolumeNodeAffinity{
Expand All @@ -55,14 +54,13 @@ func (d driver) GetVolumeSource(readOnly bool, fsType string, testVolume testsui
Driver: "csi-image.warm-metal.tech",
ReadOnly: &ro,
VolumeAttributes: map[string]string{
"image": "docker.io/warmmetal/csi-image-test:simple-fs",
"image": "docker.io/warmmetal/container-image-csi-driver-test:simple-fs",
},
},
}
}

type imageVol struct {
}
type imageVol struct{}

func (i imageVol) DeleteVolume() {
}
Expand Down
6 changes: 3 additions & 3 deletions test/integration/compatible-manifests/ephemeral-volume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ spec:
csi:
driver: csi-image.warm-metal.tech
volumeAttributes:
image: "docker.io/warmmetal/csi-image-test:simple-fs"
image: "docker.io/warmmetal/container-image-csi-driver-test:simple-fs"
pullAlways: "true"
- name: ro
csi:
driver: csi-image.warm-metal.tech
readOnly: true
volumeAttributes:
image: "docker.io/warmmetal/csi-image-test:simple-fs"
pullAlways: "true"
image: "docker.io/warmmetal/container-image-csi-driver-test:simple-fs"
pullAlways: "true"
10 changes: 5 additions & 5 deletions test/integration/compatible-manifests/pre-provisioned-pv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ provisioner: csi-image.warm-metal.tech
apiVersion: v1
kind: PersistentVolume
metadata:
name: compatible-pv-test-csi-image-test-simple-fs
name: compatible-pv-test-container-image-csi-driver-test-simple-fs
spec:
storageClassName: csi-image.warm-metal.tech
capacity:
Expand All @@ -17,20 +17,20 @@ spec:
persistentVolumeReclaimPolicy: Retain
csi:
driver: csi-image.warm-metal.tech
volumeHandle: "docker.io/warmmetal/csi-image-test:simple-fs"
volumeHandle: "docker.io/warmmetal/container-image-csi-driver-test:simple-fs"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: compatible-pvc-test-csi-image-test-simple-fs
name: compatible-pvc-test-container-image-csi-driver-test-simple-fs
spec:
storageClassName: csi-image.warm-metal.tech
accessModes:
- ReadOnlyMany
resources:
requests:
storage: 5Gi
volumeName: compatible-pv-test-csi-image-test-simple-fs
volumeName: compatible-pv-test-container-image-csi-driver-test-simple-fs
---
apiVersion: v1
kind: Pod
Expand All @@ -50,4 +50,4 @@ spec:
volumes:
- name: target
persistentVolumeClaim:
claimName: compatible-pvc-test-csi-image-test-simple-fs
claimName: compatible-pvc-test-container-image-csi-driver-test-simple-fs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
spec:
containers:
- name: ephemeral-volume-private-with-daemon-secret
image: docker.io/warmmetal/csi-image-test:check-fs
image: docker.io/warmmetal/container-image-csi-driver-test:check-fs
env:
- name: TARGET
value: /target
Expand All @@ -22,6 +22,6 @@ spec:
csi:
driver: csi-image.warm-metal.tech
volumeAttributes:
image: "private-registry:5000/warmmetal/csi-image-test:simple-fs"
image: "private-registry:5000/warmmetal/container-image-csi-driver-test:simple-fs"
pullAlways: "true"
backoffLimit: 0
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
persistentVolumeReclaimPolicy: Retain
csi:
driver: csi-image.warm-metal.tech
volumeHandle: "private-registry:5000/warmmetal/csi-image-test:simple-fs"
volumeHandle: "private-registry:5000/warmmetal/container-image-csi-driver-test:simple-fs"
---
apiVersion: v1
kind: PersistentVolumeClaim
Expand All @@ -43,7 +43,7 @@ spec:
spec:
containers:
- name: pre-provisioned-pv-private-with-daemon-secret
image: docker.io/warmmetal/csi-image-test:check-fs
image: docker.io/warmmetal/container-image-csi-driver-test:check-fs
env:
- name: TARGET
value: /target
Expand Down
6 changes: 3 additions & 3 deletions test/integration/failed-manifests/rwo-pv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
persistentVolumeReclaimPolicy: Retain
csi:
driver: csi-image.warm-metal.tech
volumeHandle: "docker.io/warmmetal/csi-image-test:simple-fs"
volumeHandle: "docker.io/warmmetal/container-image-csi-driver-test:simple-fs"
---
apiVersion: v1
kind: PersistentVolumeClaim
Expand All @@ -43,7 +43,7 @@ spec:
spec:
containers:
- name: failed-rwo-pv
image: docker.io/warmmetal/csi-image-test:check-fs
image: docker.io/warmmetal/container-image-csi-driver-test:check-fs
env:
- name: TARGET
value: /target
Expand All @@ -55,4 +55,4 @@ spec:
- name: target
persistentVolumeClaim:
claimName: pvc-test-csi-image-rwo
backoffLimit: 0
backoffLimit: 0
Loading