redhat-developer / openshift-vsts

OpenShift Extension for Azure DevOps.
Apache License 2.0
15 stars 20 forks source link

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

Open NadijaKozoriz opened 4 months ago

NadijaKozoriz commented 4 months ago

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

emykamal commented 3 months ago

@NadijaKozoriz I am facing the same issue, were you able to find a solution ?