Uploaded image for project: 'OpenShift Request For Enhancement'
  1. OpenShift Request For Enhancement
  2. RFE-3659

Feature request to perform a shallow clone --depth=1 with ref tag value set on the git buildConfig

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Unresolved
    • Undefined
    • None
    • None
    • Node
    • False
    • None
    • False
    • Not Selected
    • 0
    • 0% 0%

    Description

      1. Git build with "ref" tag  failing with RPC failed error because of project size
      2.  When trying to build an application, openshift build pod reported with error "RPC failed; curl 18 transfer closed with outstanding read data remaining".
        This error is due to size of the project and a workaround is to do a shallow clone first and then update the repository with its history:
        $ git clone http://github.com/large-repository --depth 1
        $ cd large-repository
        $ git fetch --unshallow
      • But when --depth=1 (shallow clone is set ) in this case, only the files associated with the most recent commit on the default branch (typically master) are downloaded. 
      • When trying to build application with "ref" tag (for example a  branch name.)  openshift build pod always perform a full git clone, meaning that project clone will always fail due to the project size is high in this case.

      source:
        git: 
          uri: "https://github.com/openshift/ruby-hello-world"
          ref: "master"
        contextDir: "app/dir" 
        dockerfile: "FROM openshift/ruby-22-centos7\nUSER example" 

       According to [openshit  doc|http://https://docs.openshift.com/container-platform/4.10/cicd/builds/creating-build-inputs.html |http://https//docs.openshift.com/container-platform/4.10/cicd/builds/creating-build-inputs.html] It is mentioned

      When no ref value is provided, OpenShift Container Platform performs a shallow clone (--depth=1). In this case, only the files associated with the most recent commit on the default branch (typically master) are downloaded. This results in repositories downloading faster, but without the full commit history. To perform a full git clone of the default branch of a specified repository, set ref to the name of the default branch (for example master).

       

      WORKAROUND : So at the moment the workaround for customer is to remove the "ref" tag from build config  so it by default set --depth =1 and always use the latest branch commit .

      Customer Request: 
      3. Customer need to use ref tag to build specific tag without always merging to the default branch.

      • Are we able to config some variable in the yaml to enable -depth option?
        - Allow defining shallow clone when using git ref from build config

       

      Reference :https://docs.openshift.com/container-platform/4.10/cicd/builds/creating-build-inputs.html

      Attachments

        Activity

          People

            gausingh@redhat.com Gaurav Singh
            rhn-support-egeorge Elizabeth George (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: