1
1
mirror of https://github.com/mcuadros/ascode synced 2024-11-23 01:11:59 +01:00

starlark/module: experimental/docker DOCKER_CONFIG support

This commit is contained in:
Máximo Cuadros 2020-03-19 12:04:45 +01:00
parent c5436f7b86
commit ede2cc43f7
No known key found for this signature in database
GPG Key ID: 17A5DFEDC735AE4B

@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"os"
"sort"
"sync"
@ -131,7 +132,7 @@ func (i *image) getTags() (*starlark.List, error) {
}
var err error
i.tags, err = docker.GetRepositoryTags(context.TODO(), nil, i.ref)
i.tags, err = docker.GetRepositoryTags(context.TODO(), imageSystemContext(), i.ref)
if err != nil {
return nil, fmt.Errorf("error listing repository tags: %v", err)
}
@ -226,3 +227,9 @@ func versionToList(versions []*semver.Version, other []string) []string {
return append(output, other...)
}
func imageSystemContext() *types.SystemContext {
return &types.SystemContext{
AuthFilePath: os.Getenv("DOCKER_CONFIG"),
}
}