diff --git a/apps/infra/src/components/organism/OsUpdate/OsUpdate.cy.tsx b/apps/infra/src/components/organism/OsUpdate/OsUpdate.cy.tsx new file mode 100644 index 000000000..6d604f9a0 --- /dev/null +++ b/apps/infra/src/components/organism/OsUpdate/OsUpdate.cy.tsx @@ -0,0 +1,162 @@ +/* + * SPDX-FileCopyrightText: (C) 2025 Intel Corporation + * SPDX-License-Identifier: Apache-2.0 + */ + +import { infra } from "@orch-ui/apis"; +import { + assignedWorkloadHostTwo as mockHost, + osUpdatePolicyLatest, + osUpdatePolicyTarget, +} from "@orch-ui/utils"; +import OsUpdate from "./OsUpdate"; +import OsUpdatePom from "./OsUpdate.pom"; + +const pom = new OsUpdatePom(); + +// Mock host with OS update available +const mockHostWithUpdate: infra.HostResourceRead = { + ...mockHost, + instance: { + ...mockHost.instance!, + osUpdateAvailable: "Ubuntu 22.04 LTS", + updatePolicy: osUpdatePolicyTarget, + }, +}; + +// Mock host without OS update policy assigned +const mockHostNoPolicy: infra.HostResourceRead = { + ...mockHost, + instance: { + ...mockHost.instance!, + osUpdateAvailable: "Ubuntu 22.04 LTS", + updatePolicy: undefined, + }, +}; + +// Mock host without instance +const mockHostNoInstance: infra.HostResourceRead = { + ...mockHost, + instance: undefined, +}; + +describe("", () => { + describe("Basic Rendering", () => { + it("should render component with host data", () => { + pom.interceptApis([pom.api.getOsUpdatePolicies]); + cy.mount(); + pom.waitForApis(); + pom.root.should("exist"); + }); + + it("should display update availability information", () => { + pom.interceptApis([pom.api.getOsUpdatePolicies]); + cy.mount(); + pom.waitForApis(); + + cy.contains("Updates").should("exist"); + pom.updatesAvailable.should("contain", "Ubuntu 22.04 LTS"); + }); + + it("should display assigned OS update policy", () => { + pom.interceptApis([pom.api.getOsUpdatePolicies]); + cy.mount(); + pom.waitForApis(); + + cy.contains("Assigned OS Update Policy").should("exist"); + pom.assignedPolicy.should("contain", osUpdatePolicyTarget.name); + }); + + it("should show dash when no assigned policy", () => { + pom.interceptApis([pom.api.getOsUpdatePolicies]); + cy.mount(); + pom.waitForApis(); + + pom.assignedPolicy.should("contain", "-"); + }); + + it("should handle host without instance", () => { + pom.interceptApis([pom.api.getOsUpdatePolicies]); + cy.mount(); + pom.waitForApis(); + + pom.root.should("exist"); + pom.updatesAvailable.should("contain", "-"); + pom.assignedPolicy.should("contain", "-"); + }); + }); + + describe("OS Update Policy Dropdown", () => { + it("should load and display OS update policies", () => { + pom.interceptApis([pom.api.getOsUpdatePolicies]); + cy.mount(); + pom.waitForApis(); + + pom.dropdown.selectDropdownValueByLabel( + pom.root, + "osUpdatePolicy", + osUpdatePolicyTarget.name, + ); + + // Should show available policies + cy.contains(osUpdatePolicyTarget.name).should("exist"); + cy.contains(osUpdatePolicyLatest.name).should("exist"); + }); + + it("should show loading state while fetching policies", () => { + // Don't wait for API to complete to test loading state + pom.interceptApis([pom.api.getOsUpdatePolicies]); + cy.mount(); + + pom.policyDropdown.should("contain", "Loading policies..."); + }); + + it("should show no policies message when empty response", () => { + pom.interceptApis([pom.api.getOsUpdatePoliciesEmpty]); + cy.mount(); + pom.waitForApis(); + + pom.policyDropdown.should("contain", "No OS Update Policies Available"); + pom.policyDropdown.should("have.class", "spark-dropdown-is-disabled"); + }); + + it("should handle API error gracefully", () => { + pom.interceptApis([pom.api.getOsUpdatePoliciesError500]); + cy.mount(); + pom.waitForApis(); + + // Component should still render but dropdown should show error state + pom.root.should("exist"); + pom.policyDropdown.should("have.class", "spark-dropdown-is-disabled"); + }); + + it("should allow policy selection", () => { + pom.interceptApis([pom.api.getOsUpdatePolicies]); + cy.mount(); + pom.waitForApis(); + + // Select a policy + pom.selectPolicy(osUpdatePolicyTarget.name); + + // Apply button should become enabled + pom.el.applyPolicyBtn.should("not.have.class", "spark-button-disabled"); + }); + }); + + describe("Apply Policy Functionality", () => { + beforeEach(() => { + pom.interceptApis([pom.api.getOsUpdatePolicies]); + cy.mount(); + pom.waitForApis(); + }); + + it("should disable apply button when no policy selected", () => { + pom.applyButton.should("have.class", "spark-button-disabled"); + }); + + it("should enable apply button when policy is selected", () => { + pom.selectPolicy(osUpdatePolicyTarget.name); + pom.applyButton.should("not.have.class", "spark-button-disabled"); + }); + }); +}); diff --git a/apps/infra/src/components/organism/OsUpdate/OsUpdate.pom.ts b/apps/infra/src/components/organism/OsUpdate/OsUpdate.pom.ts new file mode 100644 index 000000000..20d6c11a7 --- /dev/null +++ b/apps/infra/src/components/organism/OsUpdate/OsUpdate.pom.ts @@ -0,0 +1,106 @@ +/* + * SPDX-FileCopyrightText: (C) 2025 Intel Corporation + * SPDX-License-Identifier: Apache-2.0 + */ + +import { infra } from "@orch-ui/apis"; +import { SiDropdown } from "@orch-ui/poms"; +import { CyApiDetails, CyPom, defaultActiveProject } from "@orch-ui/tests"; +import { OsUpdatePolicyStore } from "@orch-ui/utils"; + +const dataCySelectors = [ + "osProfiles", + "desiredOsProfiles", + "osUpdatePolicy", + "applyPolicyBtn", +] as const; +type Selectors = (typeof dataCySelectors)[number]; + +type ApiAliases = + | "getOsUpdatePolicies" + | "getOsUpdatePoliciesEmpty" + | "getOsUpdatePoliciesError500" + | "patchInstanceSuccess" + | "patchInstanceError"; + +const osUpdatePolicyStore = new OsUpdatePolicyStore(); + +const osUpdatePoliciesRoute = `**/v1/projects/${defaultActiveProject.name}/os-update-policies*`; +const patchInstanceRoute = (resourceId: string) => + `**/v1/projects/${defaultActiveProject.name}/compute/instances/${resourceId}`; + +const endpoints: CyApiDetails< + ApiAliases, + infra.OsUpdatePolicyListOsUpdatePolicyApiResponse | infra.InstanceResourceRead +> = { + getOsUpdatePolicies: { + route: osUpdatePoliciesRoute, + response: { + osUpdatePolicies: osUpdatePolicyStore.list(), + totalElements: osUpdatePolicyStore.resources.length, + hasNext: false, + }, + }, + getOsUpdatePoliciesEmpty: { + route: osUpdatePoliciesRoute, + response: { + osUpdatePolicies: [], + totalElements: 0, + hasNext: false, + }, + }, + getOsUpdatePoliciesError500: { + route: osUpdatePoliciesRoute, + statusCode: 500, + response: {}, + }, + patchInstanceSuccess: { + method: "PATCH", + route: patchInstanceRoute("*"), + response: {} as infra.InstanceResourceRead, + }, + patchInstanceError: { + method: "PATCH", + route: patchInstanceRoute("*"), + statusCode: 500, + response: {}, + }, +}; + +class OsUpdatePom extends CyPom { + public dropdown = new SiDropdown("osUpdatePolicy"); + + constructor(public rootCy: string = "osUpdate") { + super(rootCy, [...dataCySelectors], endpoints); + } + + get updatesAvailable() { + return this.el.desiredOsProfiles.first(); + } + + get assignedPolicy() { + return this.el.desiredOsProfiles.last(); + } + + get policyDropdown() { + return this.el.osUpdatePolicy; + } + + get applyButton() { + return this.el.applyPolicyBtn; + } + + selectPolicy(policyName: string) { + this.dropdown.selectDropdownValueByLabel( + this.root, + "osUpdatePolicy", + policyName, + ); + } + + clickApply() { + this.applyButton.click(); + } +} + +export default OsUpdatePom; diff --git a/apps/infra/src/components/organism/OsUpdate/OsUpdate.scss b/apps/infra/src/components/organism/OsUpdate/OsUpdate.scss new file mode 100644 index 000000000..385ff69ba --- /dev/null +++ b/apps/infra/src/components/organism/OsUpdate/OsUpdate.scss @@ -0,0 +1,29 @@ +/* + * SPDX-FileCopyrightText: (C) 2025 Intel Corporation + * SPDX-License-Identifier: Apache-2.0 + */ + +.os-update { + padding: 1rem; + display: flex; + flex-direction: column; + gap: 1rem; + + &__header { + margin-bottom: 0.5rem; + } + + &__policy-selection { + display: flex; + flex-direction: column; + gap: 0.5rem; + } + + &__actions { + margin-left: 1rem; + } + + &__apply-button { + height: 100% !important; + } +} diff --git a/apps/infra/src/components/organism/OsUpdate/OsUpdate.tsx b/apps/infra/src/components/organism/OsUpdate/OsUpdate.tsx new file mode 100644 index 000000000..dbbe9d633 --- /dev/null +++ b/apps/infra/src/components/organism/OsUpdate/OsUpdate.tsx @@ -0,0 +1,179 @@ +/* + * SPDX-FileCopyrightText: (C) 2025 Intel Corporation + * SPDX-License-Identifier: Apache-2.0 + */ + +import { infra } from "@orch-ui/apis"; +import { Flex } from "@orch-ui/components"; +import { + formatOsUpdateAvailable, + parseError, + SharedStorage, +} from "@orch-ui/utils"; +import { Button, Dropdown, Item, Text } from "@spark-design/react"; +import { + ButtonSize, + ButtonVariant, + DropdownSize, + MessageBannerAlertState, + ToastState, +} from "@spark-design/tokens"; +import { useEffect, useState } from "react"; +import { useAppDispatch } from "../../../store/hooks"; +import { + showMessageNotification, + showToast, +} from "../../../store/notifications"; +import "./OsUpdate.scss"; + +const dataCy = "osUpdate"; +interface OsUpdateProps { + host: infra.HostResourceRead; +} + +const OsUpdate = ({ host }: OsUpdateProps) => { + const cy = { "data-cy": dataCy }; + const [selectedPolicyId, setSelectedPolicyId] = useState(""); + const dispatch = useAppDispatch(); + + // Fetch OS Update Policies + const { + data: osUpdatePolicies, + isLoading: isPoliciesLoading, + isError: isPoliciesError, + error: policiesError, + } = infra.useOsUpdatePolicyListOsUpdatePolicyQuery({ + projectName: SharedStorage.project?.name ?? "", + pageSize: 100, + }); + + // Handle policies loading error + useEffect(() => { + if (isPoliciesError && policiesError) { + dispatch( + showMessageNotification({ + messageTitle: "Failed to load OS Update Policies", + messageBody: `${parseError(policiesError).data}`, + variant: MessageBannerAlertState.Error, + showMessage: true, + }), + ); + } + }, [isPoliciesError, policiesError]); + + // Patch Instance Mutation + const [patchInstance, { isLoading: isPatching }] = + infra.useInstanceServicePatchInstanceMutation(); + + const handleApplyPolicy = async () => { + if (!selectedPolicyId) { + showToast({ + message: "Please select an OS Update Policy", + state: ToastState.Danger, + }); + return; + } + + try { + const patchPayload: infra.InstanceServicePatchInstanceApiArg = { + projectName: SharedStorage.project?.name ?? "", + resourceId: host.instance?.resourceId ?? "", + instanceResource: { + osUpdatePolicyID: selectedPolicyId, + }, + }; + + await patchInstance(patchPayload).unwrap(); + dispatch( + showMessageNotification({ + messageTitle: "OS Update Policy applied successfully", + messageBody: "", + variant: MessageBannerAlertState.Success, + showMessage: true, + }), + ); + } catch (error) { + dispatch( + showMessageNotification({ + messageTitle: "Failed to apply OS Update Policy", + messageBody: `${parseError(error).data}`, + variant: MessageBannerAlertState.Error, + showMessage: true, + }), + ); + } + }; + + const policies = osUpdatePolicies?.osUpdatePolicies || []; + + return ( +
+ + Available Update + + {formatOsUpdateAvailable(host?.instance?.osUpdateAvailable ?? "-") || + "-"} + + + + + Assigned OS Update Policy + + {host.instance?.updatePolicy?.name || "-"} + + + + + + Select OS Update Policy + + + 0 + ? "Select an OS Update Policy" + : "No OS Update Policies Available" + } + selectedKey={selectedPolicyId} + onSelectionChange={(key) => setSelectedPolicyId(key as string)} + size={DropdownSize.Large} + isDisabled={isPoliciesLoading || policies.length === 0} + > + {policies.map((policy) => ( + +
+ {policy.name} +
+
+ ))} +
+ + {/* Apply Button */} +
+ +
+
+
+
+ ); +}; + +export default OsUpdate; diff --git a/apps/infra/src/components/organism/OsUpdatePolicyDetails/OsUpdatePolicyDetails.cy.tsx b/apps/infra/src/components/organism/OsUpdatePolicyDetails/OsUpdatePolicyDetails.cy.tsx index 643e771f6..96f7f0e19 100644 --- a/apps/infra/src/components/organism/OsUpdatePolicyDetails/OsUpdatePolicyDetails.cy.tsx +++ b/apps/infra/src/components/organism/OsUpdatePolicyDetails/OsUpdatePolicyDetails.cy.tsx @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { osUpdatePolicyScheduled, osUpdatePolicyTarget } from "@orch-ui/utils"; +import { osUpdatePolicyLatest, osUpdatePolicyTarget } from "@orch-ui/utils"; import OsUpdatePolicyDetails from "./OsUpdatePolicyDetails"; import OsUpdatePolicyDetailsPom from "./OsUpdatePolicyDetails.pom"; @@ -19,7 +19,9 @@ describe("", () => { it("should display policy name and description", () => { cy.mount(); cy.contains(osUpdatePolicyTarget.name).should("exist"); - cy.contains(osUpdatePolicyTarget.description).should("exist"); + if (osUpdatePolicyTarget.description) { + cy.contains(osUpdatePolicyTarget.description).should("exist"); + } }); it("should display OS Configuration information", () => { @@ -35,10 +37,9 @@ describe("", () => { }); describe("Field Display - All Fields Always Visible", () => { - it("should always show main sections", () => { + it("should show main sections", () => { cy.mount(); - // Only these two sections should be visible as headers cy.contains("Details").should("exist"); cy.contains("OS Configuration").should("exist"); cy.contains("Update Policy").should("exist"); @@ -47,24 +48,8 @@ describe("", () => { cy.contains("Update Sources").should("exist"); }); - it("should show advanced settings for any policy", () => { - cy.mount( - , - ); - - // main section headers should be visible - cy.contains("Details").should("exist"); - cy.contains("OS Configuration").should("exist"); - - // All fields should be visible as labels - cy.contains("Kernel Command Update").should("exist"); - cy.contains("Update Sources").should("exist"); - }); - it("should display update packages when available", () => { - cy.mount( - , - ); + cy.mount(); // Update Packages should be visible as a field label cy.contains("Update Packages").should("exist"); @@ -72,7 +57,7 @@ describe("", () => { it("should show correct update policy labels", () => { const policyWithLatest = { - ...osUpdatePolicyScheduled, + ...osUpdatePolicyLatest, updatePolicy: "UPDATE_POLICY_LATEST" as const, }; @@ -100,7 +85,7 @@ describe("", () => { describe("Field Display Logic", () => { it("should show 'N/A' for empty optional fields", () => { const policyWithEmptyFields = { - ...osUpdatePolicyScheduled, + ...osUpdatePolicyLatest, updateKernelCommand: "", updateSources: [], targetOs: undefined, @@ -113,25 +98,22 @@ describe("", () => { }); it("should handle policies with all fields populated", () => { - cy.mount( - , - ); + cy.mount(); // Check that all available fields are displayed cy.contains("Details").should("exist"); - cy.contains(osUpdatePolicyScheduled.name).should("exist"); - if (osUpdatePolicyScheduled.description) { - cy.contains(osUpdatePolicyScheduled.description).should("exist"); + cy.contains(osUpdatePolicyLatest.name).should("exist"); + if (osUpdatePolicyLatest.description) { + cy.contains(osUpdatePolicyLatest.description).should("exist"); } }); it("should display update sources as comma-separated list", () => { - if (osUpdatePolicyScheduled.updateSources?.length) { + if (osUpdatePolicyLatest.updateSources?.length) { cy.mount( - , + , ); - const expectedSources = - osUpdatePolicyScheduled.updateSources.join(", "); + const expectedSources = osUpdatePolicyLatest.updateSources.join(", "); cy.contains(expectedSources).should("exist"); } }); @@ -140,7 +122,7 @@ describe("", () => { describe("Package Display", () => { it("should render update packages correctly", () => { const policyWithPackages = { - ...osUpdatePolicyScheduled, + ...osUpdatePolicyLatest, updatePackages: "package1\npackage2\npackage3", }; @@ -155,7 +137,7 @@ describe("", () => { it("should handle empty package list", () => { const policyWithEmptyPackages = { - ...osUpdatePolicyScheduled, + ...osUpdatePolicyLatest, updatePackages: "", }; @@ -170,7 +152,7 @@ describe("", () => { it("should handle undefined packages", () => { const policyWithoutPackages = { - ...osUpdatePolicyScheduled, + ...osUpdatePolicyLatest, updatePackages: undefined, }; diff --git a/apps/infra/src/components/organism/hosts/HostDetailsTab/HostDetailsTab.scss b/apps/infra/src/components/organism/hosts/HostDetailsTab/HostDetailsTab.scss index 777e35e06..8131d044e 100644 --- a/apps/infra/src/components/organism/hosts/HostDetailsTab/HostDetailsTab.scss +++ b/apps/infra/src/components/organism/hosts/HostDetailsTab/HostDetailsTab.scss @@ -17,4 +17,8 @@ .host-specs { width: 100%; } + + .os-update-container { + width: 100%; + } } diff --git a/apps/infra/src/components/organism/hosts/HostDetailsTab/HostDetailsTab.tsx b/apps/infra/src/components/organism/hosts/HostDetailsTab/HostDetailsTab.tsx index 35dc2e85f..4013f2afb 100644 --- a/apps/infra/src/components/organism/hosts/HostDetailsTab/HostDetailsTab.tsx +++ b/apps/infra/src/components/organism/hosts/HostDetailsTab/HostDetailsTab.tsx @@ -21,6 +21,7 @@ import { import { Item, MessageBanner, Tabs } from "@spark-design/react"; import React, { Suspense } from "react"; import OSProfileDetails from "../../../organism/OSProfileDetails/OSProfileDetails"; +import OsUpdate from "../../../organism/OsUpdate/OsUpdate"; import VproDetails from "../../VproDetails/VproDetails"; import { ResourceType, ResourceTypeTitle } from "../ResourceDetails"; import { HostResourcesCpuRead } from "../resourcedetails/Cpu"; @@ -81,10 +82,14 @@ const HostDetailsTab: React.FC = (props) => { id: 7, title: "Host Labels", }, + { + id: 8, + title: "Updates", + }, ...(host.currentAmtState === "AMT_STATE_PROVISIONED" ? [ { - id: 8, + id: 9, title: "vPro Details", }, ] @@ -268,6 +273,14 @@ const HostDetailsTab: React.FC = (props) => { , ); + itemList.push( + +
+ +
+
, + ); + if (host.currentAmtState === "AMT_STATE_PROVISIONED") { itemList.push( diff --git a/apps/infra/src/components/pages/HostDetails/HostDetails.cy.tsx b/apps/infra/src/components/pages/HostDetails/HostDetails.cy.tsx index 63f8b5173..f758269b1 100644 --- a/apps/infra/src/components/pages/HostDetails/HostDetails.cy.tsx +++ b/apps/infra/src/components/pages/HostDetails/HostDetails.cy.tsx @@ -214,11 +214,6 @@ describe("HostDetails", () => { it("show OS field", () => { pom.getHostDescriptionValueByKey("OS").should("contain.text", "Ubuntu"); }); - it("show Updates field", () => { - pom - .getHostDescriptionValueByKey("Updates") - .should("contain.text", "Ubuntu"); - }); it("show `OS update available` under the Hostname", () => { pom.el.osUpdateAvailable.should("exist"); diff --git a/apps/infra/src/components/pages/HostDetails/HostDetails.tsx b/apps/infra/src/components/pages/HostDetails/HostDetails.tsx index f07d983b0..b253ceec3 100644 --- a/apps/infra/src/components/pages/HostDetails/HostDetails.tsx +++ b/apps/infra/src/components/pages/HostDetails/HostDetails.tsx @@ -18,7 +18,6 @@ import { import { API_INTERVAL, checkAuthAndRole, - formatOsUpdateAvailable, getCustomStatusOnIdleAggregation, getTrustedComputeCompatibility, HostGenericStatuses, @@ -546,14 +545,6 @@ const HostDetails: React.FC = () => { OS {host?.instance?.os?.name ?? "-"} - - Updates - - {formatOsUpdateAvailable( - host?.instance?.osUpdateAvailable ?? "-", - )} - - {host.site && ( Site diff --git a/apps/infra/src/components/pages/OsUpdatePolicy/OsUpdatePolicy.cy.tsx b/apps/infra/src/components/pages/OsUpdatePolicy/OsUpdatePolicy.cy.tsx index 20670fa11..8c68eb7fd 100644 --- a/apps/infra/src/components/pages/OsUpdatePolicy/OsUpdatePolicy.cy.tsx +++ b/apps/infra/src/components/pages/OsUpdatePolicy/OsUpdatePolicy.cy.tsx @@ -6,9 +6,9 @@ import { cyGet } from "@orch-ui/tests"; // import * as x from "@orch-ui/utils"; import { - osUpdatePolicyImmediate, - osUpdatePolicyScheduled, + osUpdatePolicyLatest, osUpdatePolicyTarget, + osUpdatePolicyUnspecified, } from "@orch-ui/utils"; import OsUpdatePolicy from "./OsUpdatePolicy"; import OsUpdatePolicyPom from "./OsUpdatePolicy.pom"; @@ -70,13 +70,10 @@ describe("", () => { it("should display policy names in table", () => { pom.osProfilesTablePom.root.should("contain", osUpdatePolicyTarget.name); + pom.osProfilesTablePom.root.should("contain", osUpdatePolicyLatest.name); pom.osProfilesTablePom.root.should( "contain", - osUpdatePolicyScheduled.name, - ); - pom.osProfilesTablePom.root.should( - "contain", - osUpdatePolicyImmediate.name, + osUpdatePolicyUnspecified.name, ); }); @@ -135,7 +132,7 @@ describe("", () => { // Should not show non-matching policies pom.osProfilesTablePom.root.should( "not.contain", - osUpdatePolicyScheduled.name, + osUpdatePolicyLatest.name, ); }); @@ -146,10 +143,7 @@ describe("", () => { // Should show all policies again pom.osProfilesTablePom.root.should("contain", osUpdatePolicyTarget.name); - pom.osProfilesTablePom.root.should( - "contain", - osUpdatePolicyScheduled.name, - ); + pom.osProfilesTablePom.root.should("contain", osUpdatePolicyLatest.name); }); }); diff --git a/library/utils/mocks/infra/store/osUpdatePolicy.ts b/library/utils/mocks/infra/store/osUpdatePolicy.ts index 940d6bca8..4172d50b6 100644 --- a/library/utils/mocks/infra/store/osUpdatePolicy.ts +++ b/library/utils/mocks/infra/store/osUpdatePolicy.ts @@ -43,22 +43,22 @@ export const osUpdatePolicyTarget = createOsUpdatePolicy( osTbUpdate, // Use the actual OS resource ); -export const osUpdatePolicyScheduled = createOsUpdatePolicy( +export const osUpdatePolicyLatest = createOsUpdatePolicy( "osupdatepolicy-b22027e6", "Production Security Updates", "Automated security updates policy for production environments", - "UPDATE_POLICY_SCHEDULED" as infra.UpdatePolicy, + "UPDATE_POLICY_LATEST" as infra.UpdatePolicy, osUbuntu, // Use the actual OS resource "security-updates kernel-updates", ["https://security-updates.example.com/repo"], "grub-reboot 0", ); -export const osUpdatePolicyImmediate = createOsUpdatePolicy( +export const osUpdatePolicyUnspecified = createOsUpdatePolicy( "osupdatepolicy-c33038f7", - "Critical Patch Policy", - "Immediate updates for critical security patches", - "UPDATE_POLICY_IMMEDIATE" as infra.UpdatePolicy, + "Default Update Policy", + "Default update policy with unspecified behavior", + "UPDATE_POLICY_UNSPECIFIED" as infra.UpdatePolicy, osRedHat, // Use the actual OS resource "critical-patches", ["https://critical-updates.example.com/repo"], @@ -72,8 +72,8 @@ export class OsUpdatePolicyStore extends BaseStore< constructor() { super("resourceId", [ osUpdatePolicyTarget, - osUpdatePolicyScheduled, - osUpdatePolicyImmediate, + osUpdatePolicyLatest, + osUpdatePolicyUnspecified, ]); }