Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-33199

The filepath including leading slash makes error during parsing devfile using Gitlab


    • Moderate
    • No
    • Rejected
    • False
    • Hide



      Description of problem:

      When creating an application based on devfile "Import from Git" in Developer console using only GitLab repo, the following error block to create it.
      It only happened when using GitLab, not Github. And CLI operation based on "oc new-app" could work well. In other words, the issue is only for Dev console.  
        Could not fetch kubernetes resource "/deploy.yaml" for component "kubernetes-deploy" from Git repository https://{gitlaburl}.

      Version-Release number of selected component (if applicable):


      How reproducible:


      Steps to Reproduce:

      You can always reproduce according to the following procedures.
      a. Switch "Developer" mode at your web console.
      b. Move "+Add", then click "Import from Git" in "Git Repository" section at the page.
      c. Input "https://<GITLAB HOSTNAME>/XXXX/devfile-sample-go-basic.git" to the "Git Repo URL" text box.
      d. Select "GitLab" at "Git type" drop box.
      e. You can see the below error messages.

      Actual results:

      The "/deploy.yaml" file path evaluated as invalid one with 400 response status during the process as follows.
      Look at the URL, "/%2Fdeploy.yaml" shows us leading slash was duplicated there.
        Request URL:
          https://<GITLAB HOSTNAME>/api/v4/projects/yyyy/repository/files/%2Fdeploy.yaml/raw?ref=main
          {"error":"file_path should be a valid file path"}

      Expected results:

       The request URL for handling "deploy.yaml" file should be removed the duplicated leading slash and provide correct file path.
       Request URL:
         https://<GITLAB HOSTNAME>/api/v4/projects/yyyy/repository/files/deploy.yaml/raw?ref=main
         "deploy.yaml" contents.

      Additional info:

      I submitted a pull request to fix this here: https://github.com/openshift/console/pull/13812 

            rhn-support-dapark Daein Park
            rhn-support-dapark Daein Park
            Sanket Pathak Sanket Pathak
            0 Vote for this issue
            4 Start watching this issue