formats/aci: update isolators to ACI 0.4.1

This commit is contained in:
Jimmy Zelinskie 2015-03-13 15:31:36 -04:00
parent 66b3d45fbc
commit 07efee1531

View file

@ -33,26 +33,34 @@ class ACIImage(TarImageFormatter):
def _isolate_memory(memory):
return {
"name": "memory/limit",
"value": str(memory) + 'B'
"value": {
"request": str(memory) + 'B',
}
}
def _isolate_swap(memory):
return {
"name": "memory/swap",
"value": str(memory) + 'B'
"value": {
"request": str(memory) + 'B',
}
}
def _isolate_cpu(cpu):
return {
"name": "cpu/shares",
"value": str(cpu)
"value": {
"request": str(cpu),
}
}
def _isolate_capabilities(capabilities_set_value):
capabilities_set = re.split(r'[\s,]', capabilities_set_value)
return {
"name": "capabilities/bounding-set",
"value": ' '.join(capabilities_set)
"name": "os/linux/capabilities-retain-set",
"value": {
"set": capabilities_set,
}
}
mappers = {
@ -154,7 +162,7 @@ class ACIImage(TarImageFormatter):
manifest = {
"acKind": "ImageManifest",
"acVersion": "0.2.0",
"acVersion": "0.4.1",
"name": '%s/%s/%s/%s' % (hostname, namespace, repository, tag),
"labels": [
{