Skip to content

Commit

Permalink
Merge pull request #1138 from ErikJiang/fix_empty_images
Browse files Browse the repository at this point in the history
fix empty images list file
  • Loading branch information
ErikJiang authored Feb 27, 2024
2 parents 4652dfc + a326a18 commit 77eeece
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion artifacts/airgap_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"cilium_version": ['cilium'],
"etcd_version": ['etcd'],
"pod_infra_version": ['pause'],
"runc_version": ['runc'],
}

def file_lines_to_list(filename):
Expand Down Expand Up @@ -146,7 +147,7 @@ def get_manifest_data():

def get_other_required_keywords(manifest_dict):
other_required_keywords = [
"runc", "crun", "runsc", "cri-dockerd", "yq", "nginx", "k8s-dns-node-cache", "cluster-proportional-autoscaler"]
"crun", "runsc", "cri-dockerd", "yq", "nginx", "k8s-dns-node-cache", "cluster-proportional-autoscaler"]
manifest_keys = [ key for key in manifest_dict]
keys_range = [ key for key in KEYWORDS]
list_diff = list(set(keys_range) - set(manifest_keys))
Expand Down
11 changes: 10 additions & 1 deletion artifacts/gen_airgap_pkgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,17 @@ function create_images() {
fi

echo "begin to download images."

local images_list_path="${CURRENT_DIR}/kubespray/contrib/offline/temp/images.list"
local images_list_content
images_list_content=$(cat "${CURRENT_DIR}/kubespray/contrib/offline/temp/images.list")

sed -i '/^$/d' "${images_list_path}"

if [[ ! -s "${images_list_path}" ]]; then
echo "images.list is empty"
return
fi
images_list_content=$(cat "${images_list_path}")

rm -rf offline-images && mkdir offline-images

Expand Down

0 comments on commit 77eeece

Please sign in to comment.