Only add CA cert to plugin config if it's defined

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
This commit is contained in:
Nolan Brubaker
2020-03-31 13:59:37 -04:00
parent 4961040652
commit 7c87aebe5f

View File

@@ -114,7 +114,10 @@ func NewObjectBackupStore(location *velerov1api.BackupStorageLocation, objectSto
}
location.Spec.Config["bucket"] = bucket
location.Spec.Config["prefix"] = prefix
location.Spec.Config["caCert"] = string(location.Spec.ObjectStorage.CACert)
// Only include a CACert if it's specified in order to maintain compatibility with plugins that don't expect it.
if location.Spec.ObjectStorage.CACert != nil {
location.Spec.Config["caCert"] = string(location.Spec.ObjectStorage.CACert)
}
}
objectStore, err := objectStoreGetter.GetObjectStore(location.Spec.Provider)