GoogleCloudPlatform / GoogleCloudPlatform/cloud-code-intellij

Allow Cloud Code to run Skaffold relative to a non-root directory

Open
#2,785 2 comments 0 reactions 0 assignees View on GitHub
area/kubernetes area/skaffold kind/feature-request priority/p3
Dominant language
No language data
Stars
325
Forks
64
PR merge metrics
No merged PRs in 30d

Description

- Cloud Code for IntelliJ version: 20.6.1
- OS: Linux 5.7.6-arch1-1 x86_64 GNU/Linux

**What did you do?**

We store our `skaffold.yaml` files not in a project root, but in nested directory, i.e. `deployment/skaffold.yaml`.
In the same manner we have Helm chart in deployment directory, i.e. `deployment/mychart`. In `skaffold.yaml`, this chart is referenced relative to the project root:

```
deploy:
helm:
releases:
- name: myrelease
namespace: mynamespace
chartPath: deployment/mychart
```

When I run `skaffold run -f deployment/skaffold.yaml -p dev-env` from the project root, everything works correclty, and chart reference `deployment/mychart` is handled properly, so chart gets deployed. However, this is not the case for Cloud Run plugin.

Cloud Code Kubernetes confiuration allows specifying skaffold file in `advanced` section, but it seems it treats its directory as the project root and thus all references inside this file are treated relative to it. So I get the error:

```
watching files for deployer: listing files: issue walking releases: lstat deployment/mychart: no such file or directory
```

**What did you expect to see?**

I expect that the plugin assumes project root as the base directory for skaffold relative paths. Otherwise configurable.

**What did you see instead?**

```
/usr/bin/skaffold dev --filename skaffold.yaml --profile dev-env --label ide=GoLand --label ideVersion=2020.1.3.0.0 --label ijPluginVersion=unknown --cleanup=false --auto-build=false --auto-deploy=false --rpc-port 50051 --port-forward=true --status-check=true --enable-rpc=true --verbosity info
time="2020-06-30T12:28:21+03:00" level=info msg="starting gRPC server on port 50051"
time="2020-06-30T12:28:21+03:00" level=info msg="starting gRPC HTTP server on port 50052"
time="2020-06-30T12:28:21+03:00" level=info msg="Skaffold &{Version:v1.12.0 ConfigVersion:skaffold/v2beta5 GitVersion: GitCommit:e680a831292e1c7efc54e0c6d40544ae141e6354 GitTreeState:clean BuildDate:2020-06-25T13:14:09Z GoVersion:go1.14.2 Compiler:gc Platform:linux/amd64}"
time="2020-06-30T12:28:21+03:00" level=info msg="applying profile: dev-env"
time="2020-06-30T12:28:21+03:00" level=info msg="no values found in profile for field TagPolicy, using original config values"
time="2020-06-30T12:28:21+03:00" level=info msg="no values found in profile for field BuildType, using original config values"
time="2020-06-30T12:28:21+03:00" level=info msg="Using kubectl context: *redacted*"
watching files for deployer: listing files: issue walking releases: lstat deployment/mychart: no such file or directory
Listing files to watch...
- eu.gcr.io/myproject/myapp
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.