format and regenerate
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
},
|
||||
},
|
||||
|
||||
prometheusAdapter+:: {
|
||||
prometheusAdapter+: {
|
||||
customMetricsApiService: {
|
||||
apiVersion: 'apiregistration.k8s.io/v1',
|
||||
kind: 'APIService',
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
insecureSkipVerify: null,
|
||||
},
|
||||
},
|
||||
prometheus+:: {
|
||||
prometheus+: {
|
||||
serviceEtcd: {
|
||||
apiVersion: 'v1',
|
||||
kind: 'Service',
|
||||
|
||||
Reference in New Issue
Block a user