-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tag/untag commands for container repositories
fixes: #423
- Loading branch information
Showing
4 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Added tag/untag commands to add and remove tags from images in container repositories. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
# shellcheck source=tests/scripts/config.source | ||
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source | ||
|
||
pulp debug has-plugin --name "container" || exit 3 | ||
|
||
cleanup() { | ||
pulp container repository destroy --name "cli_test_container_repository" || true | ||
pulp container remote destroy --name "cli_test_container_remote" || true | ||
pulp orphan cleanup || true | ||
} | ||
trap cleanup EXIT | ||
|
||
# Prepare | ||
pulp container remote create --name "cli_test_container_remote" --url "$CONTAINER_REMOTE_URL" --upstream-name "$CONTAINER_IMAGE" | ||
pulp container repository create --name "cli_test_container_repository" | ||
pulp container repository sync --name "cli_test_container_repository" --remote "cli_test_container_remote" | ||
manifest_digest="$(pulp container content -t manifest list | tr '\r\n' ' ' | jq -r .[0].digest)" | ||
|
||
expect_succ pulp container repository tag --name "cli_test_container_repository" --tag "test_tag" --digest "$manifest_digest" | ||
expect_succ pulp container repository version show --repository "cli_test_container_repository" --version "2" | ||
test "$(echo "$OUTPUT" | jq -r '.content_summary.added["container.tag"].count')" -eq "1" | ||
|
||
expect_succ pulp container repository untag --name "cli_test_container_repository" --tag "test_tag" | ||
expect_succ pulp container repository version show --repository "cli_test_container_repository" --version "3" | ||
test "$(echo "$OUTPUT" | jq -r '.content_summary.removed["container.tag"].count')" -eq "1" |