Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Suggestion Request from Update Suggestion #1158

Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ func (r *ReconcileExperiment) ReconcileSuggestions(instance *experimentsv1alpha3
}
if suggestion.Spec.Requests != suggestionRequestsCount {
suggestion.Spec.Requests = suggestionRequestsCount
if err := r.UpdateSuggestion(suggestion, suggestionRequestsCount); err != nil {
if err := r.UpdateSuggestion(suggestion); err != nil {
return nil, err
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func TestReconcileExperiment(t *testing.T) {
},
},
}, nil).AnyTimes()
suggestion.EXPECT().UpdateSuggestion(gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
suggestion.EXPECT().UpdateSuggestion(gomock.Any()).Return(nil).AnyTimes()
mockCtrl3 := gomock.NewController(t)
defer mockCtrl3.Finish()
generator := manifestmock.NewMockGenerator(mockCtrl)
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller.v1alpha3/experiment/suggestion/fake/fake.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ func (f *Fake) GetOrCreateSuggestion(instance *experimentsv1alpha3.Experiment, s
return nil, nil
}

func (f *Fake) UpdateSuggestion(suggestion *suggestionsv1alpha3.Suggestion, suggestionRequests int32) error {
func (f *Fake) UpdateSuggestion(suggestion *suggestionsv1alpha3.Suggestion) error {
return nil
}
4 changes: 2 additions & 2 deletions pkg/controller.v1alpha3/experiment/suggestion/suggestion.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var log = logf.Log.WithName("experiment-suggestion-client")

type Suggestion interface {
GetOrCreateSuggestion(instance *experimentsv1alpha3.Experiment, suggestionRequests int32) (*suggestionsv1alpha3.Suggestion, error)
UpdateSuggestion(suggestion *suggestionsv1alpha3.Suggestion, suggestionRequests int32) error
UpdateSuggestion(suggestion *suggestionsv1alpha3.Suggestion) error
}

type General struct {
Expand Down Expand Up @@ -79,7 +79,7 @@ func (g *General) createSuggestion(instance *experimentsv1alpha3.Experiment, sug
return nil
}

func (g *General) UpdateSuggestion(suggestion *suggestionsv1alpha3.Suggestion, suggestionRequests int32) error {
func (g *General) UpdateSuggestion(suggestion *suggestionsv1alpha3.Suggestion) error {
if err := g.Update(context.TODO(), suggestion); err != nil {
return err
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/mock/v1alpha3/experiment/suggestion/suggestion.go

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