Skip to content

Commit

Permalink
adding depenendy condition spec
Browse files Browse the repository at this point in the history
Signed-off-by: Shawn Hurley <shawn@hurley.page>
  • Loading branch information
shawn-hurley committed Mar 5, 2024
1 parent 3917d7a commit 3c1f237
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
10 changes: 6 additions & 4 deletions provider/internal/java/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ func (p *javaProvider) Capabilities() []provider.Capability {
caps = append(caps, refCap)
}
if p.hasMaven {
caps = append(caps, provider.Capability{
Name: "dependency",
Input: openapi3.SchemaOrRef{},
})
depCap, err := provider.ToProviderCap(r, p.Log, provider.DependencyConditionCap{}, "dependency")
if err != nil {
p.Log.Error(err, "this is not goinag to be cool if it fails")
} else {
caps = append(caps, depCap)
}
}
return caps
}
Expand Down
16 changes: 10 additions & 6 deletions provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,15 +528,19 @@ func templateCondition(condition []byte, ctx map[string]engine.ChainTemplate) ([
return []byte(s), nil
}

// TODO where should this go
type DependencyCondition struct {
Upperbound string
Lowerbound string
Name string
type DependencyConditionCap struct {
Upperbound string `json:"upperbound,omitempty"`
Lowerbound string `json:"lowerbound,omitempty"`
Name string `json:"name"`
// NameRegex will be a valid go regex that will be used to
// search the name of a given dependency.
// Examples include kubernetes* or jakarta-.*-2.2.
NameRegex string
NameRegex string `json:"name_regex,omitempty"`
}

// TODO where should this go
type DependencyCondition struct {
DependencyConditionCap

Client Client
}
Expand Down

0 comments on commit 3c1f237

Please sign in to comment.