fix: GetAllCertificatesAndCAs shouldn't fail internally (#810)

all libraries in pkg/* should never be called Fatal()
internally, the console is imported now and it is important
that the failure logging etc is all well controlled.

Bonus: update to latest minio/pkg v1.0.6 to get trial
customer license verification fixes.
This commit is contained in:
Harshavardhana
2021-06-14 10:41:34 -07:00
committed by GitHub
parent 31d18efa9a
commit f208ce5382
4 changed files with 13 additions and 9 deletions

View File

@@ -140,14 +140,18 @@ func loadAllCerts(ctx *cli.Context) error {
certs.GlobalCertsCADir = &certs.ConfigDir{Path: filepath.Join(certs.GlobalCertsDir.Get(), certs.CertsCADir)}
// check if certs and CAs directories exists or can be created
if err = certs.MkdirAllIgnorePerm(certs.GlobalCertsCADir.Get()); err != nil {
return fmt.Errorf("unable to create certs CA directory at %s: with %w", certs.GlobalCertsCADir.Get(), err)
return fmt.Errorf("unable to create certs CA directory at %s: failed with %w", certs.GlobalCertsCADir.Get(), err)
}
var manager *xcerts.Manager
// load the certificates and the CAs
restapi.GlobalRootCAs, restapi.GlobalPublicCerts, manager = certs.GetAllCertificatesAndCAs()
restapi.GlobalRootCAs, restapi.GlobalPublicCerts, manager, err = certs.GetAllCertificatesAndCAs()
restapi.GlobalTLSCertsManager = &certs.TLSCertsManager{
Manager: manager,
}
if err != nil {
return fmt.Errorf("unable to load certificates at %s: failed with %w", certs.GlobalCertsDir.Get(), err)
}
{
// TLS flags from swagger server, used to support VMware vsphere operator version.