Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions apiserver/backrestservice/backrestimpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ func CreateBackup(request *msgs.CreateBackrestBackupRequest, ns string) msgs.Cre

//remove any previous backup job

selector := config.LABEL_PG_CLUSTER + "=" + clusterName + "," + config.LABEL_BACKREST + "=true"
//selector := config.LABEL_PG_CLUSTER + "=" + clusterName + "," + config.LABEL_BACKREST + "=true"
selector := config.LABEL_BACKREST_COMMAND + "=" + crv1.PgtaskBackrestBackup + "," + config.LABEL_PG_CLUSTER + "=" + clusterName + "," + config.LABEL_BACKREST + "=true"
err = kubeapi.DeleteJobs(apiserver.Clientset, selector, ns)
if err != nil {
log.Error(err)
Expand Down Expand Up @@ -366,17 +367,17 @@ func getInfo(clusterName, storageType, podname, ns string) (string, error) {
cmd = append(cmd, backrestInfoCommand)

log.Debugf("command is %v ", cmd)

var output string
if storageType != "s3" {
if storageType != "s3" {
outputLocal, stderr, err := kubeapi.ExecToPodThroughAPI(apiserver.RESTConfig, apiserver.Clientset, cmd, containername, podname, ns, nil)
if err != nil {
log.Error(err, stderr)
return "", err
}
output = "\nStorage Type: local\n" + outputLocal
}

if strings.Contains(storageType, "s3") {
cmd = append(cmd, repoTypeFlagS3)
outputS3, stderr, err := kubeapi.ExecToPodThroughAPI(apiserver.RESTConfig, apiserver.Clientset, cmd, containername, podname, ns, nil)
Expand All @@ -385,7 +386,7 @@ func getInfo(clusterName, storageType, podname, ns string) (string, error) {
return "", err
}
output = output + "\nStorage Type: s3\n" + outputS3
}
}

log.Debug("output=[" + output + "]")

Expand Down
2 changes: 2 additions & 0 deletions conf/postgres-operator/backrest-job.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"vendor": "crunchydata",
"pgo-backrest": "true",
"pgo-backrest-job": "true",
"backrest-command": "{{.Command}}",
"pg-cluster": "{{.ClusterName}}"
}
},
Expand All @@ -19,6 +20,7 @@
"vendor": "crunchydata",
"pgo-backrest": "true",
"pgo-backrest-job": "true",
"backrest-command": "{{.Command}}",
"pg-cluster": "{{.ClusterName}}"
}
},
Expand Down
12 changes: 6 additions & 6 deletions conf/postgres-operator/pgo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Cluster:
CCPImagePrefix: crunchydata
Metrics: false
Badger: false
CCPImageTag: rhel7-11.3-2.4.0-rc10
CCPImageTag: centos7-11.3-2.4.0-rc10
Port: 5432
User: testuser
Database: userdb
Expand All @@ -24,10 +24,10 @@ Cluster:
AutofailReplaceReplica: false
LogStatement: none
LogMinDurationStatement: 60000
PrimaryStorage: hostpathstorage
BackupStorage: hostpathstorage
ReplicaStorage: hostpathstorage
BackrestStorage: hostpathstorage
PrimaryStorage: storageos
BackupStorage: storageos
ReplicaStorage: storageos
BackrestStorage: storageos
Storage:
hostpathstorage:
AccessMode: ReadWriteMany
Expand Down Expand Up @@ -101,5 +101,5 @@ Pgo:
PreferredFailoverNode:
Audit: false
PGOImagePrefix: crunchydata
PGOImageTag: rhel7-4.0.0-rc13
PGOImageTag: centos7-4.0.0-rc13