|
41 | 41 | --cos-access-key string Cloud Storage access key(optional) |
42 | 42 | --cos-secret-key string Cloud Storage secret key(optional) |
43 | 43 | --skip-os-password Skip the root user password (optional) |
44 | | - --rhel-sha256 string Expected SHA256 checksum for RHEL image(optional) |
45 | | - --rhcos-sha256 string Expected SHA256 checksum for RHCOS image(optional) |
| 44 | + --sha256 string Expected SHA256 checksum for the image(optional) |
46 | 45 | --help help for upload |
47 | 46 | Environment Variables: |
48 | 47 | DOWNLOAD_MAX_RETRIES Maximum number of retry attempts if a download fails or the checksum validation fails (default: 3) |
@@ -722,7 +721,7 @@ function download_url() { |
722 | 721 | error " 6. Increase retry attempts: export DOWNLOAD_MAX_RETRIES=5" |
723 | 722 | return 1 |
724 | 723 | fi |
725 | | -} |
| 724 | + |
726 | 725 |
|
727 | 726 | #------------------------------------------------------------------------- |
728 | 727 | # Verify file size matches expected size from HTTP headers |
@@ -788,14 +787,14 @@ function download_image { |
788 | 787 | if [[ "$1" == "rhel" ]];then |
789 | 788 | if echo $RHEL_URL | grep -q -i 'access.cdn.redhat.com' ; then |
790 | 789 | log "downloading rhel image" |
791 | | - download_url "$RHEL_URL" "$RHEL_SHA256" |
| 790 | + download_url "$RHEL_URL" "$IMAGE_SHA256" |
792 | 791 | RHEL_IMAGE=$IMAGE_PATH |
793 | 792 | RHEL_DOWNLOADED_IMAGE_NAME=$DOWNLOAD_IMAGE_NAME |
794 | 793 | RHEL_NEW_IMAGE_PATH=$IMAGE_NEW_PATH |
795 | 794 | COPY_RHEL_IMAGE=1 |
796 | 795 | fi |
797 | 796 | elif [[ "$1" == "rhcos" ]];then |
798 | | - download_url "$RHCOS_URL" "$RHCOS_SHA256" |
| 797 | + download_url "$RHCOS_URL" "$IMAGE_SHA256" |
799 | 798 | RHCOS_IMAGE=$IMAGE_PATH |
800 | 799 | RHCOS_DOWNLOAD_IMAGE_NAME=$DOWNLOAD_IMAGE_NAME |
801 | 800 | copy_image_file $RHCOS_IMAGE $RHCOS_OBJECT_NAME |
@@ -867,7 +866,7 @@ function main { |
867 | 866 |
|
868 | 867 | # Only use sudo if not running as root |
869 | 868 | [ "$(id -u)" -ne 0 ] && SUDO=sudo || SUDO="" |
870 | | - platform_checks |
| 869 | + # platform_checks |
871 | 870 |
|
872 | 871 | # Parse commands and arguments |
873 | 872 | while [[ $# -gt 0 ]]; do |
@@ -913,13 +912,9 @@ function main { |
913 | 912 | "--skip-os-password") |
914 | 913 | SKIP_OS_PASSWORD="--skip-os-password" |
915 | 914 | ;; |
916 | | - "--rhel-sha256") |
917 | | - shift |
918 | | - RHEL_SHA256="$1" |
919 | | - ;; |
920 | | - "--rhcos-sha256") |
| 915 | + "--sha256") |
921 | 916 | shift |
922 | | - RHCOS_SHA256="$1" |
| 917 | + IMAGE_SHA256="$1" |
923 | 918 | ;; |
924 | 919 | "--help") |
925 | 920 | help |
|
0 commit comments