Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.13: [Bug]: Failure to use specified build action in Kubernetes deploy action #4931

Closed
agates4 opened this issue Aug 9, 2023 · 1 comment · Fixed by #4846
Closed

0.13: [Bug]: Failure to use specified build action in Kubernetes deploy action #4931

agates4 opened this issue Aug 9, 2023 · 1 comment · Fixed by #4846
Assignees

Comments

@agates4
Copy link

agates4 commented Aug 9, 2023

Garden Bonsai (0.13) Bug

Current Behavior

When specifying a build action under the build key, the commands ran do not utilize the build directory, but instead use the source directory.

Expected behavior

When I specify the build action, the build directory should be used.

Reproducible example

in this example, we generate an example Kubernetes manifest and attempt to deploy it.

First, run this command:
helm repo add examples https://helm.github.io/examples

Next, use these modules:

type: exec
kind: "Build"
name: infra-python-starter-generate-config
description: Istio, DNS, CA certs, and other config
include:
  - asdf
spec:
  command:
    - helm
    - template
    - --name-template=${project.name}
    - --output-dir=${this.buildPath}
    - examples/hello-world
---
type: kubernetes
name: infra-python-starter-apply-config
kind: "Deploy"
dependencies:
  - build.infra-python-starter-generate-config
build: infra-python-starter-generate-config
description: Istio, DNS, CA certs, and other config
spec:
  files:
    - ./hello-world/templates/*.yaml
  timeout: 2400
  namespace: default
---

Building works in creating a .garden/build/infra-python-starter-generate-config/hello-world/templates folder,
however, deployment fails with this error:

Invalid manifest file path(s) in Deploy action 'infra-python-starter-apply-config'. Cannot find manifest file(s) at ./hello-world/templates/ in /Users/aron/Workspace/Pachama/infra/infra-python-starter directory.

Workaround

A workaround would be to create a exec deploy action, which does have access to the build folder contents.
But, this doesn't give us the natively supported features of the kubernetes action, like syncing folders to the deployment, cleanup, or status commands.
Like this:

type: exec
kind: "Build"
name: infra-python-starter-generate-config
description: Istio, DNS, CA certs, and other config
include:
  - asdf
spec:
  command:
    - helm
    - template
    - --name-template=${project.name}
    - --output-dir=${this.buildPath}
    - examples/hello-world
---
type: exec
name: infra-python-starter-apply-config
kind: "Deploy"
dependencies:
  - build.infra-python-starter-generate-config
build: infra-python-starter-generate-config
include:
  - .garden/build/infra-python-starter-generate-config
description: Istio, DNS, CA certs, and other config
spec:
  deployCommand:
    - kubectl
    - apply
    - -f
    - hello-world/templates
---

Suggested solution(s)

There appears to be an issue with the 0.13 Kubernetes deploy action source code.

Additional context

This is a blocker for migrating to version 13

Your environment

  • OS: macOS
  • How I'm running Kubernetes: GKE
  • Garden version: 0.13.10
@agates4 agates4 added the 0.13 label Aug 9, 2023
@jalper jalper added the bug label Aug 11, 2023
@vvagaytsev
Copy link
Collaborator

It looks like the same issue as in #4506.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants