Просмотр исходного кода

Merge pull request #1294 from smallstep/fix-1292

Disable database if WithNoDB() option is passed
Mariano Cano 3 лет назад
Родитель
Сommit
060a2f186c
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      pki/pki.go

+ 5 - 0
pki/pki.go

@@ -812,6 +812,11 @@ func (p *PKI) GenerateConfig(opt ...ConfigOption) (*authconfig.Config, error) {
 		Templates: p.getTemplates(),
 	}
 
+	// Disable the database when WithNoDB() option is passed.
+	if p.options.noDB {
+		cfg.DB = nil
+	}
+
 	// Add linked as a deployment type to detect it on start and provide a
 	// message if the token is not given.
 	if p.options.deploymentType == LinkedDeployment {