Don't write out credentials for non automate deploys
For chef-server only, we don't need the credentials to be written.
@@ -30,6 +30,7 @@ import (
"github.com/chef/automate/components/automate-deployment/pkg/a1upgrade"
"github.com/chef/automate/components/automate-deployment/pkg/bootstrap"
"github.com/chef/automate/components/automate-deployment/pkg/cli"
+ "github.com/chef/automate/components/automate-deployment/pkg/deployment"
"github.com/chef/automate/components/automate-deployment/pkg/manifest"
"github.com/chef/automate/components/automate-deployment/pkg/preflight"
"github.com/chef/automate/components/automate-deployment/pkg/target"
@@ -1544,6 +1545,12 @@ func (d *deployer) saveDeploymentCreds() {
return
}
+ // We don't need to write out any credentials if automate is not deployed.
+ // As an example, if we've deployed only chef-server
+ if !deployment.ContainsAutomateCollection(d.mergedCfg.GetDeployment()) {
+ return
+ }
+
// Support legacy configuration. If an email is present that it will have
// been used as the "username" when the admin was created. If it's not then
// the "username" would have been used.
