-
Notifications
You must be signed in to change notification settings - Fork 593
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 guest agent selectors #5743
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,12 +42,7 @@ import { | |
AFFINITY_MODAL_TITLE, | ||
} from '../modals/scheduling-modals/shared/consts'; | ||
import { useGuestAgentInfo } from '../../hooks/use-guest-agent-info'; | ||
import { | ||
getGuestAgentInfoOS, | ||
getGuestAgentInfoHostname, | ||
getGuestAgentInfoTimezoneName, | ||
} from '../../selectors/vmi-guest-agent-info/guest-agent-info'; | ||
import { getGuestOSPrettyName } from '../../selectors/vmi-guest-agent-info/guest-os-info'; | ||
import { GuestAgentInfoWrapper } from '../../k8s/wrapper/vm/guest-agent-info/guest-agent-info-wrapper'; | ||
import { VMStatusBundle } from '../../statuses/vm/types'; | ||
|
||
import './vm-resource.scss'; | ||
|
@@ -89,8 +84,9 @@ export const VMResourceSummary: React.FC<VMResourceSummaryProps> = ({ | |
const description = getDescription(vmiLike); | ||
const os = getOperatingSystemName(vmiLike) || getOperatingSystem(vmiLike); | ||
|
||
const [guestAgentInfo] = useGuestAgentInfo({ vmi }); | ||
const guestAgentInfoOS = getGuestAgentInfoOS(guestAgentInfo); | ||
const [guestAgentInfoRaw] = useGuestAgentInfo({ vmi }); | ||
const guestAgentInfo = new GuestAgentInfoWrapper(guestAgentInfoRaw); | ||
const operatingSystem = guestAgentInfo.getOSInfo().getPrettyName(); | ||
|
||
return ( | ||
<ResourceSummary resource={vmiLike}> | ||
|
@@ -111,9 +107,9 @@ export const VMResourceSummary: React.FC<VMResourceSummaryProps> = ({ | |
<VMDetailsItem | ||
title="Operating System" | ||
idValue={prefixedID(id, 'os')} | ||
isNotAvail={!(getGuestOSPrettyName(guestAgentInfoOS) || os)} | ||
isNotAvail={!(operatingSystem || os)} | ||
> | ||
{getGuestOSPrettyName(guestAgentInfoOS) || os} | ||
{operatingSystem || os} | ||
</VMDetailsItem> | ||
|
||
{isVM && ( | ||
|
@@ -135,7 +131,11 @@ export const VMDetailsList: React.FC<VMResourceListProps> = ({ | |
canUpdateVM, | ||
kindObj, | ||
}) => { | ||
const [guestAgentInfo] = useGuestAgentInfo({ vmi }); | ||
const [guestAgentInfoRaw] = useGuestAgentInfo({ vmi }); | ||
const guestAgentInfo = new GuestAgentInfoWrapper(guestAgentInfoRaw); | ||
const hostname = guestAgentInfo.getHostname(); | ||
const timeZone = guestAgentInfo.getTimezoneName(); | ||
|
||
const [isBootOrderModalOpen, setBootOrderModalOpen] = React.useState<boolean>(false); | ||
const isVM = kindObj === VirtualMachineModel; | ||
const vmiLike = isVM ? vm : vmi; | ||
|
@@ -214,20 +214,12 @@ export const VMDetailsList: React.FC<VMResourceListProps> = ({ | |
{launcherPod && ipAddrs} | ||
</VMDetailsItem> | ||
|
||
<VMDetailsItem | ||
title="Hostname" | ||
idValue={prefixedID(id, 'hostname')} | ||
isNotAvail={!getGuestAgentInfoHostname(guestAgentInfo)} | ||
> | ||
{getGuestAgentInfoHostname(guestAgentInfo)} | ||
<VMDetailsItem title="Hostname" idValue={prefixedID(id, 'hostname')} isNotAvail={!hostname}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This may change based on @matthewcarleton's input on #5741 (comment), but we'll go with this for now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
{hostname} | ||
</VMDetailsItem> | ||
|
||
<VMDetailsItem | ||
title="Time Zone" | ||
idValue={prefixedID(id, 'timezone')} | ||
isNotAvail={!getGuestAgentInfoTimezoneName(guestAgentInfo)} | ||
> | ||
{getGuestAgentInfoTimezoneName(guestAgentInfo)} | ||
<VMDetailsItem title="Time Zone" idValue={prefixedID(id, 'timezone')} isNotAvail={!timeZone}> | ||
{timeZone} | ||
</VMDetailsItem> | ||
|
||
<VMDetailsItem | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can leave this here for now, but can add it to the
GuestAgentOSInfoWrapper
if you want.