Bug 1708568

Summary: scaleup hosts will fail at TASK [Get release image] if openshift_kubeconfig_path="~/.kube/config"
Product: OpenShift Container Platform Reporter: Weihua Meng <wmeng>
Component: InstallerAssignee: Russell Teague <rteague>
Installer sub component: openshift-ansible QA Contact: Weihua Meng <wmeng>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: kalexand
Version: 4.1.0   
Target Milestone: ---   
Target Release: 4.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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.
Story Points: ---
Clone Of:
: 1708588 (view as bug list) Environment:
Last Closed: 2019-06-04 10:48:39 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 Weihua Meng 2019-05-10 08:47:37 UTC
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 
use absolute path

Comment 6 Weihua Meng 2019-05-13 02:01:08 UTC
Fixed.

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

Comment 8 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