From 4a658d7a017c3f05a9689aa88d5e74d133b12682 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Tue, 25 Oct 2022 23:06:53 -0400 Subject: [PATCH 1/3] virt-minion: Fix `make build` --- custom/virt-minion/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom/virt-minion/Makefile b/custom/virt-minion/Makefile index e1c9731..6bada6e 100644 --- a/custom/virt-minion/Makefile +++ b/custom/virt-minion/Makefile @@ -3,7 +3,7 @@ SALT_PATH ?= $(shell python -c 'import os, salt; print(os.path.abspath(salt.__fi all: build build: - docker build -t virt-minion . + docker build -t virt-minion -f latest.Dockerfile . run: if [ -d $(SALT_PATH) ]; then \ From 7c00e8b7f4bcddee01e554aac61a5bc60a34af06 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Tue, 25 Oct 2022 23:08:30 -0400 Subject: [PATCH 2/3] openlap-minion, virt-minion: Use full `ghcr.io` name This makes it possible to build the image locally and run the associated tests without having to change the test code to use the short name. --- custom/openldap-minion/Makefile | 7 ++++--- custom/virt-minion/Makefile | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/custom/openldap-minion/Makefile b/custom/openldap-minion/Makefile index 37ea0f9..669d4c1 100644 --- a/custom/openldap-minion/Makefile +++ b/custom/openldap-minion/Makefile @@ -1,9 +1,10 @@ +NAME_TAG = ghcr.io/saltstack/salt-ci-containers/openldap-minion:latest SALT_PATH ?= $(shell python -c 'import os, salt; print(os.path.abspath(salt.__file__ + "../../.."))') all: build build: - docker build -t openldap-minion:latest -f latest.Dockerfile . + docker build -t '$(NAME_TAG)' -f latest.Dockerfile . run: if [ -d $(SALT_PATH) ]; then \ @@ -15,9 +16,9 @@ run: --name openldap-minion \ -it \ --mount type=bind,source=$(SALT_PATH),target=/salt \ - openldap-minion:latest \ + '$(NAME_TAG)' \ sh; \ fi clean: - docker rmi openldap-minion + docker rmi '$(NAME_TAG)' diff --git a/custom/virt-minion/Makefile b/custom/virt-minion/Makefile index 6bada6e..2a06501 100644 --- a/custom/virt-minion/Makefile +++ b/custom/virt-minion/Makefile @@ -1,9 +1,10 @@ +NAME_TAG = ghcr.io/saltstack/salt-ci-containers/virt-minion:latest SALT_PATH ?= $(shell python -c 'import os, salt; print(os.path.abspath(salt.__file__ + "../../.."))') all: build build: - docker build -t virt-minion -f latest.Dockerfile . + docker build -t '$(NAME_TAG)' -f latest.Dockerfile . run: if [ -d $(SALT_PATH) ]; then \ @@ -15,8 +16,8 @@ run: --name virt-minion-0 \ -it \ --mount type=bind,source=$(SALT_PATH),target=/salt \ - virt-minion \ + '$(NAME_TAG)' \ sh; \ fi clean: - docker rmi virt-minion + docker rmi '$(NAME_TAG)' From 06b86b1881e077ea1a6bd8cbcb725bba5128dafc Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Tue, 25 Oct 2022 23:10:50 -0400 Subject: [PATCH 3/3] openldap-minion: Install `pytest-salt-factories` This is a workaround for https://github.com/saltstack/pytest-salt-factories/issues/139 --- custom/openldap-minion/latest.Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom/openldap-minion/latest.Dockerfile b/custom/openldap-minion/latest.Dockerfile index 0a31579..a814737 100644 --- a/custom/openldap-minion/latest.Dockerfile +++ b/custom/openldap-minion/latest.Dockerfile @@ -6,7 +6,9 @@ RUN install_packages \ python3-jinja2 \ python3-ldap \ python3-msgpack \ + python3-pip \ python3-pycryptodome \ python3-yaml \ python3-zmq +RUN pip install pytest-salt-factories USER 1001