From 7a22e62591a8affab9557fdbd8a6aa41618af1f2 Mon Sep 17 00:00:00 2001 From: Gergely Brautigam <182850+Skarlso@users.noreply.github.com> Date: Thu, 16 Jan 2025 13:18:01 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Frederic Wilhelm --- pkg/ocm/fakes/fakes.go | 2 +- pkg/ocm/ocm.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/ocm/fakes/fakes.go b/pkg/ocm/fakes/fakes.go index 79c8ebe5..26fb4763 100644 --- a/pkg/ocm/fakes/fakes.go +++ b/pkg/ocm/fakes/fakes.go @@ -150,7 +150,7 @@ func (m *MockFetcher) GetLatestComponentVersionWasNotCalled() bool { return len(m.getLatestComponentVersionCalledWith) == 0 } -func (m *MockFetcher) ListComponentVersions(ctx context.Context, logger logr.Logger, octx ocm.Context, obj *v1alpha1.ComponentVersion) ([]ocmctrl.Version, error) { +func (m *MockFetcher) ListComponentVersions(_ context.Context, _ logr.Logger, _ ocm.Context, obj *v1alpha1.ComponentVersion) ([]ocmctrl.Version, error) { m.listComponentVersionsCalledWith = append(m.listComponentVersionsCalledWith, []any{obj}) return m.listComponentVersionsVersions, m.listComponentVersionsErr } diff --git a/pkg/ocm/ocm.go b/pkg/ocm/ocm.go index 6bfb696a..067fded3 100644 --- a/pkg/ocm/ocm.go +++ b/pkg/ocm/ocm.go @@ -489,7 +489,7 @@ func (c *Client) ListComponentVersions( var result []Version for _, v := range versions { - // make sure we don't do any lookup if we don't need to + // make sure to verify the component if specified if len(obj.Spec.Verify) > 0 { if _, err := c.VerifyComponent(ctx, octx, obj, v); err != nil { logger.Error(err, "ignoring version as it failed verification", "version", v, "component", obj.Spec.Component)