You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working with git repositories that require authentication, the project-clone container can successfully clone and read the repo, but will fail to checkout any revision specified in the devfile.
This is because the checkout step relies on the go-git library, which does not automatically import the global gitconfig.
How To Reproduce
Set up either a PAT or SSH key for your account in the cluster
Start a workspace that uses a private project and specifies a checkoutFrom:
projects:
- name: private-projectgit:
remotes:
origin: 'https://your-private-repo'checkoutFrom:
revision: main
As a result, the project clone container will log something like
2022/09/01 17:00:03 Using temporary directory /projects/project-clone-2774327822
2022/09/01 17:00:03 Read DevWorkspace at /devworkspace-metadata/flattened.devworkspace.yaml
2022/09/01 17:00:03 Processing project private-project
2022/09/01 17:00:03 Cloning project private-project to /projects/project-clone-2774327822/private-project
Cloning into '/projects/project-clone-2774327822/private-project'...
fatal: unable to get credential storage lock in 1000 ms: Read-only file system
2022/09/01 17:00:05 Cloned project private-project to /projects/project-clone-2774327822/private-project
2022/09/01 17:00:05 Setting up remotes for project private-project
fatal: unable to get credential storage lock in 1000 ms: Read-only file system
2022/09/01 17:00:05 Fetched remote origin at https://your-private-repo
2022/09/01 17:00:05 Encountered error while setting up project private-project: failed to checkout revision: failed to read remote origin: authentication required
and the project will not be set up correctly; the cloned project will be present in a temporary directory named project-clone-<random-chars>.
Note the messages fatal: unable to get credential storage lock in 1000 ms: Read-only file system are expected at the moment as the credentials file is mounted to from a configmap and results in a read-only filesystem in that directory.
Expected behavior
Since the auth required to clone the project is set up, project-clone should be able to checkout any revision as required.
Workaround
Do not specify checkoutFrom for private repos
Change to the desired revision after the project is cloned
The text was updated successfully, but these errors were encountered:
Description
When working with git repositories that require authentication, the project-clone container can successfully clone and read the repo, but will fail to checkout any revision specified in the devfile.
This is because the checkout step relies on the go-git library, which does not automatically import the global gitconfig.
How To Reproduce
As a result, the project clone container will log something like
and the project will not be set up correctly; the cloned project will be present in a temporary directory named
project-clone-<random-chars>
.Note the messages
fatal: unable to get credential storage lock in 1000 ms: Read-only file system
are expected at the moment as the credentials file is mounted to from a configmap and results in a read-only filesystem in that directory.Expected behavior
Since the auth required to clone the project is set up, project-clone should be able to checkout any revision as required.
Workaround
checkoutFrom
for private reposThe text was updated successfully, but these errors were encountered: