Skip to content

Commit

Permalink
Add filters for setup experience and platform on software datastore
Browse files Browse the repository at this point in the history
  • Loading branch information
dantecatalfamo committed Oct 1, 2024
1 parent f526540 commit 409faaf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions server/datastore/mysql/software_titles.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,15 @@ GROUP BY st.id, package_self_service, package_name, package_version, package_url
defaultFilter += ` AND ( si.self_service = 1 OR vat.self_service = 1 ) `
}

if opt.SetupExperienceOnly {
defaultFilter += ` AND ( si.install_during_setup OR vat.install_during_setup )`
}

if opt.Platform != "" {
defaultFilter += ` AND ( si.platform = ? OR vat.platform = ? )`
args = append(args, opt.Platform, opt.Platform)
}

stmt = fmt.Sprintf(stmt, softwareInstallersJoinCond, vppAppsJoinCond, vppAppsTeamsJoinCond, countsJoin, softwareJoin, additionalWhere, defaultFilter)
return stmt, args
}
Expand Down
2 changes: 2 additions & 0 deletions server/fleet/software.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ type SoftwareTitleListOptions struct {
MinimumCVSS float64 `query:"min_cvss_score,optional"`
MaximumCVSS float64 `query:"max_cvss_score,optional"`
PackagesOnly bool `query:"packages_only,optional"`
Platform string `query:"platform,optional"`
SetupExperienceOnly bool `query:"setup_experience,optional"`
}

type HostSoftwareTitleListOptions struct {
Expand Down

0 comments on commit 409faaf

Please sign in to comment.