Skip to content

Commit

Permalink
chore: fix linter issues
Browse files Browse the repository at this point in the history
Signed-off-by: Hidde Beydals <[email protected]>
  • Loading branch information
hiddeco committed Dec 2, 2024
1 parent 0682cf1 commit 4ea7964
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
6 changes: 4 additions & 2 deletions internal/api/promote_downstream_v1alpha1.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (s *server) PromoteDownstream(
}

for _, downstream := range downstreams {
if err := s.authorizeFn(
if err = s.authorizeFn(
ctx,
"promote",
kargoapi.GroupVersion.WithResource("stages"),
Expand Down Expand Up @@ -158,7 +158,9 @@ func (s *server) PromoteDownstream(
Namespace: downstream.Namespace,
Name: downstream.Spec.PromotionTemplateRef.Name,
}, template); err != nil {
promoteErrs = append(promoteErrs, fmt.Errorf("get PromotionTemplate %q: %w", downstream.Spec.PromotionTemplateRef.Name, err))
promoteErrs = append(promoteErrs, fmt.Errorf(
"get PromotionTemplate %q: %w", downstream.Spec.PromotionTemplateRef.Name, err,
))
continue

Check warning on line 164 in internal/api/promote_downstream_v1alpha1.go

View check run for this annotation

Codecov / codecov/patch

internal/api/promote_downstream_v1alpha1.go#L154-L164

Added lines #L154 - L164 were not covered by tests
}

Expand Down
2 changes: 1 addition & 1 deletion internal/api/promote_to_stage_v1alpha1.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (s *server) PromoteToStage(
)
}

if err := s.authorizeFn(
if err = s.authorizeFn(
ctx,
"promote",
schema.GroupVersionResource{
Expand Down
10 changes: 5 additions & 5 deletions internal/controller/stages/regular_stages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func TestRegularStageReconciler_Reconcile(t *testing.T) {
string,
client.Object,
client.Patch,
...client.SubResourcePatchOption,
...client.SubResourcePatchOption,
) error {
return fmt.Errorf("status update error")
},
Expand Down Expand Up @@ -287,7 +287,7 @@ func TestRegularStageReconciler_Reconcile(t *testing.T) {
string,
client.Object,
client.Patch,
...client.SubResourcePatchOption,
...client.SubResourcePatchOption,
) error {
return fmt.Errorf("status update error")
},
Expand Down Expand Up @@ -3653,7 +3653,7 @@ func TestRegularStageReconciler_abortVerification(t *testing.T) {
client.WithWatch,
client.Object,
client.Patch,
...client.PatchOption,
...client.PatchOption,
) error {
return fmt.Errorf("something went wrong")
},
Expand Down Expand Up @@ -3905,7 +3905,7 @@ func TestRegularStageReconciler_findExistingAnalysisRun(t *testing.T) {
context.Context,
client.WithWatch,
client.ObjectList,
...client.ListOption,
...client.ListOption,
) error {
return fmt.Errorf("list error")
},
Expand Down Expand Up @@ -5072,7 +5072,7 @@ func TestRegularStageReconciler_autoPromotionAllowed(t *testing.T) {
client.WithWatch,
client.ObjectKey,
client.Object,
...client.GetOption,
...client.GetOption,
) error {
return fmt.Errorf("something went wrong")
},
Expand Down
8 changes: 4 additions & 4 deletions internal/kargo/kargo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestNewPromotion(t *testing.T) {
Steps: []kargoapi.PromotionStep{
{
Uses: "test-step",
As: "test-step",
As: "test-step",
},
},
},
Expand All @@ -59,10 +59,10 @@ func TestNewPromotion(t *testing.T) {
},
},
{
name: "Promote stage with very long name",
name: "Promote stage with very long name",
namespace: "kargo-demo",
stage: veryLongResourceName,
freight: testFreight,
stage: veryLongResourceName,
freight: testFreight,
assertions: func(t *testing.T, promo kargoapi.Promotion) {
require.Len(t, promo.Name, 253)
parts := strings.Split(promo.Name, ".")
Expand Down

0 comments on commit 4ea7964

Please sign in to comment.