mirror of
https://github.com/goharbor/harbor
synced 2024-09-20 14:56:25 +00:00
Upgrade chartmuseum version
from 1.12.0 to 1.13.1 Signed-off-by: DQ <dengq@vmware.com>
This commit is contained in:
parent
9a974d2b2c
commit
04ba4a4033
8
Makefile
8
Makefile
|
@ -107,11 +107,11 @@ NOTARYMIGRATEVERSION=v4.11.0
|
||||||
TRIVYVERSION=v0.16.0
|
TRIVYVERSION=v0.16.0
|
||||||
TRIVYADAPTERVERSION=v0.18.0
|
TRIVYADAPTERVERSION=v0.18.0
|
||||||
|
|
||||||
# version of chartmuseum
|
|
||||||
CHARTMUSEUMVERSION=v0.12.0-redis
|
|
||||||
|
|
||||||
# version of chartmuseum for pulling the source code
|
# 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
|
# version of registry for pulling the source code
|
||||||
REGISTRY_SRC_TAG=v2.7.1
|
REGISTRY_SRC_TAG=v2.7.1
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
diff --git a/cmd/chartmuseum/main.go b/cmd/chartmuseum/main.go
|
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
|
--- a/cmd/chartmuseum/main.go
|
||||||
+++ b/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 {
|
switch cacheFlag {
|
||||||
case "redis":
|
case "redis":
|
||||||
store = redisCacheFromConfig(conf)
|
store = redisCacheFromConfig(conf)
|
||||||
|
@ -11,10 +11,9 @@ index e2d8ec0..116b1d4 100644
|
||||||
default:
|
default:
|
||||||
crash("Unsupported cache store: ", cacheFlag)
|
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 {
|
+func redisSentinelCacheFromConfig(conf *config.Config) cache.Store {
|
||||||
+ crashIfConfigMissingVars(conf, []string{"cache.redis.addr", "cache.redis.mastername"})
|
+ crashIfConfigMissingVars(conf, []string{"cache.redis.addr", "cache.redis.mastername"})
|
||||||
+ return cache.Store(cache.NewRedisSentinelStore(
|
+ return cache.Store(cache.NewRedisSentinelStore(
|
||||||
|
@ -24,10 +23,9 @@ index e2d8ec0..116b1d4 100644
|
||||||
+ conf.GetInt("cache.redis.db"),
|
+ conf.GetInt("cache.redis.db"),
|
||||||
+ ))
|
+ ))
|
||||||
+}
|
+}
|
||||||
+
|
|
||||||
func crashIfConfigMissingVars(conf *config.Config, vars []string) {
|
func redisCacheFromConfig(conf *config.Config) cache.Store {
|
||||||
missing := []string{}
|
crashIfConfigMissingVars(conf, []string{"cache.redis.addr"})
|
||||||
for _, v := range vars {
|
|
||||||
diff --git a/pkg/cache/redis_sentinel.go b/pkg/cache/redis_sentinel.go
|
diff --git a/pkg/cache/redis_sentinel.go b/pkg/cache/redis_sentinel.go
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..0c73427
|
index 0000000..0c73427
|
||||||
|
@ -53,10 +51,10 @@ index 0000000..0c73427
|
||||||
+ return store
|
+ return store
|
||||||
+}
|
+}
|
||||||
diff --git a/pkg/config/vars.go b/pkg/config/vars.go
|
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
|
--- a/pkg/config/vars.go
|
||||||
+++ b/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: "",
|
Default: "",
|
||||||
CLIFlag: cli.StringFlag{
|
CLIFlag: cli.StringFlag{
|
||||||
Name: "cache-redis-addr",
|
Name: "cache-redis-addr",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user