Skip to content

Can't run any oc commands - Unable to determine home directory #220

@NadijaKozoriz

Description

@NadijaKozoriz

Hi team,
I'm trying to implement a pipeline that would create an OC deployment. However, it fails at any oc command.
The pipeline example:

name: $(Build.BuildId)

pool: server

trigger: none
    
jobs:
  - job: OC
    pool: oc-pool
    steps:
    - checkout: none
    - task: oc-cmd@3
      inputs:
        connectionType: 'OpenShift Connection Service'
        openshiftService: 'os-connection'
        cmd: 'oc get projects'

No matter what command is I'm getting same result:

Starting: occmd
==============================================================================
Task         : Execute oc command
Description  : OpenShift execute CLI command.
Version      : 3.0.2
Author       : Red Hat
Help         : See [getting started](https://github.com/redhat-developer/openshift-vsts/blob/master/docs/getting-started.md)
==============================================================================
/opt/azure_agents/_work/12/s/.download/oc login --insecure-skip-tls-verify -u *** -p *** https://api.ocp.company.com:6443/
WARNING: Using insecure TLS client config. Setting this option is not supported!

Login successful.

You have access to 10 projects, the list has been suppressed. You can list all projects with 'oc projects'

Using project "default".
##[error]Unable to determine home directory
Finishing: occmd

Apparently first part of command (login) is executed with no problems. But then something happens.

I tried to run oc get projects under same user that is used to run agent and got proper response.

If, however, instead of using oc-cmd I use bash:

- bash: |
    oc login --insecure-skip-tls-verify -u user -p password https://api.ocp.company.com:6443/
    oc get projects

I get expected result

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions