Bug 1608688

Summary: fluentd fails to start on node when node-config.yaml contains "kubeletArguments: null"
Product: OpenShift Container Platform Reporter: Nicolas Nosenzo <nnosenzo>
Component: LoggingAssignee: Jeff Cantrill <jcantril>
Status: CLOSED DUPLICATE QA Contact: Anping Li <anli>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.9.0CC: aos-bugs, jcantril, jokerman, maszulik, mmccomas, rmeggins
Target Milestone: ---   
Target Release: 3.9.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-08-17 18:59:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nicolas Nosenzo 2018-07-26 07:22:35 UTC
Description of problem:
When kubeletArguments is set to "null" within the node-config.yaml file (which is the case for cluster upgraded from previous versions to 3.9), fluentd pod cannot start throwing the following message:

"""
-e:2:in `<main>': undefined method `[]' for nil:NilClass (NoMethodError)
"""

Version-Release number of selected component (if applicable):
OCP 3.9
image logging-fluentd-v3.9*

How reproducible:
100%

Steps to Reproduce:
1. Set "kubeletArguments: null" in node-config.yaml
2. Try to start fluentd pod

Actual results:
Pod fails to start

Expected results:
Pod should start without issues

Additional info:

The error comes from the run.sh script, from this portion of the code (not present in previous fluentd images):

------ run.sh extract -----
#NOTE: USE_CRIO variable used in generate_throttle_configs.rb as well
export USE_CRIO=false
node_config=/etc/origin/node/node-config.yaml
if [[ -f "$node_config" ]]; then
    cre=$(ruby -e "require 'yaml'; y=YAML.load_file('${node_config}')
        puts y['kubeletArguments']['container-runtime-endpoint']")
    if [[ "$cre" =~ crio ]]; then
        USE_CRIO=true
    fi
else
    echo "WARNING: Unable to check for cri-o"
fi
------ run.sh extract -----

Comment 1 Rich Megginson 2018-08-17 18:59:43 UTC

*** This bug has been marked as a duplicate of bug 1616448 ***