Skip to content

Commit

Permalink
refactor(host-network): put option for host network to ide and vdi
Browse files Browse the repository at this point in the history
  • Loading branch information
tunahanertekin committed Jun 4, 2024
1 parent be70cc2 commit c9a6954
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/resources/v1alpha1/robot_ide.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ func GetRobotIDEPod(robotIDE *robotv1alpha1.RobotIDE, podNamespacedName *types.N
},
}

// host network patch
if _, hostNetworkEnabled := robotIDE.Labels["host-network"]; hostNetworkEnabled {
idePod.Spec.HostNetwork = true
}

podCfg.InjectImagePullPolicy(&idePod)
podCfg.SchedulePod(&idePod, robotIDE)
podCfg.InjectVolumeConfiguration(&idePod, robot)
Expand Down
5 changes: 5 additions & 0 deletions internal/resources/v1alpha1/robot_vdi.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ func GetRobotVDIPod(robotVDI *robotv1alpha1.RobotVDI, podNamespacedName *types.N
},
}

// host network patch
if _, hostNetworkEnabled := robotVDI.Labels["host-network"]; hostNetworkEnabled {
vdiPod.Spec.HostNetwork = true
}

podCfg.InjectImagePullPolicy(vdiPod)
podCfg.SchedulePod(vdiPod, robotVDI)
podCfg.InjectGenericEnvironmentVariables(vdiPod, robot)
Expand Down

0 comments on commit c9a6954

Please sign in to comment.