Bug 1466153 - [DOCS] BuildDefaultsConfig does not work for env variables
[DOCS] BuildDefaultsConfig does not work for env variables
Status: CLOSED CURRENTRELEASE
Product: OpenShift Container Platform
Classification: Red Hat
Component: Documentation (Show other bugs)
3.5.0
Unspecified Unspecified
medium Severity high
: ---
: ---
Assigned To: brice
Vikram Goyal
Vikram Goyal
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-29 03:58 EDT by Vladislav Walek
Modified: 2017-07-19 00:25 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-07-19 00:25:12 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)

  None (edit)
Description Vladislav Walek 2017-06-29 03:58:13 EDT
Description of problem:

The BuildDefaultsConfig does not propagate the variables to the build. Simply it does not work as described in docs [1].

Tested on 3.4 and 3.5. Master config look like:

kubernetesMasterConfig:
  admissionConfig:
    pluginConfig:
      BuildDefaults:
        configuration:
          apiVersion: v1
          env:
          - name: BUILD_LOGLEVEL
            value: 9
          - name: NO_PROXY
            value: .cluster.local,172.30.0.0,0.0.0.0
          kind: BuildDefaultsConfig

[1] https://docs.openshift.com/container-platform/3.4/install_config/build_defaults_overrides.html#manually-setting-global-build-defaults

Version-Release number of selected component (if applicable):
OpenShift Container Platform 3.4 and 3.5

How reproducible:
Configure the build defaults as described in docs.

Actual results:
No env propagated to Build Config.

Expected results:
The Build defaults will be visible in build config and will be used during the build.

Additional info:
Please, also report that to documentation as described solution does not work.
Comment 1 Ben Parees 2017-06-29 10:07:12 EDT
you've nested the config under kubernetesMasterConfig.  That is not where it goes, the admissionConfig for openshift is a toplevel section, which is why the doc does not show "kubernetesMasterConfig" in the example.

your config should look like:
admissionConfig:
  pluginConfig:
    builddefualtconfig goes here
kubernetesMasterConfig:
  blahblah
Comment 2 Vladislav Walek 2017-06-29 10:15:56 EDT
Hello Ben,

I tried that also in admissionConfig, and it still doesn't work:

admissionConfig:
  pluginConfig:
    BuildDefaults:
      configuration:
        apiVersion: v1
        env:
        - name: BUILD_LOGLEVEL
          value: 9
        - name: NO_PROXY
          value: .cluster.local,172.30.0.0,0.0.0.0
        kind: BuildDefaultsConfig

I did test on both locations. It doesn't work.
Just for your info, I restarted the master-api and master-controllers service.
Thx
Comment 3 Ben Parees 2017-06-29 10:20:03 EDT
how are you confirming the variables are not being set?  they will not show up in the buildconfig or in the buildobject.  the only way to really check is to have your Dockerfile or assemble script reference them.
Comment 4 Vladislav Walek 2017-06-30 03:14:52 EDT
Hello Ben,

I am configuring the logging level of the build:
        - name: BUILD_LOGLEVEL
          value: 9

So I expect that I would see the full build log. However, I edited it, restarted master-api and controllers service.
Somehow the build will stay in New status, no pod is created. Any idea?
thx
Comment 5 Ben Parees 2017-06-30 11:37:21 EDT
oc describe the build please, and also provide the build yaml.
Comment 6 Ben Parees 2017-06-30 17:22:17 EDT
fyi this master-config worked as expected for me:


admissionConfig:
  pluginConfig:
    BuildDefaults:
      configuration:
        apiVersion: v1
        kind: BuildDefaultsConfig
        env:
        - name: BUILD_LOGLEVEL
          value: "8"
................

your issue may be that you did not quote 9, but in my case not doing so resulted in the server not even starting up because the master-config is not parseable.
Comment 7 Vladislav Walek 2017-07-03 03:30:18 EDT
Hello Ben,

yes, this could be the issue. I will test it on my lab and let you know.
Thx
Comment 8 wewang 2017-07-04 02:31:19 EDT
Hello Ben and Vladislav 

It both works in version
openshift v3.5.5.31.1 and v3.4.1.44.1
 
and add test case(id:OCP-14967) for the  senario.
Comment 10 Ben Parees 2017-07-05 10:21:02 EDT
Not correct.  The admission config does not go in the kubernetesMasterConfig section.  The docs are incorrect.  This PR fixed them and apparently was never ported into the OCP docs:
https://github.com/openshift/openshift-docs/pull/3480

I'm going to reassign this bug to the docs team to get the changes into the OCP docs.
Comment 12 brice 2017-07-19 00:25:12 EDT
As Ben said above, this was a problem with the release. 

This has been fixed. As mentioned in the PR, here's the links to the published sections:

https://access.redhat.com/documentation/en-us/openshift_container_platform/3.5/html-single/installation_and_configuration/#manually-setting-global-build-defaults

https://access.redhat.com/documentation/en-us/openshift_container_platform/3.5/html-single/installation_and_configuration/#manually-setting-global-build-overrides

If there's more to this BZ, then please let us know. I'll close this BZ.

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