Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
NadijaKozoriz opened this issue Feb 16, 2024 · 1 comment
Open

Comments

@NadijaKozoriz
Copy link

NadijaKozoriz commented Feb 16, 2024

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants