Skip to content

Commit

Permalink
pass opts to GetList to allow fullSpec on virtual CRDs
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Bertschy <[email protected]>
  • Loading branch information
matthyx committed Feb 7, 2025
1 parent cf7c950 commit 53ceba3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/registry/file/configurationscansummarystorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ func (s *ConfigurationScanSummaryStorage) Get(ctx context.Context, key string, _
}

// GetList generates and returns a list of ConfigurationScanSummary objects for the cluster
func (s *ConfigurationScanSummaryStorage) GetList(ctx context.Context, key string, _ storage.ListOptions, listObj runtime.Object) error {
func (s *ConfigurationScanSummaryStorage) GetList(ctx context.Context, key string, opts storage.ListOptions, listObj runtime.Object) error {
ctx, span := otel.Tracer("").Start(ctx, "ConfigurationScanSummaryStorage.GetList")
span.SetAttributes(attribute.String("key", key))
defer span.End()

workloadScanSummaryListObjPtr := &softwarecomposition.WorkloadConfigurationScanSummaryList{}

// ask for all workloadconfigurationscansummaries in the cluster
if err := s.realStore.GetList(ctx, "/spdx.softwarecomposition.kubescape.io/"+workloadConfigurationScanSummariesResource, storage.ListOptions{}, workloadScanSummaryListObjPtr); err != nil {
if err := s.realStore.GetList(ctx, "/spdx.softwarecomposition.kubescape.io/"+workloadConfigurationScanSummariesResource, opts, workloadScanSummaryListObjPtr); err != nil {
return err
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/registry/file/generatednetworkpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (s *GeneratedNetworkPolicyStorage) Get(ctx context.Context, key string, opt
}

// GetList generates and returns a list of GeneratedNetworkPolicy objects for the given namespace
func (s *GeneratedNetworkPolicyStorage) GetList(ctx context.Context, key string, _ storage.ListOptions, listObj runtime.Object) error {
func (s *GeneratedNetworkPolicyStorage) GetList(ctx context.Context, key string, opts storage.ListOptions, listObj runtime.Object) error {
generatedNetworkPolicyList := &softwarecomposition.GeneratedNetworkPolicyList{
TypeMeta: metav1.TypeMeta{
APIVersion: StorageV1Beta1ApiVersion,
Expand All @@ -84,7 +84,7 @@ func (s *GeneratedNetworkPolicyStorage) GetList(ctx context.Context, key string,

// get all network neighborhood on namespace
networkNeighborhoodObjListPtr := &softwarecomposition.NetworkNeighborhoodList{}
if err := s.realStore.GetList(ctx, replaceKeyForKind(key, networkNeighborhoodResource), storage.ListOptions{}, networkNeighborhoodObjListPtr); err != nil {
if err := s.realStore.GetList(ctx, replaceKeyForKind(key, networkNeighborhoodResource), opts, networkNeighborhoodObjListPtr); err != nil {
return err
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/registry/file/vulnerabilitysummarystorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ func (s *VulnerabilitySummaryStorage) Get(ctx context.Context, key string, _ sto
return nil
}

func (s *VulnerabilitySummaryStorage) GetList(ctx context.Context, key string, _ storage.ListOptions, listObj runtime.Object) error {
func (s *VulnerabilitySummaryStorage) GetList(ctx context.Context, key string, opts storage.ListOptions, listObj runtime.Object) error {
ctx, span := otel.Tracer("").Start(ctx, "VulnerabilitySummaryStorage.GetList")
span.SetAttributes(attribute.String("key", key))
defer span.End()

vulnerabilityManifestSummaryListObjPtr := &softwarecomposition.VulnerabilityManifestSummaryList{}

// ask for all vulnerabilitySummaries in the cluster
if err := s.realStore.GetList(ctx, "/spdx.softwarecomposition.kubescape.io/"+vulnerabilitySummariesResource, storage.ListOptions{}, vulnerabilityManifestSummaryListObjPtr); err != nil {
if err := s.realStore.GetList(ctx, "/spdx.softwarecomposition.kubescape.io/"+vulnerabilitySummariesResource, opts, vulnerabilityManifestSummaryListObjPtr); err != nil {
return err
}

Expand Down

0 comments on commit 53ceba3

Please sign in to comment.