From 4fd9a9b92bd43074a6119fad3a03db864ad1054e Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Fri, 24 Feb 2023 15:40:48 -0800 Subject: [PATCH] Disable database if WithNoDB() option is passed This commit removes the database from the configuration if the ca was initialized with the "--no-db" flag. Fixes #1292 --- pki/pki.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pki/pki.go b/pki/pki.go index d6c15c9e..971c189b 100644 --- a/pki/pki.go +++ b/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 {