Skip to content

Commit

Permalink
Merge pull request #37 from ridaz/topic/ridaz/update-cbt-rm-flag
Browse files Browse the repository at this point in the history
Modify update_cbt function and remove --rm flag to support k8s 1.25.7
  • Loading branch information
DimpleRajaVamsi authored Jun 12, 2023
2 parents 226b8e6 + 605b104 commit 9bf40ac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ansible/files/scripts/image_retag.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class localRegistry():
def __init__(self, dockerVersion):
self.dockerVersion = dockerVersion
self.ctrPrefix = "ctr -n k8s.io "
self.ctrRunOptions = "run -d --null-io --net-host --rm "
self.ctrRunOptions = "run -d --null-io --net-host "

self.registryImage = f"docker.io/vmware/docker-registry:{self.dockerVersion}"

Expand Down
2 changes: 1 addition & 1 deletion ansible/tasks/retag_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
executable: python3

- name: Start docker registry
shell: 'ctr -n k8s.io run -d --null-io --net-host --rm --mount type=bind,src=/storage/container-registry,dst=/var/lib/registry,options=rbind:rw docker.io/vmware/docker-registry:2.7.1 docker-registry /bin/registry serve /etc/docker/registry/config.yaml'
shell: 'ctr -n k8s.io run -d --null-io --net-host --mount type=bind,src=/storage/container-registry,dst=/var/lib/registry,options=rbind:rw docker.io/vmware/docker-registry:2.7.1 docker-registry /bin/registry serve /etc/docker/registry/config.yaml'

- name: Copy carvel packages and images to Embedded registry
script: files/scripts/utkg_download_carvel_packages.py --addonImageList {{ addon_image_list }} --addonLocalImageList {{ localhost_addon_image_list }}
Expand Down
7 changes: 4 additions & 3 deletions scripts/tkg_byoi.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,10 @@ def update_cbt(cbt_file, cbt_name, old_tkr_name, new_tkr_name):
cbt_data["spec"][addon]["valuesFrom"]["providerRef"]["name"].replace(old_tkr_name, new_tkr_name)
for index in range(len(cbt_data["spec"]["additionalPackages"])):
if "valuesFrom" in cbt_data["spec"]["additionalPackages"][index]:
cbt_data["spec"]["additionalPackages"][index]["valuesFrom"]["secretRef"] = \
cbt_data["spec"]["additionalPackages"][index]["valuesFrom"]["secretRef"].replace(old_tkr_name,
new_tkr_name)
if "secretRef" in cbt_data["spec"]["additionalPackages"][index]["valuesFrom"]:
cbt_data["spec"]["additionalPackages"][index]["valuesFrom"]["secretRef"] = \
cbt_data["spec"]["additionalPackages"][index]["valuesFrom"]["secretRef"].replace(old_tkr_name,
new_tkr_name)
with open(cbt_file, 'w') as fp:
yaml.dump(cbt_data, fp)
print("New CBT Name:", cbt_name)
Expand Down

0 comments on commit 9bf40ac

Please sign in to comment.