Skip to content

Commit 236f7c4

Browse files
committed
fix to ensure every restore parameter value is quoted
1 parent c0c7e3b commit 236f7c4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

pkg/cluster/restore.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7+
"strings"
8+
79
cpov1 "github.com/cybertec-postgresql/cybertec-pg-operator/pkg/apis/cpo.opensource.cybertec.at/v1"
810
spc "github.com/cybertec-postgresql/cybertec-pg-operator/pkg/spec"
911
"github.com/cybertec-postgresql/cybertec-pg-operator/pkg/util/constants"
@@ -13,7 +15,6 @@ import (
1315
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1416
"k8s.io/apimachinery/pkg/labels"
1517
"k8s.io/apimachinery/pkg/types"
16-
"strings"
1718
)
1819

1920
const (
@@ -198,7 +199,7 @@ func (c *Cluster) generatePgbackrestRestoreConfigmap(restore *cpov1.Restore) (*v
198199

199200
optionsArray := make([]string, 0)
200201
for key, value := range restore.Options {
201-
optionsArray = append(optionsArray, fmt.Sprintf("--%s=%s", key, value))
202+
optionsArray = append(optionsArray, fmt.Sprintf("--%s=\"%s\"", key, value))
202203
}
203204
options := strings.Join(optionsArray, " ")
204205
data["restore_command"] = fmt.Sprintf(" --repo=%v %s",

0 commit comments

Comments
 (0)