From 04ba4a40331bbc6df75570df0a2f8fc02a472dd3 Mon Sep 17 00:00:00 2001 From: DQ Date: Tue, 11 May 2021 12:48:53 +0000 Subject: [PATCH] Upgrade chartmuseum version from 1.12.0 to 1.13.1 Signed-off-by: DQ --- Makefile | 8 ++++---- make/photon/chartserver/redis.patch | 20 +++++++++----------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index a2201a534..0923b4d06 100644 --- a/Makefile +++ b/Makefile @@ -107,11 +107,11 @@ NOTARYMIGRATEVERSION=v4.11.0 TRIVYVERSION=v0.16.0 TRIVYADAPTERVERSION=v0.18.0 -# version of chartmuseum -CHARTMUSEUMVERSION=v0.12.0-redis - # version of chartmuseum for pulling the source code -CHARTMUSEUM_SRC_TAG=v0.12.0 +CHARTMUSEUM_SRC_TAG=v0.13.1 + +# version of chartmuseum +CHARTMUSEUMVERSION=$(CHARTMUSEUM_SRC_TAG)-redis # version of registry for pulling the source code REGISTRY_SRC_TAG=v2.7.1 diff --git a/make/photon/chartserver/redis.patch b/make/photon/chartserver/redis.patch index ba95873e4..d584cd9eb 100644 --- a/make/photon/chartserver/redis.patch +++ b/make/photon/chartserver/redis.patch @@ -1,8 +1,8 @@ diff --git a/cmd/chartmuseum/main.go b/cmd/chartmuseum/main.go -index e2d8ec0..116b1d4 100644 +index 8fd7349..eb67ddf 100644 --- a/cmd/chartmuseum/main.go +++ b/cmd/chartmuseum/main.go -@@ -264,6 +264,8 @@ func storeFromConfig(conf *config.Config) cache.Store { +@@ -282,12 +282,23 @@ func storeFromConfig(conf *config.Config) cache.Store { switch cacheFlag { case "redis": store = redisCacheFromConfig(conf) @@ -11,10 +11,9 @@ index e2d8ec0..116b1d4 100644 default: crash("Unsupported cache store: ", cacheFlag) } -@@ -280,6 +282,16 @@ func redisCacheFromConfig(conf *config.Config) cache.Store { - )) - } + return store + } +func redisSentinelCacheFromConfig(conf *config.Config) cache.Store { + crashIfConfigMissingVars(conf, []string{"cache.redis.addr", "cache.redis.mastername"}) + return cache.Store(cache.NewRedisSentinelStore( @@ -24,10 +23,9 @@ index e2d8ec0..116b1d4 100644 + conf.GetInt("cache.redis.db"), + )) +} -+ - func crashIfConfigMissingVars(conf *config.Config, vars []string) { - missing := []string{} - for _, v := range vars { + + func redisCacheFromConfig(conf *config.Config) cache.Store { + crashIfConfigMissingVars(conf, []string{"cache.redis.addr"}) diff --git a/pkg/cache/redis_sentinel.go b/pkg/cache/redis_sentinel.go new file mode 100644 index 0000000..0c73427 @@ -53,10 +51,10 @@ index 0000000..0c73427 + return store +} diff --git a/pkg/config/vars.go b/pkg/config/vars.go -index 2b30ec4..603eebc 100644 +index 638eb49..4f036c9 100644 --- a/pkg/config/vars.go +++ b/pkg/config/vars.go -@@ -237,10 +237,19 @@ var configVars = map[string]configVar{ +@@ -246,10 +246,19 @@ var configVars = map[string]configVar{ Default: "", CLIFlag: cli.StringFlag{ Name: "cache-redis-addr",