Fix label to never allow a space (which breaks Kubernetes)
This commit is contained in:
parent
811413fe9c
commit
3d4af78f01
1 changed files with 6 additions and 2 deletions
|
@ -325,6 +325,10 @@ class KubernetesExecutor(BuilderExecutor):
|
||||||
'cpu' : self.executor_config.get('CONTAINER_CPU_REQUEST', "2"),
|
'cpu' : self.executor_config.get('CONTAINER_CPU_REQUEST', "2"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
release_sha = release.GIT_HEAD or 'none'
|
||||||
|
if ' ' in release_sha:
|
||||||
|
release_sha = 'HEAD'
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'apiVersion': 'batch/v1',
|
'apiVersion': 'batch/v1',
|
||||||
'kind': 'Job',
|
'kind': 'Job',
|
||||||
|
@ -335,7 +339,7 @@ class KubernetesExecutor(BuilderExecutor):
|
||||||
'build': build_uuid,
|
'build': build_uuid,
|
||||||
'time': datetime.datetime.now().strftime('%Y-%m-%d-%H'),
|
'time': datetime.datetime.now().strftime('%Y-%m-%d-%H'),
|
||||||
'manager': socket.gethostname(),
|
'manager': socket.gethostname(),
|
||||||
'quay-sha': release.GIT_HEAD or 'none',
|
'quay-sha': release_sha,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'spec' : {
|
'spec' : {
|
||||||
|
@ -346,7 +350,7 @@ class KubernetesExecutor(BuilderExecutor):
|
||||||
'build': build_uuid,
|
'build': build_uuid,
|
||||||
'time': datetime.datetime.now().strftime('%Y-%m-%d-%H'),
|
'time': datetime.datetime.now().strftime('%Y-%m-%d-%H'),
|
||||||
'manager': socket.gethostname(),
|
'manager': socket.gethostname(),
|
||||||
'quay-sha': release.GIT_HEAD or 'none',
|
'quay-sha': release_sha,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'spec': {
|
'spec': {
|
||||||
|
|
Reference in a new issue