GoogleContainerTools / GoogleContainerTools/container-structure-test

Metadata Cmd test failing but reported expected and actual values are identical

Open
#278 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.5k
Forks
212
PR merge metrics
No merged PRs in 30d

Description

The Metadata Cmd test is returning failing but the actual and expected CMD values are the same.

```bash
=== RUN: Metadata Test
--- FAIL
duration: 0s
Error: Image Cmd [/bin/sh -c /usr/local/bin/python main.py] does not match expected Cmd: [/bin/sh -c /usr/local/bin/python main.py]
```

I'm running this with `gcr.io/gcp-runtimes/container-structure-test:v1.10.0 ` and the following `config.yaml`

```yaml
schemaVersion: 2.0.0
metadataTest:
cmd: ["/bin/sh -c /usr/local/bin/python main.py"]
```

The error message comes from [metadata.go:L135](https://github.com/GoogleContainerTools/container-structure-test/blob/v1.10.0/pkg/types/v2/metadata.go#L135) which compares `len(*mt.Cmd)` to `len(imageConfig.Cmd)`.

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.