Skip to content

Commit

Permalink
remove unnecessary context
Browse files Browse the repository at this point in the history
  • Loading branch information
c-pius committed Dec 12, 2024
1 parent 686e88c commit fa7bdea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions pkg/templatelookup/regular.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (t *TemplateLookup) GetRegularTemplates(ctx context.Context, kyma *v1beta2.
}

templateInfo := t.PopulateModuleTemplateInfo(ctx, module, kyma.Namespace, kyma.Spec.Channel, moduleReleaseMeta)
templateInfo = ValidateTemplateMode(ctx, templateInfo, kyma, moduleReleaseMeta)
templateInfo = ValidateTemplateMode(templateInfo, kyma, moduleReleaseMeta)
if templateInfo.Err != nil {
templates[module.Name] = &templateInfo
continue
Expand Down Expand Up @@ -136,8 +136,7 @@ func (t *TemplateLookup) populateModuleTemplateInfoUsingModuleReleaseMeta(ctx co
return templateInfo
}

func ValidateTemplateMode(ctx context.Context,
template ModuleTemplateInfo,
func ValidateTemplateMode(template ModuleTemplateInfo,
kyma *v1beta2.Kyma,
moduleReleaseMeta *v1beta2.ModuleReleaseMeta,
) ModuleTemplateInfo {
Expand Down
4 changes: 2 additions & 2 deletions pkg/templatelookup/regular_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func TestValidateTemplateMode_ForOldModuleTemplates(t *testing.T) {
}
for _, testCase := range tests {
t.Run(testCase.name, func(t *testing.T) {
if got := templatelookup.ValidateTemplateMode(context.Background(), testCase.template, testCase.kyma, nil); !errors.Is(got.Err,
if got := templatelookup.ValidateTemplateMode(testCase.template, testCase.kyma, nil); !errors.Is(got.Err,
testCase.wantErr) {
t.Errorf("ValidateTemplateMode() = %v, want %v", got, testCase.wantErr)
}
Expand Down Expand Up @@ -247,7 +247,7 @@ func Test_ValidateTemplateMode_ForNewModuleTemplatesWithModuleReleaseMeta(t *tes
WithInternal(testCase.kymaInternal).
Build()

got := templatelookup.ValidateTemplateMode(context.Background(), mti, kyma, mrm)
got := templatelookup.ValidateTemplateMode(mti, kyma, mrm)
if testCase.expectInstallation {
require.NoError(t, got.Err)
} else {
Expand Down

0 comments on commit fa7bdea

Please sign in to comment.