GoogleContainerTools / GoogleContainerTools/skaffold

Sidecar/Init containers causes verify to stop working

Open
#9,626 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

### Expected behaviour
A test pod with side cars and init containers used by verify should work the same as one without side cars and init containers

### Actual behaviour
When a pod has more than one container, verify does not work and the command hangs.

### Information

- Skaffold version: v2.13.2
- Operating system: Mac
- Installed via: Homebrew

### Steps to reproduce the behavior

1. Enable istio on the default namespace: istio-injection
2. Run verify: skaffold verify -a actifacts.json

### Problem
When Skaffold is querying for logs the following error occurs due to there being an Istio init container and istio side car container:
`a container name must be specified for pod`
Unfortunately this exception is swallowed by [this code](https://github.com/GoogleContainerTools/skaffold/blob/c1834b6296f5f8a19b64c3c97ade0c11e08e6958/pkg/skaffold/k8sjob/logger/log.go#L206) and the command seems to hang:
```
if err != nil {
return false, nil
}
```

This [PR](https://github.com/GoogleContainerTools/skaffold/pull/9627/files) fixes the issue by supplying the container name as part of the log options used to get the logs. This assumes that the first container is the container that is running the test image (so not ideal).

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.