Skip to content

Commit

Permalink
fix(k8s): fixed k8s scanner (#251)
Browse files Browse the repository at this point in the history
* feat(scanner/k8s): fix context timeout config

* fix(scanner/k8s): fix logical error during ImageID parsing

* fix(scanner/k8s): fix processing

* Automatic application of license header

* fix(scanner/k8s): added componentName ot filter

* refactor(mariadb/issue): reverted debugging change

* fix: addressed comments

* feat: adding error generalization

* Automatic application of license header

* fix: added import

* fix: re-generated gql

---------

Co-authored-by: License Bot <[email protected]>
Co-authored-by: Michael Reimsbach <[email protected]>
  • Loading branch information
3 people authored and dustindemmerle committed Sep 26, 2024
1 parent 3f50057 commit d2d296f
Show file tree
Hide file tree
Showing 40 changed files with 2,029 additions and 5,877 deletions.
23 changes: 15 additions & 8 deletions internal/api/graphql/graph/baseResolver/component_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ package baseResolver

import (
"context"

"github.com/cloudoperators/heureka/internal/api/graphql/graph/model"
"github.com/cloudoperators/heureka/internal/app"
"github.com/cloudoperators/heureka/internal/entity"
"github.com/cloudoperators/heureka/internal/util"
"github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -65,6 +65,10 @@ func ComponentVersionBaseResolver(app app.Heureka, ctx context.Context, filter *
return nil, NewResolverError("ComponentVersionBaseResolver", "Bad Request - unable to parse cursor 'after'")
}

if filter == nil {
filter = &model.ComponentVersionFilter{}
}

var issueId []*int64
var componentId []*int64
if parent != nil {
Expand All @@ -81,17 +85,20 @@ func ComponentVersionBaseResolver(app app.Heureka, ctx context.Context, filter *
case model.ComponentNodeName:
componentId = []*int64{pid}
}
}
} else {
componentId, err = util.ConvertStrToIntSlice(filter.ComponentID)

if filter == nil {
filter = &model.ComponentVersionFilter{}
if err != nil {
return nil, NewResolverError("ComponentVersionBaseResolver", "Bad Request - Error while parsing filter component ID")
}
}

f := &entity.ComponentVersionFilter{
Paginated: entity.Paginated{First: first, After: afterId},
IssueId: issueId,
ComponentId: componentId,
Version: filter.Version,
Paginated: entity.Paginated{First: first, After: afterId},
IssueId: issueId,
ComponentId: componentId,
ComponentName: filter.ComponentName,
Version: filter.Version,
}

opt := GetListOptions(requestedFields)
Expand Down
Loading

0 comments on commit d2d296f

Please sign in to comment.