@@ -91,6 +91,18 @@ class BuildExecutor(LoggingConfigurable):
9191 config = True ,
9292 )
9393
94+ push_secret_content = Unicode (
95+ "" ,
96+ help = (
97+ "Content of an implementation dependent secret for pushing image to a registry. "
98+ "For example, if push tokens are temporary this can be used to pass the token "
99+ "as an environment variable CONTAINER_ENGINE_REGISTRY_CREDENTIALS to "
100+ "repo2docker."
101+ "If provided this will be used instead of push_secret."
102+ ),
103+ config = True ,
104+ )
105+
94106 memory_limit = ByteSpecification (
95107 0 ,
96108 help = "Memory limit for the build process in bytes (optional suffixes K M G T)." ,
@@ -394,7 +406,23 @@ def submit(self):
394406 )
395407 ]
396408
397- if self .push_secret :
409+ env = [
410+ client .V1EnvVar (name = key , value = value )
411+ for key , value in self .extra_envs .items ()
412+ ]
413+ if self .git_credentials :
414+ env .append (
415+ client .V1EnvVar (name = "GIT_CREDENTIAL_ENV" , value = self .git_credentials )
416+ )
417+
418+ if self .push_secret_content :
419+ env .append (
420+ client .V1EnvVar (
421+ name = "CONTAINER_ENGINE_REGISTRY_CREDENTIALS" ,
422+ value = self .push_secret_content ,
423+ )
424+ )
425+ elif self .push_secret :
398426 volume_mounts .append (
399427 client .V1VolumeMount (mount_path = "/root/.docker" , name = "docker-config" )
400428 )
@@ -405,15 +433,6 @@ def submit(self):
405433 )
406434 )
407435
408- env = [
409- client .V1EnvVar (name = key , value = value )
410- for key , value in self .extra_envs .items ()
411- ]
412- if self .git_credentials :
413- env .append (
414- client .V1EnvVar (name = "GIT_CREDENTIAL_ENV" , value = self .git_credentials )
415- )
416-
417436 self .pod = client .V1Pod (
418437 metadata = client .V1ObjectMeta (
419438 name = self .name ,
0 commit comments