mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-17 19:05:13 +00:00
feat: enable running ZITADEL offline (#1894)
* feat: enable running ZITADEL offline * refactor: move operator image to common images * test: remove empty test
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
package common
|
||||
|
||||
type image string
|
||||
|
||||
func (i image) String() string { return string(i) }
|
||||
|
||||
type dockerhubImage image
|
||||
|
||||
type zitadelImage image
|
||||
|
||||
const (
|
||||
CockroachImage dockerhubImage = "cockroachdb/cockroach:v20.2.3"
|
||||
PostgresImage dockerhubImage = "postgres:9.6.17"
|
||||
FlywayImage dockerhubImage = "flyway/flyway:7.5.1"
|
||||
AlpineImage dockerhubImage = "alpine:3.11"
|
||||
ZITADELImage zitadelImage = "caos/zitadel"
|
||||
BackupImage zitadelImage = "caos/zitadel-crbackup"
|
||||
ZITADELOperatorImage zitadelImage = "caos/zitadel-operator"
|
||||
)
|
||||
|
||||
func (z zitadelImage) Reference(customImageRegistry, version string) string {
|
||||
|
||||
reg := "ghcr.io"
|
||||
if customImageRegistry != "" {
|
||||
reg = customImageRegistry
|
||||
}
|
||||
|
||||
return concat(image(z), reg, version)
|
||||
}
|
||||
|
||||
func (d dockerhubImage) Reference(customImageRegistry string) string {
|
||||
return concat(image(d), customImageRegistry, "")
|
||||
}
|
||||
|
||||
func concat(img image, customImageRegistry, version string) string {
|
||||
str := img.String()
|
||||
|
||||
if customImageRegistry != "" {
|
||||
str = customImageRegistry + "/" + str
|
||||
}
|
||||
|
||||
if version != "" {
|
||||
str = str + ":" + version
|
||||
}
|
||||
return str
|
||||
}
|
||||
Reference in New Issue
Block a user