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

Use newer container naming in container BATS #1881

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
Use newer container naming in container BATS
  • Loading branch information
ianballou committed Nov 25, 2024
commit 516cb02fed8f5398b470a5a040de4069c169bdd4
12 changes: 10 additions & 2 deletions bats/fb-katello-container.bats
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ load fixtures/content
@test "try fetching container content" {
tPackageExists podman || tPackageInstall podman
podman login "${HOSTNAME}" -u admin -p changeme
CONTAINER_PULL_LABEL=$(echo "${ORGANIZATION_LABEL}-${PRODUCT_LABEL}-${CONTAINER_REPOSITORY_LABEL}"| tr '[:upper:]' '[:lower:]')
if tIsVersionNewer "${KATELLO_VERSION}" 4.16; then
CONTAINER_PULL_LABEL=$(echo "${ORGANIZATION_LABEL}/${PRODUCT_LABEL}/${CONTAINER_REPOSITORY_LABEL}"| tr '[:upper:]' '[:lower:]')
else
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
CONTAINER_PULL_LABEL=$(echo "${ORGANIZATION_LABEL}-${PRODUCT_LABEL}-${CONTAINER_REPOSITORY_LABEL}"| tr '[:upper:]' '[:lower:]')
fi
podman pull "${HOSTNAME}/${CONTAINER_PULL_LABEL}"
}

Expand All @@ -19,7 +23,11 @@ load fixtures/content
tContainerPushSupported
tPackageExists podman || tPackageInstall podman
podman login "${HOSTNAME}" -u admin -p changeme
CONTAINER_PULL_LABEL=$(echo "${ORGANIZATION_LABEL}-${PRODUCT_LABEL}-${CONTAINER_REPOSITORY_LABEL}"| tr '[:upper:]' '[:lower:]')
if tIsVersionNewer "${KATELLO_VERSION}" 4.16; then
CONTAINER_PULL_LABEL=$(echo "${ORGANIZATION_LABEL}/${PRODUCT_LABEL}/${CONTAINER_REPOSITORY_LABEL}"| tr '[:upper:]' '[:lower:]')
else
CONTAINER_PULL_LABEL=$(echo "${ORGANIZATION_LABEL}-${PRODUCT_LABEL}-${CONTAINER_REPOSITORY_LABEL}"| tr '[:upper:]' '[:lower:]')
fi
CONTAINER_PUSH_LABEL=$(echo "${ORGANIZATION_LABEL}/${PRODUCT_LABEL}/${CONTAINER_REPOSITORY_LABEL}-bats-$(date -u '+%s')"| tr '[:upper:]' '[:lower:]')
podman push "${HOSTNAME}/${CONTAINER_PULL_LABEL}" "${HOSTNAME}/${CONTAINER_PUSH_LABEL}"
# Sleep for 5 seconds due to an intermittent issue where pushed content
Expand Down
4 changes: 2 additions & 2 deletions bats/foreman_helper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ tSkipIfOlderThan43() {

tContainerPushSupported() {
KATELLO_VERSION=$(tKatelloVersion)
if ! tIsVersionNewer "${KATELLO_VERSION}" 4.15; then
skip "Container push is only supported on Katello 4.15+"
if ! tIsVersionNewer "${KATELLO_VERSION}" 4.14; then
skip "Container push is only supported on Katello 4.14+"
fi
}

Expand Down
Loading