mirror of
https://github.com/ansible/awx.git
synced 2026-04-14 06:29:25 -02:30
Deal with the possibility of get_default_pod_spec not finding an EE
This commit is contained in:
@@ -17,6 +17,9 @@ def get_default_execution_environment():
|
|||||||
|
|
||||||
|
|
||||||
def get_default_pod_spec():
|
def get_default_pod_spec():
|
||||||
|
ee = get_default_execution_environment()
|
||||||
|
if ee is None:
|
||||||
|
raise RuntimeError("Unable to find an execution environment.")
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
@@ -25,7 +28,7 @@ def get_default_pod_spec():
|
|||||||
"spec": {
|
"spec": {
|
||||||
"containers": [
|
"containers": [
|
||||||
{
|
{
|
||||||
"image": get_default_execution_environment().image,
|
"image": ee.image,
|
||||||
"name": 'worker',
|
"name": 'worker',
|
||||||
"args": ['ansible-runner', 'worker', '--private-data-dir=/runner'],
|
"args": ['ansible-runner', 'worker', '--private-data-dir=/runner'],
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user