Skip to content

Commit 2926cac

Browse files
author
jmccormick2001
committed
fix to pgo-scheduler to use pgbackup CRD names with the convention of <clustername> instead of the prior naming convention, also added CRUNCHY_DEBUG env var support
1 parent 7d716e5 commit 2926cac

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

pgo-scheduler/pgo-scheduler.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ var kubeClient *kubernetes.Clientset
5151
func init() {
5252
var err error
5353
log.SetLevel(log.InfoLevel)
54+
55+
debugFlag := os.Getenv("CRUNCHY_DEBUG")
56+
if debugFlag == "true" {
57+
log.SetLevel(log.DebugLevel)
58+
log.Debug("debug flag set to true")
59+
} else {
60+
log.Info("debug flag set to false")
61+
}
62+
5463
log.SetFormatter(&log.TextFormatter{
5564
FullTimestamp: true,
5665
TimestampFormat: "2006-01-02 15:04:05",

pgo-scheduler/scheduler/pgbasebackup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (b BaseBackupJob) Run() {
7676
return
7777
}
7878

79-
taskName := fmt.Sprintf("backup-%s", b.cluster)
79+
taskName := fmt.Sprintf("%s", b.cluster)
8080

8181
result := crv1.Pgbackup{}
8282
found, err = kubeapi.Getpgbackup(restClient, &result, taskName, b.namespace)

0 commit comments

Comments
 (0)