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

Fix make ci-clean and runlocal-rp #3806

Merged
merged 2 commits into from
Sep 3, 2024
Merged
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
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ runlocal-rp: ci-rp podman-secrets
--secret proxy-client.key,target=/app/secrets/proxy-client.key \
--secret proxy-client.crt,target=/app/secrets/proxy-client.crt \
--secret proxy.crt,target=/app/secrets/proxy.crt \
$(LOCAL_ARO_RP_IMAGE):$(VERSION): rp
$(LOCAL_ARO_RP_IMAGE):$(VERSION) rp

.PHONY: az
az: pyenv
Expand Down Expand Up @@ -232,6 +232,7 @@ ci-tunnel: fix-macos-vendor

.PHONY: ci-clean
ci-clean:
$(shell podman ps --external --format "{{.Command}} {{.ID}}" | grep buildah | cut -d " " -f 2 | xargs podman rm -f > /dev/null)
Copy link
Collaborator Author

@SudoBrendan SudoBrendan Aug 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I seriously wish this command could be prettier - I went through many iterations before settling here. If podman rm --filter supported COMMAND, this would be trivial, but it doesn't, and /dev/null is required because make does weird things with STDOUT on $(shell) stuff (you get errors like <Deleted Container SHA>: command not found) :/

Copy link
Collaborator

@kevinobriendotca kevinobriendotca Aug 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could shorten it a bit with command substitution.

podman rm -f $(podman ps | grep buildah | awk '{print $1}')

Also, podman rm has the -i flag that will ignore errors for non-existent containers and return 0 regardless of whether a container was deleted or not. Could possibly use that instead of the redirect to /dev/null.

Or, could we add a name to the build container so we can use the rm filter?

podman image prune --all --filter="label=aro-*=true"

# TODO: hard coding dev-config.yaml is clunky; it is also probably convenient to
Expand Down
Loading