Bug 1614155 - Env variable key needs to allow "-" for bc
Summary: Env variable key needs to allow "-" for bc
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Build
Version: 3.11.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: 3.11.z
Assignee: Corey Daley
QA Contact: Wenjing Zheng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-09 05:34 UTC by XiaochuanWang
Modified: 2018-12-12 14:16 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2018-12-12 14:15:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3743 0 None None None 2018-12-12 14:16:01 UTC

Description XiaochuanWang 2018-08-09 05:34:32 UTC
Description of problem:
On web console, dc allows "-" but bc does not allow it. 

Version-Release number of selected component (if applicable):
OpenShift Master: v3.11.0-0.11.0 
Kubernetes Master: v1.11.0+d4cacc0 
OpenShift Web Console: v3.11.0-0.11.0 

How reproducible:
always

Steps to Reproduce:
1. Login on web console, create an app by eg. oc new-app ruby~https://github.com/openshift/ruby-ex.git

2. Go to build config page, add env var, set the key to "test-key", "-key" with values


Actual results:
2. Error message pop up "An error occurred updating environment variables for build config ruby-sample-build."

Expected results:
2. Key should be added succesfully

Additional info:

Comment 1 Samuel Padgett 2018-08-09 12:45:32 UTC
`-key` not currently a valid env var name for build configs, which have different rules than deployment configs. This is enforced by the API server and not the console.

Reassigning to the build component. It looks like env var name validation was relaxed upstream in 1.8.

https://github.com/kubernetes/kubernetes/blob/8d7d7a5e0d4d7e75f5a860574346944b8cc0fc43/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L305-L306

Comment 2 Corey Daley 2018-08-23 18:29:35 UTC
submitted pull request: https://github.com/openshift/origin/pull/20738

Comment 6 XiaochuanWang 2018-12-04 05:27:01 UTC
      env:
        - name: test-key
          value: '-v'
        - name: '-key'
          value: '-value'
Env variables are added correctly now, verified on Openshift v3.11.51.

Comment 8 errata-xmlrpc 2018-12-12 14:15:51 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.

https://access.redhat.com/errata/RHBA-2018:3743


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