Skip to content

Commit 78e2b4c

Browse files
committed
Fix according to linter
Signed-off-by: Yury Tsarev <yury@upbound.io>
1 parent 047f2c9 commit 78e2b4c

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

fn.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ func (f *Function) RunFunction(_ context.Context, req *fnv1.RunFunctionRequest)
4646

4747
// Check if changes need approval
4848
if f.needsApproval(approved, oldHash, newHash) {
49-
err := f.handleUnapprovedChanges(req, in, rsp, oldHash, newHash)
50-
if err != nil {
51-
return rsp, nil //nolint:nilerr // errors are handled in rsp
52-
}
49+
f.handleUnapprovedChanges(req, in, rsp, oldHash, newHash)
5350
return rsp, nil
5451
}
5552

@@ -115,7 +112,7 @@ func (f *Function) needsApproval(approved bool, oldHash, newHash string) bool {
115112
}
116113

117114
// handleUnapprovedChanges processes the case where changes need approval
118-
func (f *Function) handleUnapprovedChanges(req *fnv1.RunFunctionRequest, in *v1beta1.Input, rsp *fnv1.RunFunctionResponse, oldHash, newHash string) error {
115+
func (f *Function) handleUnapprovedChanges(_ *fnv1.RunFunctionRequest, in *v1beta1.Input, rsp *fnv1.RunFunctionResponse, oldHash, newHash string) {
119116
// Set condition to show approval is needed
120117
msg := "Changes detected. Approval required."
121118
if in.ApprovalMessage != nil {
@@ -139,8 +136,6 @@ func (f *Function) handleUnapprovedChanges(req *fnv1.RunFunctionRequest, in *v1b
139136
// This stops the composition process entirely until approval is granted
140137
f.log.Info("Halting pipeline until changes are approved", "message", msg)
141138
response.Fatal(rsp, errors.New(detailedMsg))
142-
143-
return nil
144139
}
145140

146141
// handleApprovedChanges processes the case where changes are approved
@@ -606,5 +601,3 @@ func (f *Function) checkApprovalStatus(req *fnv1.RunFunctionRequest, in *v1beta1
606601

607602
return boolValue, nil
608603
}
609-
610-

fn_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,4 +625,3 @@ func TestFunction_FatalResultsWithApprovalCondition(t *testing.T) {
625625
}
626626

627627
}
628-

0 commit comments

Comments
 (0)