The "oc new-app" command fails when deploying from a private git repository

Solution Verified - Updated -

Issue

  • The oc new-app command using a private Git repository no longer works when using OpenShift Client versions 4.10/4.11. When a user tries to create a new application with a SSH based repository, oc fails on not being able to git ls-remote --heads due to authentication error. Customers will find the output below:

    ....
    error:  local file access failed with: stat git@gitlab.example.com:repo/mweb-php.git: no such file or directory
    error: unable to locate any images in image streams, templates loaded in accessible projects, template files, local docker images with name "git@gitlab.example.com:repo/mweb-php.git"
    
    Argument 'git@gitlab.example.com:repo/mweb-php.git' was classified as an image, image~source, or loaded template reference.
    

Environment

  • OpenShift Client
    • 4.10.z
    • 4.11.z

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content