Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Martinez <jmartinez@gitlab.com>2021-08-10 03:59:38 +0300
committerJaime Martinez <jmartinez@gitlab.com>2021-08-10 04:26:32 +0300
commit5186f78c179578757a2673264155aa8b287a0efb (patch)
treeb3d0fcd8fdb0b9a32f3e3a2bf9afb5244e6f8ceb /main.go
parentdc2500d0a6e06b3e762902996867d70246173523 (diff)
fix: do not fail to print --versiondo-not-fail-for-version
when there are missing parameters such as `--listen-http` by splitting configuration loading and validation. Related to omnibus-gitlab#6321. Changelog: other
Diffstat (limited to 'main.go')
-rw-r--r--main.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.go b/main.go
index 09066e2c..042e5974 100644
--- a/main.go
+++ b/main.go
@@ -50,6 +50,10 @@ func appMain() {
printVersion(config.General.ShowVersion, VERSION)
+ if err := cfg.Validate(config); err != nil {
+ log.WithError(err).Fatal("invalid config settings")
+ }
+
if config.Sentry.DSN != "" {
initErrorReporting(config.Sentry.DSN, config.Sentry.Environment)
}