Skip to content
This repository has been archived by the owner on Jun 19, 2022. It is now read-only.

Commit

Permalink
no need to delete attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
nachocano committed Jun 24, 2020
1 parent 5f9afd0 commit 014802a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkg/pubsub/adapter/converters/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,11 @@ func convertCloudScheduler(ctx context.Context, msg *pubsub.Message) (*cev2.Even
// We added this attributes so that we could identify the scheduler.
// We should remove them here.
jobName, ok := msg.Attributes[v1beta1.CloudSchedulerSourceJobName]
if ok {
delete(msg.Attributes, v1beta1.CloudSchedulerSourceJobName)
} else {
if !ok {
return nil, errors.New("received event did not have jobName")
}
schedulerName, ok := msg.Attributes[v1beta1.CloudSchedulerSourceName]
if ok {
delete(msg.Attributes, v1beta1.CloudSchedulerSourceName)
} else {
if !ok {
return nil, errors.New("received event did not have schedulerName")
}

Expand Down

0 comments on commit 014802a

Please sign in to comment.