Bug 1414770 - Decouple the configuration of BuildDefaults and BuildOverrides
Summary: Decouple the configuration of BuildDefaults and BuildOverrides
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Ben Parees
QA Contact: Johnny Liu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-19 12:06 UTC by Gan Huang
Modified: 2017-07-24 14:11 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-09 04:10:47 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0903 0 normal SHIPPED_LIVE OpenShift Container Platform atomic-openshift-utils bug fix and enhancement 2017-04-12 22:45:42 UTC

Description Gan Huang 2017-01-19 12:06:28 UTC
Description of problem:
If setting BuildOverrides in inventory hosts file, BuildDefaults would be configured automatically in master-config.yaml. This is not what the users expected. Same results when configuring BuildDefaults only.

Version-Release number of selected component (if applicable):
openshift-ansible-3.5.1-1.git.0.e23e9bf.el7.noarch.rpm

How reproducible:
always

Steps to Reproduce:
1.cat inventory_hosts

<--snip-->
openshift_buildoverrides_force_pull=true
<--snip-->

2. Run BYO playbook
3.

Actual results:
# cat /etc/origin/master/master-config.yaml 
admissionConfig:
  pluginConfig:
    BuildDefaults:
      configuration:
        apiVersion: v1
        env:
        - name: HTTP_PROXY
          value: ''
        - name: HTTPS_PROXY
          value: ''
        - name: NO_PROXY
          value: ''
        - name: http_proxy
          value: ''
        - name: https_proxy
          value: ''
        - name: no_proxy
          value: ''
        kind: BuildDefaultsConfig
        resources:
          limits: {}
          requests: {}
    BuildOverrides:
      configuration:
        apiVersion: v1
        forcePull: 'true'
        kind: BuildOverridesConfig

<--snip-->

Expected results:


Additional info:

Same results when configuring BuildDefaults only.

1.cat inventory_hosts

<--snip-->
openshift_builddefaults_resources_requests_cpu=100m
<--snip-->

2./etc/origin/master/master-config.yaml

admissionConfig:
  pluginConfig:
    BuildDefaults:
      configuration:
        apiVersion: v1
        env:
        - name: HTTP_PROXY
          value: ''
        - name: HTTPS_PROXY
          value: ''
        - name: NO_PROXY
          value: ''
        - name: http_proxy
          value: ''
        - name: https_proxy
          value: ''
        - name: no_proxy
          value: ''
        kind: BuildDefaultsConfig
        resources:
          limits: {}
          requests:
            cpu: 100m
    BuildOverrides:
      configuration:
        apiVersion: v1
        kind: BuildOverridesConfig

Comment 1 Scott Dodson 2017-01-19 14:33:09 UTC
Ben,

Do you feel comfortable investigating this?

Comment 2 Ben Parees 2017-01-19 17:26:24 UTC
I'm going to have questions for you, but I can own it.

Comment 3 Ben Parees 2017-01-20 23:48:16 UTC
The behavior is not that setting one causes the other to be set, it's that both the defaults and overrides plugin configuration will *always* be set now, even if no explicit configuration values are provided.

The plugin configuration that is generated in this case is the same as if no configuration was provided (all the values in the config represent the default behavior of the admission plugins).  So this is working as designed.

However I am going to try to cleanup the setting of the PROXY env variables.  Although setting them to empty string doesn't hurt anything, it will be cleaner to not set them at all if the user did not provide a value.

Comment 5 Ben Parees 2017-01-24 17:32:30 UTC
Per comment 3, i've updated the behavior to not set the proxy env variables if no value is being supplied.  The plugin configuration itself will remain, but again all the default/empty settings will have no effect.

Comment 6 Wang Haoran 2017-02-03 06:26:55 UTC
Verified with version:
openshift v3.5.0.14+20b49d0
kubernetes v1.5.2+43a9be4
etcd 3.1.0

After install with no BuildDefualts ansible items :

admissionConfig:
  pluginConfig:
    BuildDefaults:
      configuration:
        apiVersion: v1
        env: []
        kind: BuildDefaultsConfig
        resources:
          limits: {}
          requests: {}
    BuildOverrides:
      configuration:
        annotations:
          annotationkey1: annotationvalue1
        apiVersion: v1
        forcePull: true
        imageLabels:
        - name: imagelabelname1
          value: imagelabelvalue1
        kind: BuildOverridesConfig
        nodeSelector:
          nodelabel1: nodelabelvalue1


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