Bug 2089402 - BuildConfig throws error when using a label with a / in it
Summary: BuildConfig throws error when using a label with a / in it
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Build
Version: 4.8
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.12.0
Assignee: jawed
QA Contact: Jitendar Singh
Depends On:
Blocks: 2105167
TreeView+ depends on / blocked
Reported: 2022-05-23 15:04 UTC by Alok Singh
Modified: 2023-01-17 19:49 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Last Closed: 2023-01-17 19:48:59 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Github openshift openshift-apiserver pull 292 0 None open Bug 2089402: Validate Image labels correctly 2022-07-06 08:40:45 UTC
Red Hat Product Errata RHSA-2022:7399 0 None None None 2023-01-17 19:49:15 UTC

Description Alok Singh 2022-05-23 15:04:38 UTC
Description of problem:

When using a label with a / in it in buildconfig, it throws an error like below:

"The BuildConfig "cpd-cli" is invalid: spec.output.imageLabels[0].name: Invalid value: "app.kubernetes.io/part-of": a valid config key must consist of alphanumeric characters, '-', '_' or '.' (e.g. 'key.name',  or 'KEY_NAME',  or 'key-name', regex used for validation is '[-._a-zA-Z0-9]+')"

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

How reproducible:

Steps to Reproduce:
1. Create a buildconfig manifest having 'imageLabels:' option and the label name  having a / in it like below:

      - name: app.kubernetes.io/part-of
        value: customized-app
2. Try to create the buildconfig using 'oc create -f <file-name>'
3. It throws the mentioned error and does't allow a label with / in it

Actual results:
Getting the mentioned error when trying to use a label with / in it

Expected results:
The buildconfig should get created without any error. It should accept a label with /.

Additional info:

Comment 2 jawed 2022-07-06 08:39:40 UTC
hi @alosingh 
I am proposing a fix in the this PR https://github.com/openshift/openshift-apiserver/pull/292

Comment 5 Priti Kumari 2022-07-12 14:11:14 UTC

Comment 10 errata-xmlrpc 2023-01-17 19:48:59 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 (Moderate: OpenShift Container Platform 4.12.0 bug fix and security update), 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.