Merge pull request #20369 from cgiradkar/Issue-16759-docs

Define better error message for container name conflicts with external storage
This commit is contained in:
openshift-ci[bot]
2023-10-30 10:22:00 +00:00
committed by GitHub
3 changed files with 36 additions and 2 deletions

View File

@ -510,6 +510,11 @@ func (c *Container) setupStorage(ctx context.Context) error {
}
}
if containerInfoErr != nil {
if errors.Is(containerInfoErr, storage.ErrDuplicateName) {
if _, err := c.runtime.LookupContainer(c.config.Name); errors.Is(err, define.ErrNoSuchCtr) {
return fmt.Errorf("creating container storage: %w by an external entity", containerInfoErr)
}
}
return fmt.Errorf("creating container storage: %w", containerInfoErr)
}