@@ -336,7 +336,7 @@ def delete_pods(pods, current, desired):
336336
337337
338338def create_pods (url , labels , base , new_pods ):
339- # Start by fetching available pods in the Namespace that fit the profile
339+ # Start by fetching available pods in the Namespace that fit the procfile
340340 # and prune down if needed, Otherwise go into the addition logic here
341341 for _ in range (new_pods ):
342342 data = base .copy ()
@@ -391,6 +391,8 @@ def upsert_pods(controller, url):
391391 # turn RC / RS (which a Deployment creates) url into pods one
392392 url = url .replace (cache_key (controller ['metadata' ]['name' ]), '' )
393393 if '_replicasets_' in url :
394+ # Try replacing both just in case one or the other exists (api backwards compatibility)
395+ url = url .replace ('_replicasets_' , '_pods' ).replace ('apis_apps_v1' , 'api_v1' ) # noqa
394396 url = url .replace ('_replicasets_' , '_pods' ).replace ('apis_extensions_v1beta1' , 'api_v1' ) # noqa
395397 else :
396398 url = url .replace ('_replicationcontrollers_' , '_pods' )
@@ -512,7 +514,9 @@ def manage_replicasets(deployment, url):
512514
513515def update_deployment_status (namespaced_url , url , deployment , rs ):
514516 # Fill out deployment.status for success as pods transition to running state
515- pod_url = namespaced_url .replace ('_replicasets' , '_pods' ).replace ('apis_extensions_v1beta1' , 'api_v1' ) # noqa
517+ pod_url = namespaced_url .replace ('_replicasets' , '_pods' ).replace ('apis_apps_v1' , 'api_v1' ) # noqa
518+ # Try replacing both just in case one or the other exists (api backwards compatibility)
519+ pod_url = pod_url .replace ('_replicasets' , '_pods' ).replace ('apis_extensions_v1beta1' , 'api_v1' ) # noqa
516520 while True :
517521 # The below needs to be done to emulate Deployment handling things
518522 # always cleanup pods
0 commit comments