Skip to content

Commit

Permalink
Merge pull request #1426 from ErikJiang/clean_unuse_logs
Browse files Browse the repository at this point in the history
clear redundant log info
  • Loading branch information
ErikJiang authored Dec 5, 2024
2 parents b706e82 + 4a9c2e3 commit 349f8c8
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion artifacts/gen_airgap_pkgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function create_images() {
target_image_name=${target_image_name/k8s.m.daocloud.io/registry.k8s.io}
target_image_name=${target_image_name/quay.m.daocloud.io/quay.io}
ret=0
skopeo copy --insecure-policy --retry-times=3 --override-os linux --override-arch ${ARCH} "docker://$image_name" "oci:offline-images:$target_image_name" || ret=$?
skopeo copy --insecure-policy --quiet --retry-times=3 --override-os linux --override-arch ${ARCH} "docker://$image_name" "oci:offline-images:$target_image_name" || ret=$?
if [ ${ret} -ne 0 ]; then
echo "skopeo copy image failed, image name: ${image_name}."
exit 1
Expand Down
6 changes: 5 additions & 1 deletion artifacts/import_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ function import_files() {
fi

for dirName in offline-files/*; do
mc cp --no-color --recursive "$dirName" "kubeaniominioserver/kubean/"
stderr=$(mc cp --quiet --no-color --recursive "$dirName" "kubeaniominioserver/kubean/" 2>&1 > /dev/null)
if [[ -n "${stderr}" ]]; then
echo "error: ${stderr}"
exit 1
fi
done

}
Expand Down
4 changes: 2 additions & 2 deletions artifacts/import_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function image::merge_multi_arch() {

### Push {registry_address}/{image_name}:{tag}-{target_arch} to registry.
image::log_info "import image from ${copy_args} to ${target_image_name}"
skopeo copy --insecure-policy --retry-times=3 --src-tls-verify=false --dest-tls-verify=false \
skopeo copy --insecure-policy --quiet --retry-times=3 --src-tls-verify=false --dest-tls-verify=false \
"${copy_args}" docker://"${target_image_name}" >/dev/null
if [[ $? -ne 0 ]]; then
image::log_warn "skopeo copy ${copy_args} failed!"
Expand Down Expand Up @@ -69,7 +69,7 @@ function image::merge_multi_arch() {
local origin_arch=$(podman manifest inspect "${manifest_list_name}" | awk -F: '/"architecture"/ {print $2}' | sed 's/[", ]//g')
if [[ "${origin_arch}" != "${TARGET_ARCH}" ]]; then
image::log_info "image retag from ${src_image_name} to ${src_image_name}-${origin_arch}"
skopeo copy --insecure-policy --retry-times=3 --src-tls-verify=false --dest-tls-verify=false \
skopeo copy --insecure-policy --quiet --retry-times=3 --src-tls-verify=false --dest-tls-verify=false \
docker://"${src_image_name}" docker://"${src_image_name}-${origin_arch}" >/dev/null
podman manifest create --amend "${manifest_list_name}" "${src_image_name}-${origin_arch}"
fi
Expand Down
7 changes: 6 additions & 1 deletion artifacts/import_iso.sh
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,12 @@ function iso::import_data() {
cp -vr "${path_name}" "${target_path}/${minio_server_path}"
else
## "/mnt/kubean-temp-iso/Pkgs" => "kubeaniominioserver/kubean/centos-dvd/7/os/x86_64/"
mc cp --no-color --recursive "${path_name}" "${minio_files_path}"
stderr=$(mc cp --quiet --no-color --recursive "${path_name}" "${minio_files_path}" 2>&1 > /dev/null)
if [[ -n "${stderr}" ]]; then
echo "error: ${stderr}"
exit 1
fi

if [ "${path_name}" == "${iso_mnt_path}/dists" ]; then
mc rm --no-color ${minio_files_path}/dists/$(dir --hide=*stable ${path_name})/Release ${minio_files_path}/dists/$(dir --hide=*stable ${path_name})/Release.gpg
fi
Expand Down
6 changes: 5 additions & 1 deletion artifacts/import_ospkgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ function import_os_packages() {
tar -xvf "$TAR_GZ_FILE_PATH" ## got resources folder

for dirName in resources/*; do
mc cp --no-color --recursive "$dirName" "kubeaniominioserver/kubean/"
stderr=$(mc cp --quiet --no-color --recursive "$dirName" "kubeaniominioserver/kubean/" 2>&1 > /dev/null)
if [[ -n "${stderr}" ]]; then
echo "error: ${stderr}"
exit 1
fi
done
}

Expand Down
2 changes: 1 addition & 1 deletion examples/debug/airgap_demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function batch_sync_images() {
local registry=$1
local images=$2
for image_item in ${images}; do
skopeo copy --insecure-policy -a --dest-tls-verify=false --retry-times=3 "docker://${image_item}" "docker://${registry}/${image_item}"
skopeo copy --insecure-policy -a --quiet --dest-tls-verify=false --retry-times=3 "docker://${image_item}" "docker://${registry}/${image_item}"
done
}

Expand Down
2 changes: 1 addition & 1 deletion hack/offline-util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function util::init_kylin_vm_template_map(){
function util::scope_copy_test_images(){
dest_registry_addr=${1}
image_name=${2:-""}
skopeo_cmd="skopeo copy --insecure-policy --src-tls-verify=false --dest-tls-verify=false "
skopeo_cmd="skopeo copy --insecure-policy --quiet --src-tls-verify=false --dest-tls-verify=false "
if [ "${image_name}" != "" ]; then
echo "skopeo copy image to registry: ${image_name}"
${skopeo_cmd} docker://"${image_name}" docker://"${dest_registry_addr}"/test/"${image_name}"
Expand Down

0 comments on commit 349f8c8

Please sign in to comment.