Skip to content

Commit

Permalink
Apply some formating
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedHanafy725 committed Oct 10, 2023
1 parent c749127 commit b9fb8b8
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/grid_client/src/high_level/network.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Addr } from "netaddr";

import { DeploymentFactory, Network } from "../primitives";
import { WorkloadTypes } from "../zos";
import { WorkloadTypes, Znet } from "../zos";
import { HighLevelBase } from "./base";
import { Operations, TwinDeployment } from "./models";

Expand Down Expand Up @@ -33,14 +33,12 @@ class NetworkHL extends HighLevelBase {
// update network if it's already exist
for (const deployment of network.deployments) {
const d = await deploymentFactory.fromObj(deployment);
for (const workload of d["workloads"]) {
if (
workload["type"] !== WorkloadTypes.network ||
!Addr(network.ipRange).contains(Addr(workload["data"]["subnet"]))
) {
for (const workload of d.workloads) {
const data = workload.data as Znet;
if (workload.type !== WorkloadTypes.network || !Addr(network.ipRange).contains(Addr(data.subnet))) {
continue;
}
workload.data = network.updateNetwork(workload["data"]);
workload.data = network.updateNetwork(data);
workload.version += 1;
break;
}
Expand Down

0 comments on commit b9fb8b8

Please sign in to comment.