Tobias Brunner
d14fbc6e17
All checks were successful
continuous-integration/drone/push Build is passing
21 lines
665 B
Plaintext
21 lines
665 B
Plaintext
local l = import 'lib/lib.libsonnet';
|
|
|
|
// withImageRepository is a mixin that replaces all images prefixes by repository. eg.
|
|
// quay.io/coreos/addon-resizer -> $repository/addon-resizer
|
|
// grafana/grafana -> grafana $repository/grafana
|
|
local withImageRepository(repository) = {
|
|
local oldRepos = super._config.imageRepos,
|
|
local substituteRepository(image, repository) =
|
|
if repository == null then image else repository + '/' + l.imageName(image),
|
|
_config+:: {
|
|
imageRepos:: {
|
|
[field]: substituteRepository(oldRepos[field], repository),
|
|
for field in std.objectFields(oldRepos)
|
|
}
|
|
},
|
|
};
|
|
|
|
{
|
|
withImageRepository:: withImageRepository,
|
|
}
|