Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1354519 - Default S2I images don't allow to set/configure their environmental values via web console
Default S2I images don't allow to set/configure their environmental values vi...
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console (Show other bugs)
3.2.0
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: bpeterse
Yadan Pei
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-07-11 09:25 EDT by Kenjiro Nakayama
Modified: 2017-03-08 13 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-09-27 05:39:40 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
screenshot for the "Actual results" in comment#0 (125.74 KB, image/png)
2016-07-11 09:25 EDT, Kenjiro Nakayama
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1933 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.3 Release Advisory 2016-09-27 09:24:36 EDT

  None (edit)
Description Kenjiro Nakayama 2016-07-11 09:25:07 EDT
Created attachment 1178399 [details]
screenshot for the "Actual results" in comment#0

Description of problem:
===

- New application from extended docker image via web console create deploymentConfig with other layers environmental values


How reproducible:
===
1. create Dockerfile

# cat <<EOF > Dockerfile
FROM registry.access.redhat.com/jboss-eap-6/eap64-openshift:latest
ENV FOO BAR
EOF


2. Build image and push to the docker hub.

  # docker build -t docker.io/<ACCOUNT>/eap64-extended . && docker push docker.io/<ACOCOUNT>/eap64-extended

3. Create imagestream and iimport image

# cat <<EOF > test-is.yaml
apiVersion: v1
kind: ImageStream
metadata:
  annotations:
    openshift.io/image.dockerRepositoryCheck: 2016-06-27T00:38:39Z
  creationTimestamp: null
  name: eap64-extended
spec:
  dockerImageRepository: docker.io/nak3/eap64-extended
  tags:
  - annotations:
      description: JBoss EAP 6.4 S2I images.
      iconClass: icon-jboss
      sampleContextDir: kitchensink
      sampleRef: 6.4.x
      sampleRepo: https://github.com/jboss-developer/jboss-eap-quickstarts.git
      supports: eap:6.4,javaee:6,java:8,xpaas:1.3
      tags: builder,eap,javaee,java,jboss,xpaas
      version: "latest"
    name: "latest"
status:
  dockerImageRepository: ""
EOF

   #  oc create -f test-is.yaml -n openshift &&  oc import-image eap64-extended -n openshift

Actual results:

- Access to the webconsole and click "Show advanced routing, build, and deployment options". It outputs the all environmental values including other layers'.


Expected results:
===
- Hide other layers' env values.


Additional info:
===
- If I created the application with oc new-app, deploymentConfig woudln't add the values.
Comment 1 Jessica Forrester 2016-07-11 12:44:43 EDT
new-app doesn't add them to the deployment config explicitly but the environment variables are there at runtime anyway because they are defined on the image itself, including env vars from previous layers. new-app let's you override the variables' values using the -e flag, the web console does it by displaying them to you in the list.  We have no plans to change this behavior in the web console because we are intentionally letting you know those variables exist and what they are set to.  If you want to remove environment variables you need to unset them as part of the image being built.
Comment 2 Kenjiro Nakayama 2016-07-11 13:17:05 EDT
Thank you for the answer. But then, it brings one unclear thing.

Default imagestream (e.g jboss-eap64-openshift) doesn't show any env value, like JBOSS_HOME, JBOSS_IMAGE_NAME and so on. So, although I agree with your design below, how to see these variables that are set on the default builder image via webconsole?

> We have no plans to change this behavior in the web console because we are intentionally letting you know those variables exist and what they are set to.
Comment 3 Jessica Forrester 2016-07-11 13:45:28 EDT
Thanks for bringing up this issue, the Env appears on one subobject in the API response in one case and a different subobject in the other case. We are looking into it.
Comment 4 Jessica Forrester 2016-07-11 15:06:54 EDT
We need to switch to always pulling dockerImageMetadata.Config.Env instead of dockerImageMetadata.ContainerConfig.Env
Comment 5 Kenjiro Nakayama 2016-07-11 20:08:04 EDT
* Update subject and here is the correct issue and reproduce steps *

Reproduce steps
===

1. Add new-project
2. Select "jboss-eap64-openshift"
3. Click "Show advanced routing, build, and deployment options Create"

Actual results:
===
- Deployment Config doesn't show any environment values to configure

Expected results:
===
- Show env values that the image have. (e.g JBOSS_HOME, JBOSS_IMAGE_NAME for jboss-eap64-openshift image)

Workaround 
===
- Extend the image and use the image
Comment 7 Jessica Forrester 2016-07-19 13:27:36 EDT
Fixed in Origin, we did end up changing the behavior, it will not save the env from the image, it now shows you the exist in a read only state and the user can choose to override those values if they want to explicitly set them to something different.  See details in https://github.com/openshift/origin-web-console/pull/161#issuecomment-233457077
Comment 8 Troy Dawson 2016-08-01 18:02:03 EDT
I'm not understanding how this is supposed to make it to OpenShift Container Platform.
Comment 9 Jessica Forrester 2016-08-01 19:14:05 EDT
@tdawson we only mark it as MODIFIED if the console change has been vendored back into the origin repo.
Comment 10 Troy Dawson 2016-08-08 17:36:52 EDT
This has been merged and is in OSE v3.3.0.17 or newer.
Comment 12 Yadan Pei 2016-08-10 21:48:42 EDT
Checked against openshift v3.3.0.18
kubernetes v1.3.0+507d3a7
etcd 2.3.0+git


This is verification steps

1. Create a new project
2. Select "jboss-eap64-openshift:1.4"
3. Click "Show advanced routing, build, and deployment options"
4. In Deployment Configuration section, click "Show/Hide image environment variables" could toggle the display of existing environment variables

Existing environment variables is shown as readonly and user could overwrite them by defining to different value
Comment 13 Yadan Pei 2016-08-10 21:49:37 EDT
This works as expected I think, move to VERIFIED
Comment 15 errata-xmlrpc 2016-09-27 05:39:40 EDT
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-2016:1933

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