Skip to content

Conversation

@cuisongliu
Copy link
Collaborator

This pull request refactors the image pulling and saving logic in deploy/cloud/init.sh to make it more maintainable and scalable. Instead of listing each image and its tar file individually, the script now uses an associative array to manage image-to-tar mappings and loops over them to perform the operations. This reduces code duplication and makes it easier to add or modify images in the future.

Refactoring and maintainability improvements:

  • Replaced multiple individual retryPullImage and sealos save calls with a single associative array (images) mapping image names to their respective tar files, streamlining the process.
  • Added a loop to iterate over the array, pulling each image and saving it to the correct location, which simplifies future updates and reduces the risk of errors.
  • Ensured the tars directory is created before saving images, improving robustness.

@cuisongliu cuisongliu requested a review from a team as a code owner August 25, 2025 10:09
@cuisongliu cuisongliu added this to the v5.1 milestone Aug 25, 2025
@bxy4543 bxy4543 merged commit 56730df into labring:main Aug 25, 2025
15 of 16 checks passed
@cuisongliu cuisongliu deleted the fix-save-tars branch August 25, 2025 10:14
Zllinc pushed a commit to Zllinc/sealos that referenced this pull request Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants