Commit 309e84aa authored by Michael Prieto Hernández's avatar Michael Prieto Hernández 👽
Browse files

Merge branch 'device_resources' into 'master'

add container (device) resources

See merge request !12
parents 0614384d ba842753
......@@ -96,15 +96,12 @@ public class KnetlabDeploymentUtils {
Map<String, Quantity> limitsAndRequest = new HashMap<>(1);
// TODO: Is device expose to the pod? Yes, we created dynamically
limitsAndRequest.put("ovs-cni.network.kubevirt.io/" + BRIDGE_NAME, quantity);
ResourceRequirements resourceRequirements = new ResourceRequirementsBuilder().addToLimits(limitsAndRequest)
.addToRequests(limitsAndRequest).build();
ResourceRequirementsBuilder resourceRequirementsBuilder = new ResourceRequirementsBuilder().addToLimits(limitsAndRequest)
.addToRequests(limitsAndRequest);
devicePodSpec.getContainers().forEach(container -> {
// Container localContainer = new
// ContainerBuilder().withName(c.getName()).withImage(c.getImage())
// .withImagePullPolicy(c.getImagePullPolicy()).withNewResources().addToLimits("",
// quantity) .withEnv(c.getEnv())
// .build();
container.setResources(resourceRequirements);
//add container resources
resourceRequirementsBuilder.addToLimits(container.getResources().getLimits()).addToRequests(container.getResources().getRequests());
container.setResources(resourceRequirementsBuilder.build());
containers.add(container);
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment