GoogleContainerTools / GoogleContainerTools/skaffold

`skaffold render --filename -` breaks due to helm post renderer

Open
#8,853 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

Skaffold render breaks when trying to render manifests from helm charts, when the Skaffold config is passed via `stdin`.
The issue seems to be that Helm post renderer expects the rendered manifests on `stdin`, while Skaffold expects the configuration on `stdin` as well.

Our use-case for using `--filename -` is pre-processing of the configuration, to e.g. replace env vars on un-templated fields and such.
While it would be possible to store the intermediate config in a temporary file, it is inconvenient, especially when running locally.

### Expected behavior

Piping a valid configuration to `skaffold render --filename -` renders valid manifests according to the configuration (helm releases).

### Actual behavior

```
std out err: %!(EXTRA *errors.errorString=Error: error while running post render on files: error while running command /opt/homebrew/bin/skaffold. error output:
parsing skaffold config: error parsing skaffold configuration file: unknown skaffold config API version "v1". Set the config 'apiVersion' to a known value. Check https://skaffold.dev/docs/references/yaml/ for the list of valid API versions. Otherwise, check that your skaffold version is up-to-date.
: exit status 1
```

### Information

- Skaffold version: `2.5.0`
- Operating system: `macos 12.6.5`
- Installed via: Homebrew
- Contents of skaffold.yaml:

```yaml
apiVersion: skaffold/v4beta5
kind: 'Config'
build:
artifacts:
- image: 'temp/one'
manifests:
helm:
releases:
- name: 'one'
chartPath: 'helm/charts/test'
setValueTemplates:
image.tag: 'test@{{.IMAGE_DIGEST}}'
image.repository: 'temp/one'
```

### Steps to reproduce the behavior

1. a clonable repository with the sample skaffold project and a helm chart to render (`helm create helm/charts/test`)
2. run `cat skaffold.yaml | skaffold render --filename - --digest-source tag`
3. observe error

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.