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

🐛 remove dep label selector from dependency condition #380

Merged
merged 1 commit into from
Oct 19, 2023
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
3 changes: 1 addition & 2 deletions parser/rule_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -724,8 +724,7 @@ func (r *RuleParser) getConditionForProvider(langProvider, capability string, va

if capability == "dependency" && !r.NoDependencyRules {
depCondition := provider.DependencyCondition{
Client: client,
LabelSelector: r.DepLabelSelector,
Client: client,
}

fullCondition, ok := value.(map[interface{}]interface{})
Expand Down
12 changes: 0 additions & 12 deletions provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,6 @@ type DependencyCondition struct {
NameRegex string

Client Client

LabelSelector *labels.LabelSelector[*Dep]
}

func (dc DependencyCondition) Evaluate(ctx context.Context, log logr.Logger, condCtx engine.ConditionContext) (engine.ConditionResponse, error) {
Expand All @@ -549,16 +547,6 @@ func (dc DependencyCondition) Evaluate(ctx context.Context, log logr.Logger, con
matchedDeps := []matchedDep{}
for u, ds := range deps {
for _, dep := range ds {
if dc.LabelSelector != nil {
got, err := dc.LabelSelector.Matches(dep)
if err != nil {
return resp, err
}
if !got {
continue
}
}

if dep.Name == dc.Name {
matchedDeps = append(matchedDeps, matchedDep{dep: dep, uri: u})
break
Expand Down
Loading