devspace-sh / devspace

DevSpace - The Fastest Developer Tool for Kubernetes ⚡ Automate your deployment workflow with DevSpace and develop software directly inside Kubernetes.
https://devspace.sh
Apache License 2.0
4.19k stars 351 forks source link

Devspace tries to clone dependencies when told to skip them #2145

Closed withinboredom closed 2 years ago

withinboredom commented 2 years ago

What happened?
CI fails when there are dependencies because CI doesn't have access to those dependencies. When told to skip them via --skip-denpencency it still tries to clone them anyway resulting in a failure.

What did you expect to happen instead?
Only the dependencies that aren't skipped to be cloned.

How can we reproduce the bug? (as minimally and precisely as possible)

My devspace.yaml:

version: v2beta1
name: example

dependencies:
  fake-dep:
    git: git@github.com:example/this-does-not-exist.git
    branch: main

# add the above to any devspace.yaml

Run the following to illustrate:

docker run -it --rm -v $(pwd):/app -v ~/.kube/config:/root/.kube/config -v $(which devspace):$(which devspace) -v $(which loft):$(which loft) -w /app ubuntu:latest bash

Then inside the container,

./devspace build --skip-dependency fake-dep

Possible errors:

fatal deploy dependencies: resolve dependencies: git not found in path. Please make sure you have git installed to clone git dependencies
fatal deploy dependencies: resolve dependencies: clone repository: Error running 'git clone git@github.com:example/this-does-not-exist.git REDACTED --branch main --depth 1'
Warning: Permanently added the ECDSA host key for IP address '140.82.112.3' to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

Note that we are using a repository that doesn't exist as a proxy for a private repository. The error is the same.

Currently, the workaround is to give the CI runner access to the dependencies even though all it does is clone them.

Local Environment:

Anything else we need to know?

/kind bug

FabianKramm commented 2 years ago

@withinboredom thanks for reporting this issue, you are correct, seems like DevSpace is still trying to resolve those. We will fix this!