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

[HashiCorp] Preflight's container name test fails for registry/repos with more path components than canonical <reg>/<repo>:<tag> #1227

Closed
jfrancin opened this issue Dec 11, 2024 · 1 comment · Fixed by #1228
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@jfrancin
Copy link
Contributor

Bug Description

A partner who's container registry allows more path components than the standard /: for their containers will fail the Red Hat trademark test.

Version and Command Invocation

time="2024-12-10T00:39:40Z" level=info msg="certification library version" version="1.11.0 <commit: e02ce0df45c869cae741020081b6745b13b27959>"
time="2024-12-10T00:39:40Z" level=info msg="target image" image="crt-core-staging-docker-local.artifactory.hashicorp.engineering/quay.io/redhat-isv-containers/62211e0d8bf2cabc69a39c7d:1.10.0-alpha20241205-ubi"

Steps to Reproduce:

  1. Run 'preflight check container' against a container image stored in a registry with a higher number of path components, where one of those components that is not the last one contains the name 'redhat'.

Expected Result

Preflight to not complain about the container name since "redhat" is not found in the last path component (the repo name, commonly used as the container name)

Actual Result

 time="2024-12-10T00:39:40Z" level=info msg="certification library version" version="1.11.0 <commit: e02ce0df45c869cae741020081b6745b13b27959>"
  time="2024-12-10T00:39:40Z" level=info msg="running checks for crt-core-staging-docker-local.artifactory.hashicorp.engineering/quay.io/redhat-isv-containers/62211e0d8bf2cabc69a39c7d:1.10.0-alpha20241205-ubi for platform amd64"
  time="2024-12-10T00:39:40Z" level=info msg="target image" image="crt-core-staging-docker-local.artifactory.hashicorp.engineering/quay.io/redhat-isv-containers/62211e0d8bf2cabc69a39c7d:1.10.0-alpha20241205-ubi"
  time="2024-12-10T00:39:46Z" level=info msg="check completed" check=HasLicense result=PASSED
  time="2024-12-10T00:39:46Z" level=info msg="check completed" check=HasUniqueTag result=PASSED
  time="2024-12-10T00:39:46Z" level=info msg="check completed" check=LayerCountAcceptable result=PASSED
  time="2024-12-10T00:39:46Z" level=info msg="check completed" check=HasNoProhibitedPackages result=PASSED
  time="2024-12-10T00:39:46Z" level=info msg="check completed" check=HasRequiredLabel result=PASSED
  time="2024-12-10T00:39:46Z" level=info msg="USER 101 specified that is non-root" check=RunAsNonRoot
  time="2024-12-10T00:39:46Z" level=info msg="check completed" check=RunAsNonRoot result=PASSED
  time="2024-12-10T00:39:50Z" level=info msg="check completed" check=HasModifiedFiles result=PASSED
  time="2024-12-10T00:39:52Z" level=info msg="check completed" check=BasedOnUbi result=PASSED
  time="2024-12-10T00:39:52Z" level=info msg="check completed" check=HasProhibitedContainerName result=FAILED
  time="2024-12-10T00:39:52Z" level=info msg="This image's tag 1.10.0-alpha20241205-ubi will be paired with digest sha256:5d01deebab3d33e08811477727c184b0c1ddecf96e4ed2fce9f13188a6a1a61c once this image has been published in accordance with Red Hat Certification policy. You may then add or remove any supplemental tags through your Red Hat Connect portal as you see fit."
  time="2024-12-10T00:39:52Z" level=info msg="Preflight result: FAILED"

Additional Context

(Anything else you think might help us troubleshoot, like your platform, dependency versions, etc).

@jfrancin jfrancin added the kind/bug Categorizes issue or PR as related to a bug. label Dec 11, 2024
@acornett21
Copy link
Contributor

This was already fixed in main yesterday with the below:

I'm adding a test case for this use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants