GoogleCloudPlatform / cloud-code-vscode

Cloud Code for Visual Studio Code: Issues, Documentation and more
Other
420 stars 112 forks source link

Weird behavior with kaniko build type #853

Closed pkoutsovasilis closed 1 year ago

pkoutsovasilis commented 1 year ago

Environment: (Hint: "Report Extension Issue on Github" command will fill these out for you.)

Version information

Cloud Code Extension version:

VSCode version: 2.0.0

OS: WSL 2 Windows 10 22H2

Cloud SDK: 448.0.0

Skaffold: v2.7.0

Kubectl: v1.27.5-dispatcher

Description:

I have the following skaffold.yaml

apiVersion: skaffold/v4beta6
kind: Config
build:
  artifacts:
    - image: pkoutsovasilis/test-image
      runtimeType: go
      kaniko:
        useNewRun: true
        image: gcr.io/kaniko-project/executor:latest
        dockerfile: dev/Dockerfile
  cluster:
    concurrency: 0
    randomDockerConfigSecret: false
    pullSecretPath: /home/pkoutsovasilis/test-key.json
    randomPullSecret: false
manifests:
  rawYaml:
    - dev/*.yaml

when I run debug on k8s through the cloud-code extension skaffold doesn't recognize any debuggable artifacts and thus my container is not being deployed with the necessary golang install debug tools sidecar container. However, when I invoke this directly through skaffold binary it works (I borrowed the cmd from the output of the invocation through the extension) skaffold debug -v info --port-forward --auto-build --auto-deploy --auto-sync --rpc-http-port 34615 --filename /home/pkoutsovasilis/test-image/skaffold.yaml --wait-for-deletions-max 2m0s --wait-for-connection --default-repo gcr.io/...

Weirdly enough, if I docker pull the image built by kaniko and reinvoke the debug on kubernetes through the extension my artifact is being recognized and I get a debugger.. 😕 any ideas/help

Repro step:

I guess the above?! 😃

SKrupa commented 1 year ago

Sorry you're running into this problem; looks like there might be a bug where something is getting lost along the way.

I'll try and get a repro of this issue; in the meantime, do you have the builds logs for this run available? They can be accessed by clicking the "Build Containers" tab in the Development Sessions explorer in Cloud Code. Thanks!

SKrupa commented 1 year ago

Cloud Code does not explicitly support Kaniko at this time, it currently targets local and Cloud Build. I've put in a feature request to add support for this for now.