format and regenerate

This commit is contained in:
paulfantom
2021-01-19 15:46:51 +01:00
parent 0424835b04
commit e2dbc63764
7 changed files with 25 additions and 11 deletions

View File

@@ -1,4 +1,18 @@
local l = import 'lib/lib.libsonnet';
local imageName(image) =
local parts = std.split(image, '/');
local len = std.length(parts);
if len == 3 then
// registry.com/org/image
parts[2]
else if len == 2 then
// org/image
parts[1]
else if len == 1 then
// image, ie. busybox
parts[0]
else
error 'unknown image format: ' + image;
// withImageRepository is a mixin that replaces all images prefixes by repository. eg.
// quay.io/coreos/addon-resizer -> $repository/addon-resizer
@@ -6,8 +20,8 @@ local l = import 'lib/lib.libsonnet';
local withImageRepository(repository) = {
local oldRepos = super._config.imageRepos,
local substituteRepository(image, repository) =
if repository == null then image else repository + '/' + l.imageName(image),
_config+:: {
if repository == null then image else repository + '/' + imageName(image),
values+:: {
imageRepos:: {
[field]: substituteRepository(oldRepos[field], repository)
for field in std.objectFields(oldRepos)

View File

@@ -78,7 +78,7 @@
},
},
prometheusAdapter+:: {
prometheusAdapter+: {
customMetricsApiService: {
apiVersion: 'apiregistration.k8s.io/v1',
kind: 'APIService',

View File

@@ -9,7 +9,7 @@
insecureSkipVerify: null,
},
},
prometheus+:: {
prometheus+: {
serviceEtcd: {
apiVersion: 'v1',
kind: 'Service',