Skip to content

Commit ad1c837

Browse files
committed
corrected parameters for gcs
1 parent cc83f34 commit ad1c837

3 files changed

Lines changed: 17 additions & 21 deletions

File tree

pkg/apis/cpo.opensource.cybertec.at/v1/crds.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,9 +1186,6 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{
11861186
"region": {
11871187
Type: "string",
11881188
},
1189-
"projectId": {
1190-
Type: "string",
1191-
},
11921189
"account": {
11931190
Type: "string",
11941191
},

pkg/apis/cpo.opensource.cybertec.at/v1/postgresql_type.go

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -283,17 +283,16 @@ type Pgbackrest struct {
283283
}
284284

285285
type Repo struct {
286-
Name string `json:"name"`
287-
Storage string `json:"storage"`
288-
Resource string `json:"resource"`
289-
Endpoint string `json:"endpoint"`
290-
Region string `json:"region"`
291-
ProjectId string `json:"projectId"`
292-
Account string `json:"account"`
293-
Key string `json:"key"`
294-
KeyType string `json:"keyType"`
295-
Schedule map[string]string `json:"schedule"`
296-
Volume `json:"volume,omitempty"`
286+
Name string `json:"name"`
287+
Storage string `json:"storage"`
288+
Resource string `json:"resource"`
289+
Endpoint string `json:"endpoint"`
290+
Region string `json:"region"`
291+
Account string `json:"account"`
292+
Key string `json:"key"`
293+
KeyType string `json:"keyType"`
294+
Schedule map[string]string `json:"schedule"`
295+
Volume `json:"volume,omitempty"`
297296
}
298297

299298
type Restore struct {

pkg/cluster/k8sres.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2935,11 +2935,7 @@ func ensurePath(file string, defaultDir string, defaultFile string) string {
29352935
func (c *Cluster) generatePgbackrestConfigmap() (*v1.ConfigMap, error) {
29362936
config := "[db]\npg1-path = /home/postgres/pgdata/pgroot/data\npg1-port = 5432\npg1-socket-path = /var/run/postgresql/\n"
29372937
config += "\n[global]\nlog-path = /home/postgres/pgdata/pgbackrest/log\nspool-path = /home/postgres/pgdata/pgbackrest/spool-path"
2938-
config += "\ntls-server-address=*"
2939-
config += "\ntls-server-ca-file = /etc/pgbackrest/certs/pgbackrest.ca-roots"
2940-
config += "\ntls-server-cert-file = /etc/pgbackrest/certs/pgbackrest-client.crt"
2941-
config += "\ntls-server-key-file = /etc/pgbackrest/certs/pgbackrest-client.key"
2942-
config += "\ntls-server-auth = " + c.clientCommonName() + "=*"
2938+
29432939
if c.Postgresql.Spec.Backup != nil && c.Postgresql.Spec.Backup.Pgbackrest != nil {
29442940
if global := c.Postgresql.Spec.Backup.Pgbackrest.Global; global != nil {
29452941
for k, v := range global {
@@ -2953,6 +2949,11 @@ func (c *Cluster) generatePgbackrestConfigmap() (*v1.ConfigMap, error) {
29532949
switch repo.Storage {
29542950
case "pvc":
29552951
c.logger.Debugf("DEBUG_OUTPUT %s %s", c.clusterName().Name, c.Namespace)
2952+
config += "\ntls-server-address=*"
2953+
config += "\ntls-server-ca-file = /etc/pgbackrest/certs/pgbackrest.ca-roots"
2954+
config += "\ntls-server-cert-file = /etc/pgbackrest/certs/pgbackrest-client.crt"
2955+
config += "\ntls-server-key-file = /etc/pgbackrest/certs/pgbackrest-client.key"
2956+
config += "\ntls-server-auth = " + c.clientCommonName() + "=*"
29562957
config += "\nrepo" + fmt.Sprintf("%d", i+1) + "-host = " + c.clusterName().Name + "-pgbackrest-repo-host-0." + c.serviceName(ClusterPods) + "." + c.Namespace + ".svc." + c.OpConfig.ClusterDomain
29572958
config += "\nrepo" + fmt.Sprintf("%d", i+1) + "-host-ca-file = /etc/pgbackrest/certs/pgbackrest.ca-roots"
29582959
config += "\nrepo" + fmt.Sprintf("%d", i+1) + "-host-cert-file = /etc/pgbackrest/certs/pgbackrest-client.crt"
@@ -2968,9 +2969,8 @@ func (c *Cluster) generatePgbackrestConfigmap() (*v1.ConfigMap, error) {
29682969

29692970
case "gcs":
29702971
config += fmt.Sprintf("\n%s-%s-bucket = %s", repo.Name, repo.Storage, repo.Resource)
2971-
config += fmt.Sprintf("\n%s-%s-project-id = %s", repo.Name, repo.Storage, repo.ProjectId)
29722972
config += fmt.Sprintf("\n%s-%s-key = %s", repo.Name, repo.Storage, repo.Key)
2973-
config += fmt.Sprintf("\n%s-%s-key-typ = %s", repo.Name, repo.Storage, repo.KeyType)
2973+
config += fmt.Sprintf("\n%s-%s-key-type = %s", repo.Name, repo.Storage, repo.KeyType)
29742974
config += fmt.Sprintf("\n%s-type = %s", repo.Name, repo.Storage)
29752975

29762976
case "azure":

0 commit comments

Comments
 (0)