Support setting a custom CA bundle to use with a BackupStorageLocation (#2353)

* Support setting a custom CA certificate for a BSL

Signed-off-by: Sam Lucidi <slucidi@redhat.com>

* update CRDS

Signed-off-by: Sam Lucidi <slucidi@redhat.com>

* Add changelog for #2353

Signed-off-by: Sam Lucidi <slucidi@redhat.com>

* Clean up temp file from TestTempCACertFile

Signed-off-by: Sam Lucidi <slucidi@redhat.com>
This commit is contained in:
Samuel Lucidi
2020-03-24 17:50:48 -04:00
committed by GitHub
parent d1482d927e
commit 4d49b5971c
15 changed files with 171 additions and 14 deletions

View File

@@ -47,11 +47,12 @@ type backupStatusLine struct {
// GetSnapshotID runs a 'restic snapshots' command to get the ID of the snapshot
// in the specified repo matching the set of provided tags, or an error if a
// unique snapshot cannot be identified.
func GetSnapshotID(repoIdentifier, passwordFile string, tags map[string]string, env []string) (string, error) {
func GetSnapshotID(repoIdentifier, passwordFile string, tags map[string]string, env []string, caCertFile string) (string, error) {
cmd := GetSnapshotCommand(repoIdentifier, passwordFile, tags)
if len(env) > 0 {
cmd.Env = env
}
cmd.CACertFile = caCertFile
stdout, stderr, err := exec.RunCommand(cmd.Cmd())
if err != nil {