Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(k8s): fixed k8s scanner #251

Merged
merged 14 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading