Provisioning: Fix missing ref in staging options (#109311)
Fix missing ref in staging options
This commit is contained in:
@@ -70,6 +70,7 @@ func (w *Worker) Process(ctx context.Context, repo repository.Repository, job pr
|
||||
CommitOnlyOnceMessage: msg,
|
||||
PushOnWrites: false,
|
||||
Timeout: 10 * time.Minute,
|
||||
Ref: opts.Ref,
|
||||
}
|
||||
|
||||
err := w.wrapFn(ctx, repo, stageOptions, fn)
|
||||
|
||||
@@ -164,6 +164,7 @@ func TestDeleteWorker_ProcessDeleteFilesSuccess(t *testing.T) {
|
||||
return !opts.PushOnWrites &&
|
||||
opts.Timeout == 10*time.Minute &&
|
||||
opts.Mode == repository.StageModeCommitOnlyOnce &&
|
||||
opts.Ref == "main" &&
|
||||
opts.CommitOnlyOnceMessage == "Delete from Grafana "+job.Name
|
||||
}), mock.Anything).Return(func(ctx context.Context, repo repository.Repository, stageOptions repository.StageOptions, fn func(repository.Repository, bool) error) error {
|
||||
return fn(mockRepo, false)
|
||||
|
||||
@@ -81,6 +81,7 @@ func (w *Worker) Process(ctx context.Context, repo repository.Repository, job pr
|
||||
CommitOnlyOnceMessage: msg,
|
||||
PushOnWrites: false,
|
||||
Timeout: 10 * time.Minute,
|
||||
Ref: opts.Ref,
|
||||
}
|
||||
|
||||
err := w.wrapFn(ctx, repo, stageOptions, fn)
|
||||
|
||||
@@ -202,7 +202,7 @@ func TestMoveWorker_ProcessMoveFilesSuccess(t *testing.T) {
|
||||
mockWrapFn.On("Execute", mock.Anything, mockRepo, mock.MatchedBy(func(opts repository.StageOptions) bool {
|
||||
return !opts.PushOnWrites && opts.Timeout == 10*time.Minute &&
|
||||
opts.Mode == repository.StageModeCommitOnlyOnce &&
|
||||
opts.CommitOnlyOnceMessage != ""
|
||||
opts.CommitOnlyOnceMessage != "" && opts.Ref == "main"
|
||||
}), mock.Anything).Return(func(ctx context.Context, repo repository.Repository, stageOptions repository.StageOptions, fn func(repository.Repository, bool) error) error {
|
||||
return fn(mockRepo, false)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user