Bug 1466153 - [DOCS] BuildDefaultsConfig does not work for env variables
Summary: [DOCS] BuildDefaultsConfig does not work for env variables
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Documentation
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
: ---
Assignee: brice
QA Contact: Vikram Goyal
Vikram Goyal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-29 07:58 UTC by Vladislav Walek
Modified: 2020-09-10 10:47 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-07-19 04:25:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Vladislav Walek 2017-06-29 07:58:13 UTC
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 14:07:12 UTC
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 14:15:56 UTC
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 14:20:03 UTC
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 07:14:52 UTC
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 15:37:21 UTC
oc describe the build please, and also provide the build yaml.

Comment 6 Ben Parees 2017-06-30 21:22:17 UTC
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 07:30:18 UTC
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 06:31:19 UTC
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 14:21:02 UTC
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 04:25:12 UTC
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.