Skip to content

Commit

Permalink
backupccl,changefeedccl: properly display name if resource exists
Browse files Browse the repository at this point in the history
Previously, we were passing a `*string` to a string formatting
function (`pgnotice.Newf`) with the `%q` verb. This leads to messages
being displayed to the user that look like:

```
NOTICE: schedule %!q(*string=0xc006b324e0) already exists, skipping
```

This properly dereferences the pointer before printing.

Epic: none

Release note: None
  • Loading branch information
renatolabs committed Jan 31, 2023
1 parent 2fd74fc commit b4b2835
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/ccl/backupccl/create_scheduled_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func doCreateBackupSchedules(

if exists {
p.BufferClientNotice(ctx,
pgnotice.Newf("schedule %q already exists, skipping", eval.scheduleLabel),
pgnotice.Newf("schedule %q already exists, skipping", *eval.scheduleLabel),
)
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/changefeedccl/scheduled_changefeed.go
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ func doCreateChangefeedSchedule(

if exists {
p.BufferClientNotice(ctx,
pgnotice.Newf("schedule %q already exists, skipping", spec.scheduleLabel),
pgnotice.Newf("schedule %q already exists, skipping", *spec.scheduleLabel),
)
return nil
}
Expand Down

0 comments on commit b4b2835

Please sign in to comment.