Bug 1708588 - upgrade hosts will fail at TASK [Cordon node prior to upgrade] if openshift_kubeconfig_path="~/.kube/config"
Summary: upgrade hosts will fail at TASK [Cordon node prior to upgrade] if openshift_k...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.1.0
Assignee: Russell Teague
QA Contact: Weihua Meng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-05-10 09:31 UTC by Weihua Meng
Modified: 2019-06-04 10:48 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: The openshift client 'oc' does not support tilde '~' in kube config paths. Consequence: 'oc' would fail to load the kube config using the default path provided '~/.kube/config' Fix: An additional filter was added to convert user home paths to full paths before passing to 'oc' Result: 'oc' is able to load the kube config from user home and default paths.
Clone Of: 1708568
Environment:
Last Closed: 2019-06-04 10:48:39 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:0758 0 None None None 2019-06-04 10:48:47 UTC

Description Weihua Meng 2019-05-10 09:31:00 UTC
TASK [Cordon node prior to upgrade] *******************************************************************************************************************************************************************************
task path: /usr/share/ansible/openshift-ansible/playbooks/upgrade.yml:23
Friday 10 May 2019  05:23:12 -0400 (0:00:21.078)       0:00:23.883 ************ 
Using module file /usr/local/lib/python3.6/site-packages/ansible/modules/commands/command.py
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: wmeng
<localhost> EXEC /bin/sh -c '/usr/bin/python3.6 && sleep 0'
failed: [dell-r730-068.dsal.lab.eng.rdu2.redhat.com -> localhost] (item=dell-r730-068.dsal.lab.eng.rdu2.redhat.com) => {
    "changed": true,
    "cmd": [
        "oc",
        "adm",
        "cordon",
        "dell-r730-068.dsal.lab.eng.rdu2.redhat.com",
        "--config=~/.kube/config"
    ],
    "delta": "0:00:00.100601",
    "end": "2019-05-10 05:23:13.202324",
    "invocation": {
        "module_args": {
            "_raw_params": "oc adm cordon dell-r730-068.dsal.lab.eng.rdu2.redhat.com --config=~/.kube/config",
            "_uses_shell": false,
            "argv": null,
            "chdir": null,
            "creates": null,
            "executable": null,
            "removes": null,
            "stdin": null,
            "warn": true
        }
    },
    "item": "dell-r730-068.dsal.lab.eng.rdu2.redhat.com",
    "msg": "non-zero return code",
    "rc": 1,
    "start": "2019-05-10 05:23:13.101723",
    "stderr": "error: stat ~/.kube/config: no such file or directory",
    "stderr_lines": [
        "error: stat ~/.kube/config: no such file or directory"
    ],
    "stdout": "",
    "stdout_lines": []
}


+++ This bug was initially created as a clone of Bug #1708568 +++

Description of problem:
scaleup hosts will fail at TASK [Get release image] if openshift_kubeconfig_path="~/.kube/config"

Root Cause: https://bugzilla.redhat.com/show_bug.cgi?id=1231760

Version-Release number of the following components:
openshift-ansible-4.1.0-201905090634.git.152.2919e46.el7.noarch
ansible-2.7.10-1.el7.noarch

How reproducible:
Always

Steps to Reproduce:
1. run ansible playbooks with openshift_kubeconfig_path="~/.kube/config" in inventory host file.

Actual results:
failed.

fatal: [dell-r730-068.dsal.lab.eng.rdu2.redhat.com -> localhost]: FAILED! => {
    "attempts": 36,
    "changed": true,
    "cmd": [
        "oc",
        "get",
        "clusterversion",
        "--config=~/.kube/config",
        "--output=jsonpath={.items[0].status.desired.image}"
    ],
    "delta": "0:00:00.106092",
    "end": "2019-05-10 02:04:01.909090",
    "invocation": {
        "module_args": {
            "_raw_params": "oc get clusterversion --config=~/.kube/config --output=jsonpath='{.items[0].status.desired.image}'",
            "_uses_shell": false,
            "argv": null,
            "chdir": null,
            "creates": null,
            "executable": null,
            "removes": null,
            "stdin": null,
            "warn": true
        }
    },
    "msg": "non-zero return code",
    "rc": 1,
    "start": "2019-05-10 02:04:01.802998",
    "stderr": "error: stat ~/.kube/config: no such file or directory",
    "stderr_lines": [
        "error: stat ~/.kube/config: no such file or directory"
    ],
    "stdout": "",
    "stdout_lines": []
}


Expected results:
ansible playbook finish successfully.

Additional info: 
$ oc get clusterversion --config ~/.kube/config
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.1.0-0.nightly-2019-05-09-204138   True        True          2m50s   Unable to apply 4.1.0-0.nightly-2019-05-09-204138: the image may not be safe to use

$ oc get clusterversion --config=~/.kube/config
error: stat ~/.kube/config: no such file or directory
[

workaround 
replace with absolute path

Comment 3 Weihua Meng 2019-05-13 02:01:57 UTC
Fixed.

openshift-ansible-4.1.0-201905101832.git.156.4682a8f.el7.noarch

Comment 5 errata-xmlrpc 2019-06-04 10:48:39 UTC
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-2019:0758


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