longhorn / longhorn

Cloud-Native distributed storage built on and for Kubernetes
https://longhorn.io
Apache License 2.0
6.14k stars 603 forks source link

[TEST] Develop a script to generate Longhorn YAML with version replacement #9512

Open roger-ryao opened 1 month ago

roger-ryao commented 1 month ago

What's the test to develop? Please describe

We need to automate the process of generating and customizing Longhorn YAML configuration files based on specific Longhorn versions. The goal is to download the Longhorn YAML for a given version, replace the image tags for various components with new versions (e.g., longhorn-ui, longhorn-manager, longhorn-engine, etc.), and then save the updated YAML file with a dynamically generated filename based on the version number (e.g., longhorn-v1.7.x-head.yaml, longhorn-v1.8.0-dev-20240922.yaml).

Describe the tasks for the test

> ./update_LH_ver_with_download.sh 

Usage: ./update_LH_ver_with_download.sh <old_version> <new_version> <longhorn_version>

Arguments:
  <old_version>       The version of Longhorn images to be replaced (e.g., v1.6.3, v1.7.1).
  <new_version>       The new version of Longhorn images to use (e.g., v1.6.3-dev-20240922, v1.7.x-head).
  <longhorn_version>  The branch or tag from which to download the Longhorn YAML file.

  Examples:

    # For downloading longhorn.yaml from the v1.6.x branch
    ./update_LH_ver_with_download.sh v1.6.3 v1.6.3-dev-20240922 v1.6.x

    # For downloading longhorn.yaml from the v1.7.x branch
    ./update_LH_ver_with_download.sh v1.7.1 v1.7.x-head v1.7.x

    # For downloading longhorn.yaml from the master branch
    ./update_LH_ver_with_download.sh master-head v1.8.0-dev-20240922 master

Additional context

N/A

longhorn-io-github-bot commented 1 month ago

Pre Ready-For-Testing Checklist