@@ -97,7 +97,7 @@ def get_image_path(image):
97
97
"""
98
98
This function returns the image path
99
99
"""
100
- return image .split ('/' , 1 )[1 ]
100
+ return 'openshift/' + image .split ('/' , 1 )[ 1 ]. split ( '/' , 1 )[1 ]
101
101
102
102
def get_user_password_from_file (file_name ):
103
103
"""
@@ -128,7 +128,11 @@ def launch_node_commands(node, api_server, args):
128
128
send_pexpect_command (child , '\n ' , '#' )
129
129
send_pexpect_command (child , 'oc login -u kubeadmin -p ' + args .cluster_password +
130
130
' ' + api_server , ': ' )
131
- send_pexpect_command (child , '\n ' , '#' )
131
+ index = child .expect ([":" , "#" , pexpect .TIMEOUT ])
132
+ if index == 0 :
133
+ send_pexpect_command (child , 'yes' , '#' )
134
+ else :
135
+ send_pexpect_command (child , '\n ' , '#' )
132
136
send_pexpect_command (child , 'podman login -u kubeadmin -p $(oc whoami -t) ' +
133
137
LOCAL_REGISTRY , '#' )
134
138
send_pexpect_command (child , 'echo' , '#' )
@@ -140,6 +144,7 @@ def launch_node_commands(node, api_server, args):
140
144
send_pexpect_command (child , 'podman tag ' + args .original_image + ' ' + LOCAL_REGISTRY +
141
145
'/' + get_image_path (args .original_image ), '#' )
142
146
send_pexpect_command (child , 'podman images | grep ' + LOCAL_REGISTRY , '#' )
147
+ send_pexpect_command (child , 'podman push ' + LOCAL_REGISTRY + '/' + get_image_path (args .original_image ), '#' )
143
148
send_pexpect_command (child , 'exit' , '#' )
144
149
sys .stdout .flush ()
145
150
child .close ()
0 commit comments