mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
make sure vulns are shown in list OS page, and fix the names (#31930)
# Checklist for submitter If some of the following don't apply, delete the relevant line. ## Testing - [x] Added/updated automated tests - [x] QA'd all new/changed functionality manually For unreleased bug fixes in a release candidate, one of: - [x] Confirmed that the fix is not expected to adversely impact load test results
This commit is contained in:
parent
d09e631b5c
commit
56284ef87b
3 changed files with 20 additions and 5 deletions
|
|
@ -26,6 +26,7 @@ import {
|
|||
INumberCellProps,
|
||||
IStringCellProps,
|
||||
} from "interfaces/datatable_config";
|
||||
import { isLinuxLike } from "interfaces/platform";
|
||||
|
||||
type ITableColumnConfig = Column<IOperatingSystemVersion>;
|
||||
|
||||
|
|
@ -65,7 +66,7 @@ const generateDefaultTableHeaders = (
|
|||
);
|
||||
}
|
||||
|
||||
const { name, os_version_id, platform } = cellProps.row.original;
|
||||
const { name_only, os_version_id, platform } = cellProps.row.original;
|
||||
|
||||
const softwareOsDetailsPath = getPathWithQueryParams(
|
||||
PATHS.SOFTWARE_OS_DETAILS(os_version_id),
|
||||
|
|
@ -85,7 +86,7 @@ const generateDefaultTableHeaders = (
|
|||
customOnClick={onClickSoftware}
|
||||
tooltipTruncate
|
||||
prefix={<OSIcon name={platform} />}
|
||||
value={name}
|
||||
value={name_only}
|
||||
/>
|
||||
);
|
||||
},
|
||||
|
|
@ -104,7 +105,11 @@ const generateDefaultTableHeaders = (
|
|||
accessor: "vulnerabilities",
|
||||
Cell: (cellProps: IVulnCellProps) => {
|
||||
const platform = cellProps.row.original.platform;
|
||||
if (platform !== "darwin" && platform !== "windows") {
|
||||
if (
|
||||
platform !== "darwin" &&
|
||||
platform !== "windows" &&
|
||||
!isLinuxLike(platform)
|
||||
) {
|
||||
return <TextCell value="Not supported" grey />;
|
||||
}
|
||||
return <VulnerabilitiesCell vulnerabilities={cellProps.cell.value} />;
|
||||
|
|
|
|||
|
|
@ -2306,7 +2306,10 @@ func (svc *Service) populateOSVersionDetails(ctx context.Context, osVersion *fle
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
osVersion.Kernels = kernels
|
||||
|
||||
if len(kernels) > 0 {
|
||||
osVersion.Kernels = kernels
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package service
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"sort"
|
||||
"testing"
|
||||
|
|
@ -118,8 +119,14 @@ func (s *integrationEnterpriseTestSuite) TestLinuxOSVulns() {
|
|||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
// Aggregate OS versions
|
||||
// Entity endpoint kernels field should be empty
|
||||
require.NoError(t, s.ds.UpdateOSVersions(ctx))
|
||||
resp := s.Do("GET", fmt.Sprintf("/api/latest/fleet/os_versions/%d", osinfo.OSVersionID), nil, http.StatusOK, "team_id", fmt.Sprintf("%d", 0))
|
||||
bodyBytes, err := io.ReadAll(resp.Body)
|
||||
require.NoError(t, err)
|
||||
assert.Contains(t, string(bodyBytes), `"kernels": []`)
|
||||
|
||||
// Aggregate OS versions
|
||||
require.NoError(t, s.ds.UpdateOSVersions(ctx))
|
||||
require.NoError(t, s.ds.SyncHostsSoftware(ctx, time.Now()))
|
||||
require.NoError(t, s.ds.ReconcileSoftwareTitles(ctx))
|
||||
|
|
|
|||
Loading…
Reference in a new issue