Skip to content

Commit aef8515

Browse files
authored
Merge pull request #1347 from stpabhi/fix-sync-to-internal-registry
fix sync-to-internal-registry.jsonnet
2 parents 86ce42a + 9e89265 commit aef8515

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

jsonnet/kube-prometheus/addons/config-mixins.libsonnet

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ local withImageRepository(repository) = {
3131
},
3232
};
3333

34+
{
35+
imageName:: imageName,
36+
}
37+
3438
{
3539
withImageRepository:: withImageRepository,
3640
}

sync-to-internal-registry.jsonnet

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
local kp = import 'kube-prometheus/kube-prometheus.libsonnet';
2-
local l = import 'kube-prometheus/lib/lib.libsonnet';
3-
local config = kp._config;
1+
local kp = import 'kube-prometheus/main.libsonnet';
2+
local l = import 'kube-prometheus/addons/config-mixins.libsonnet';
3+
local config = kp.values.common;
44

55
local makeImages(config) = [
66
{
7-
name: config.imageRepos[image],
8-
tag: config.versions[image],
7+
name: config.images[image],
98
}
10-
for image in std.objectFields(config.imageRepos)
9+
for image in std.objectFields(config.images)
1110
];
1211

13-
local upstreamImage(image) = '%s:%s' % [image.name, image.tag];
14-
local downstreamImage(registry, image) = '%s/%s:%s' % [registry, l.imageName(image.name), image.tag];
12+
local upstreamImage(image) = '%s' % [image.name];
13+
local downstreamImage(registry, image) = '%s/%s' % [registry, l.imageName(image.name)];
1514

1615
local pullPush(image, newRegistry) = [
1716
'docker pull %s' % upstreamImage(image),

0 commit comments

Comments
 (0)