Bug 1750675 - [Azure]Image registry pods go to CrashLoopBackOff when container name contains a sequence of dashes
Summary: [Azure]Image registry pods go to CrashLoopBackOff when container name contain...
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Image Registry
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.3.0
Assignee: Ricardo Maraschini
QA Contact: Wenjing Zheng
Depends On:
TreeView+ depends on / blocked
Reported: 2019-09-10 08:40 UTC by XiuJuan Wang
Modified: 2020-01-23 11:06 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: OpenShift allowed the image registry operator to be configured with an invalid Azure container name Consequence: the image registry failed to deploy on Azure if the container had an invalid name Fix: updated the image registry operator's API schema to ensure any provided Azure container name conforms to Azure's API requirements Result: OpenShift will not allow the image registry operator to have an invalid Azure container name in its configuration
Clone Of:
Last Closed: 2020-01-23 11:05:47 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Github openshift cluster-image-registry-operator pull 411 0 'None' closed Bug 1750675: Validating Azure container name. 2020-06-18 14:41:07 UTC
Red Hat Product Errata RHBA-2020:0062 0 None None None 2020-01-23 11:06:11 UTC

Description XiuJuan Wang 2019-09-10 08:40:08 UTC
Description of problem:
Image registry pods go to CrashLoopBackOff when container name contains a sequence of dashes

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.Set container name with a sequence of dashes,such as:
      accountName: qexiuwangazure90974fkwsc
      container: qe-xiuwang-azure-909-74z7s---image-registry-qyctpisglrltvbixdqrw
2.Check image registry pod

Actual results:

$ oc logs -f image-registry-6b9bf757d5-9sdpk 
time="2019-09-10T05:46:33.578796359Z" level=info msg="start registry" distribution_version=v2.6.0+unknown go.version=go1.11.13 openshift_version=v4.2.0-201909020729+3d8ce1c-dirty
time="2019-09-10T05:46:33.579464688Z" level=info msg="caching project quota objects with TTL 1m0s" go.version=go1.11.13
panic: storage: service returned error: StatusCode=400, ErrorCode=OutOfRangeInput, ErrorMessage=The specified resource name length is not within the permissible limits.
Time:2019-09-10T05:46:33.6609312Z, RequestInitiated=Tue, 10 Sep 2019 05:46:33 GMT, RequestId=caafca3b-101e-001a-4b9b-67f41a000000, API Version=2016-05-31, QueryParameterName=, QueryParameterValue=

goroutine 1 [running]:
github.com/openshift/image-registry/vendor/github.com/docker/distribution/registry/handlers.NewApp(0x199c940, 0xc000042038, 0xc000094e00, 0xc0005f2400)
	/go/src/github.com/openshift/image-registry/vendor/github.com/docker/distribution/registry/handlers/app.go:127 +0x335a
github.com/openshift/image-registry/pkg/dockerregistry/server/supermiddleware.NewApp(0x199c940, 0xc000042038, 0xc000094e00, 0x19a2ec0, 0xc000465290, 0x19a4ee0)
	/go/src/github.com/openshift/image-registry/pkg/dockerregistry/server/supermiddleware/app.go:96 +0x85
github.com/openshift/image-registry/pkg/dockerregistry/server.NewApp(0x199c940, 0xc000042038, 0x19830c0, 0xc00000e258, 0xc000094e00, 0xc0004ce000, 0x0, 0x0, 0x0, 0x0)
	/go/src/github.com/openshift/image-registry/pkg/dockerregistry/server/app.go:138 +0x287
github.com/openshift/image-registry/pkg/cmd/dockerregistry.NewServer(0x199c940, 0xc000042038, 0xc000094e00, 0xc0004ce000, 0x0, 0x0, 0x19bcae0)
	/go/src/github.com/openshift/image-registry/pkg/cmd/dockerregistry/dockerregistry.go:210 +0x190
github.com/openshift/image-registry/pkg/cmd/dockerregistry.Execute(0x197f8a0, 0xc00000e028)
	/go/src/github.com/openshift/image-registry/pkg/cmd/dockerregistry/dockerregistry.go:164 +0x9e1
	/go/src/github.com/openshift/image-registry/cmd/dockerregistry/main.go:93 +0x3f6

Expected results:

Should prompt warning for the name contains a sequence of dashes

Additional info:

must-gather logs here: 

Comment 2 XiuJuan Wang 2019-11-20 09:34:35 UTC
Container names must start with a letter or number, and can contain only letters, numbers, and the dash (-) character.
Every dash (-) character must be immediately preceded and followed by a letter or number; consecutive dashes are not permitted in container names.
All letters in a container name must be lowercase.
Container names must be from 3 through 63 characters long.
Verified with 4.3.0-0.nightly-2019-11-19-122017

Comment 4 errata-xmlrpc 2020-01-23 11:05:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.