Skip to content

Commit

Permalink
[MANOPD-75552] Add port replacement for registry (#150)
Browse files Browse the repository at this point in the history
* add port replacement

* add port replacement
  • Loading branch information
Yaroslav-Lahtachev authored Apr 27, 2022
1 parent 5fcc379 commit ad99c81
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions kubemarine/kubernetes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,13 @@ def patch_kubeadm_configmap(first_master, cluster):
if cluster.context.get('patch_image_repo', False):
cluster_config["imageRepository"] = cluster_config["imageRepository"].replace('/k8s.gcr.io', '')

new_image_repo_port = cluster.context.get('patch_image_repo_port', '')
old_image_repo_port = cluster.context.get('old_image_repo_port', '')
if new_image_repo_port and old_image_repo_port:
cluster_config["imageRepository"] = cluster_config["imageRepository"].replace('/k8s.gcr.io', '')
cluster_config["imageRepository"] = cluster_config["imageRepository"].replace(old_image_repo_port,
new_image_repo_port)

if version_higher_or_equal(current_kubernetes_version, version_coredns_path_breakage):
cluster_config['dns']['imageRepository'] = "%s/coredns" % cluster_config["imageRepository"]

Expand Down

0 comments on commit ad99c81

Please sign in to comment.