GoogleContainerTools / GoogleContainerTools/skaffold
My schema'd dockerfile fails parsing
- Dominant language
- Go
- Stars
- 15.9k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 10
Description
### Expected behavior
Arbitrary syntax should be valid when the `# syntax` directive is enabled.
### Actual behavior
Given a `Cargo.toml` like this:
```toml
# syntax = denzp/cargo-wharf-frontend:v0.1.0-alpha.2
[package]
name = "testpkg"
version = "0.1.0"
[package.metadata.wharf.output]
env = { RUST_LOG = "info" }
```
And this `skaffold.yaml`:
```yaml
---
apiVersion: skaffold/v1beta16
kind: Config
metadata:
name: myconfig
build:
artifacts:
- image: myimg
context: .
docker:
dockerfile: Cargo.toml
local:
useBuildkit: true
```
You get this error:
```bash
$ skaffold dev
Listing files to watch...
- myimg
listing files: unable to evaluate build args: removing unused default args: parsing dockerfile: Syntax error - can't find = in "{". Must be of the form: name=value
```
If you comment out `env = { RUST_LOG = "info" }` from `Cargo.toml` then run `skaffold run` then the build will work.
I believe this test case was missed by #5441.
I'm not familiar with the code at all, but it seems like some actual parsing of the file contents is being done prior to the syntax directive being checked.
### Information
- Skaffold version: v1.24.1
- Operating system: Ubuntu 20.04
- Installed via: skaffold.dev
Contributor guide
Assessment
This issue has not been assessed yet.