Change entry point busy loop to 'sleep infinity'
When the Kubernetes, OpenShift or OpenShiftPods drivers start a container, they replace the image entrypoint by a busy loop: /bin/sh -c 'while true; do sleep 30; done;' The argument to sleep is parsed as a floating point number via strtold(3) which states: An infinity is either "INF" or "INFINITY", disregarding case. Remove the `while true` and sleep for eternity instead. Change-Id: Icc05403c594bae996a2b5a61bb1ad56b2e2fb735
This commit is contained in:
@@ -528,4 +528,4 @@ Selecting the kubernetes driver adds the following options to the
|
||||
image: ubuntu:jammy
|
||||
imagePullPolicy: IfNotPresent
|
||||
command: ["/bin/sh", "-c"]
|
||||
args: ["while true; do sleep 30; done;"]
|
||||
args: ["sleep infinity"]
|
||||
|
@@ -458,4 +458,4 @@ Selecting the openshift pods driver adds the following options to the
|
||||
image: ubuntu:jammy
|
||||
imagePullPolicy: IfNotPresent
|
||||
command: ["/bin/sh", "-c"]
|
||||
args: ["while true; do sleep 30; done;"]
|
||||
args: ["sleep infinity"]
|
||||
|
@@ -542,4 +542,4 @@ Selecting the openshift driver adds the following options to the
|
||||
image: ubuntu:jammy
|
||||
imagePullPolicy: IfNotPresent
|
||||
command: ["/bin/sh", "-c"]
|
||||
args: ["while true; do sleep 30; done;"]
|
||||
args: ["sleep infinity"]
|
||||
|
@@ -354,7 +354,7 @@ class KubernetesProvider(Provider, QuotaSupport):
|
||||
'image': label.image,
|
||||
'imagePullPolicy': label.image_pull,
|
||||
'command': ["/bin/sh", "-c"],
|
||||
'args': ["while true; do sleep 30; done;"],
|
||||
'args': ["sleep infinity"],
|
||||
'env': label.env,
|
||||
}
|
||||
|
||||
|
@@ -257,7 +257,7 @@ class OpenshiftProvider(Provider, QuotaSupport):
|
||||
'image': label.image,
|
||||
'imagePullPolicy': label.image_pull,
|
||||
'command': ["/bin/sh", "-c"],
|
||||
'args': ["while true; do sleep 30; done;"],
|
||||
'args': ["sleep infinity"],
|
||||
'env': label.env,
|
||||
}
|
||||
|
||||
|
2
nodepool/tests/fixtures/kubernetes.yaml
vendored
2
nodepool/tests/fixtures/kubernetes.yaml
vendored
@@ -62,4 +62,4 @@ providers:
|
||||
image: ubuntu:jammy
|
||||
imagePullPolicy: IfNotPresent
|
||||
command: ["/bin/sh", "-c"]
|
||||
args: ["while true; do sleep 30; done;"]
|
||||
args: ["sleep infinity"]
|
||||
|
2
nodepool/tests/fixtures/openshift.yaml
vendored
2
nodepool/tests/fixtures/openshift.yaml
vendored
@@ -67,4 +67,4 @@ providers:
|
||||
image: ubuntu:jammy
|
||||
imagePullPolicy: IfNotPresent
|
||||
command: ["/bin/sh", "-c"]
|
||||
args: ["while true; do sleep 30; done;"]
|
||||
args: ["sleep infinity"]
|
||||
|
2
nodepool/tests/fixtures/openshiftpods.yaml
vendored
2
nodepool/tests/fixtures/openshiftpods.yaml
vendored
@@ -40,4 +40,4 @@ providers:
|
||||
image: ubuntu:jammy
|
||||
imagePullPolicy: IfNotPresent
|
||||
command: ["/bin/sh", "-c"]
|
||||
args: ["while true; do sleep 30; done;"]
|
||||
args: ["sleep infinity"]
|
||||
|
@@ -155,7 +155,7 @@ class TestDriverKubernetes(tests.DBTestCase):
|
||||
'image': 'docker.io/fedora:28',
|
||||
'imagePullPolicy': 'IfNotPresent',
|
||||
'command': ['/bin/sh', '-c'],
|
||||
'args': ['while true; do sleep 30; done;'],
|
||||
'args': ['sleep infinity'],
|
||||
'env': []
|
||||
}],
|
||||
})
|
||||
@@ -206,7 +206,7 @@ class TestDriverKubernetes(tests.DBTestCase):
|
||||
})
|
||||
self.assertEqual(pod['spec'], {
|
||||
'containers': [{
|
||||
'args': ['while true; do sleep 30; done;'],
|
||||
'args': ['sleep infinity'],
|
||||
'command': ['/bin/sh', '-c'],
|
||||
'env': [],
|
||||
'image': 'docker.io/fedora:28',
|
||||
@@ -655,7 +655,7 @@ class TestDriverKubernetes(tests.DBTestCase):
|
||||
'image': 'ubuntu:jammy',
|
||||
'imagePullPolicy': 'IfNotPresent',
|
||||
'command': ['/bin/sh', '-c'],
|
||||
'args': ['while true; do sleep 30; done;'],
|
||||
'args': ['sleep infinity'],
|
||||
}],
|
||||
})
|
||||
|
||||
|
@@ -185,7 +185,7 @@ class TestDriverOpenshift(tests.DBTestCase):
|
||||
'image': 'docker.io/fedora:28',
|
||||
'imagePullPolicy': 'IfNotPresent',
|
||||
'command': ['/bin/sh', '-c'],
|
||||
'args': ['while true; do sleep 30; done;'],
|
||||
'args': ['sleep infinity'],
|
||||
'env': []
|
||||
}],
|
||||
'imagePullSecrets': [],
|
||||
@@ -239,7 +239,7 @@ class TestDriverOpenshift(tests.DBTestCase):
|
||||
})
|
||||
self.assertEqual(pod['spec'], {
|
||||
'containers': [{
|
||||
'args': ['while true; do sleep 30; done;'],
|
||||
'args': ['sleep infinity'],
|
||||
'command': ['/bin/sh', '-c'],
|
||||
'env': [],
|
||||
'image': 'docker.io/fedora:28',
|
||||
@@ -661,7 +661,7 @@ class TestDriverOpenshift(tests.DBTestCase):
|
||||
'image': 'ubuntu:jammy',
|
||||
'imagePullPolicy': 'IfNotPresent',
|
||||
'command': ['/bin/sh', '-c'],
|
||||
'args': ['while true; do sleep 30; done;'],
|
||||
'args': ['sleep infinity'],
|
||||
}],
|
||||
})
|
||||
|
||||
|
@@ -485,7 +485,7 @@ class TestDriverOpenshiftPods(tests.DBTestCase):
|
||||
'image': 'ubuntu:jammy',
|
||||
'imagePullPolicy': 'IfNotPresent',
|
||||
'command': ['/bin/sh', '-c'],
|
||||
'args': ['while true; do sleep 30; done;'],
|
||||
'args': ['sleep infinity'],
|
||||
}],
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user