formats/aci: update isolators to ACI 0.4.1
This commit is contained in:
parent
66b3d45fbc
commit
07efee1531
1 changed files with 14 additions and 6 deletions
|
@ -33,26 +33,34 @@ class ACIImage(TarImageFormatter):
|
||||||
def _isolate_memory(memory):
|
def _isolate_memory(memory):
|
||||||
return {
|
return {
|
||||||
"name": "memory/limit",
|
"name": "memory/limit",
|
||||||
"value": str(memory) + 'B'
|
"value": {
|
||||||
|
"request": str(memory) + 'B',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def _isolate_swap(memory):
|
def _isolate_swap(memory):
|
||||||
return {
|
return {
|
||||||
"name": "memory/swap",
|
"name": "memory/swap",
|
||||||
"value": str(memory) + 'B'
|
"value": {
|
||||||
|
"request": str(memory) + 'B',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def _isolate_cpu(cpu):
|
def _isolate_cpu(cpu):
|
||||||
return {
|
return {
|
||||||
"name": "cpu/shares",
|
"name": "cpu/shares",
|
||||||
"value": str(cpu)
|
"value": {
|
||||||
|
"request": str(cpu),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def _isolate_capabilities(capabilities_set_value):
|
def _isolate_capabilities(capabilities_set_value):
|
||||||
capabilities_set = re.split(r'[\s,]', capabilities_set_value)
|
capabilities_set = re.split(r'[\s,]', capabilities_set_value)
|
||||||
return {
|
return {
|
||||||
"name": "capabilities/bounding-set",
|
"name": "os/linux/capabilities-retain-set",
|
||||||
"value": ' '.join(capabilities_set)
|
"value": {
|
||||||
|
"set": capabilities_set,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mappers = {
|
mappers = {
|
||||||
|
@ -154,7 +162,7 @@ class ACIImage(TarImageFormatter):
|
||||||
|
|
||||||
manifest = {
|
manifest = {
|
||||||
"acKind": "ImageManifest",
|
"acKind": "ImageManifest",
|
||||||
"acVersion": "0.2.0",
|
"acVersion": "0.4.1",
|
||||||
"name": '%s/%s/%s/%s' % (hostname, namespace, repository, tag),
|
"name": '%s/%s/%s/%s' % (hostname, namespace, repository, tag),
|
||||||
"labels": [
|
"labels": [
|
||||||
{
|
{
|
||||||
|
|
Reference in a new issue