Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Added overwrite parameter to catalog client.Put #285

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion go/tasks/pluginmachinery/catalog/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func NewReservationEntry(expiresAt time.Time, heartbeatInterval time.Duration, o
type Client interface {
Get(ctx context.Context, key Key) (Entry, error)
GetOrExtendReservation(ctx context.Context, key Key, ownerID string, heartbeatInterval time.Duration) (*datacatalog.Reservation, error)
Put(ctx context.Context, key Key, reader io.OutputReader, metadata Metadata) (Status, error)
Put(ctx context.Context, key Key, reader io.OutputReader, metadata Metadata, overwrite bool) (Status, error)
MorpheusXAUT marked this conversation as resolved.
Show resolved Hide resolved
ReleaseReservation(ctx context.Context, key Key, ownerID string) error
}

Expand Down
18 changes: 9 additions & 9 deletions go/tasks/pluginmachinery/catalog/mocks/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/tasks/pluginmachinery/catalog/writer_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (p writerProcessor) Process(ctx context.Context, workItem workqueue.WorkIte
return workqueue.WorkStatusNotDone, fmt.Errorf("wrong work item type. Received: %v", reflect.TypeOf(workItem))
}

status, err := p.catalogClient.Put(ctx, wi.key, wi.data, wi.metadata)
status, err := p.catalogClient.Put(ctx, wi.key, wi.data, wi.metadata, false)
if err != nil {
logger.Errorf(ctx, "Error putting to catalog [%s]", err)
return workqueue.WorkStatusNotDone, errors.Wrapf(errors.DownstreamSystemError, err,
Expand Down