Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify update_cbt function and remove --rm flag to support k8s 1.25.7 #37

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"] = \
ridaz marked this conversation as resolved.
Show resolved Hide resolved
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