mirror of
https://github.com/hanzo-ml/kuberay.git
synced 2026-10-30 19:48:47 +00:00
* Add KuberayTestArch environment variable for architecture override in tests This commit introduces a new environment variable KuberayTestArch that allows overriding the detected architecture in test environments. Previously, the system only relied on runtime.GOARCH to determine if ARM64 architecture was being used, but this change enables explicit architecture specification through the environment variable. This is particularly useful for testing scenarios where you want to force a specific architecture regardless of the actual runtime environment, improving test flexibility and consistency across different platforms. Signed-off-by: KunWuLuan <[email protected]> * update Signed-off-by: Future-Outlier <[email protected]> --------- Signed-off-by: KunWuLuan <[email protected]> Signed-off-by: Future-Outlier <[email protected]> Co-authored-by: Future-Outlier <[email protected]>
38 lines
892 B
Go
38 lines
892 B
Go
package support
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
const (
|
|
// KuberayTestOutputDir is the testing output directory, to write output files into.
|
|
KuberayTestOutputDir = "KUBERAY_TEST_OUTPUT_DIR"
|
|
|
|
// KuberayTestRayVersion is the version of Ray to use for testing.
|
|
KuberayTestRayVersion = "KUBERAY_TEST_RAY_VERSION"
|
|
|
|
// KuberayTestRayImage is the Ray image to use for testing.
|
|
KuberayTestRayImage = "KUBERAY_TEST_RAY_IMAGE"
|
|
|
|
KuberayTestUpgradeImage = "KUBERAY_TEST_UPGRADE_IMAGE"
|
|
)
|
|
|
|
func GetRayVersion() string {
|
|
return lookupEnvOrDefault(KuberayTestRayVersion, RayVersion)
|
|
}
|
|
|
|
func GetRayImage() string {
|
|
return lookupEnvOrDefault(KuberayTestRayImage, RayImage)
|
|
}
|
|
|
|
func GetKubeRayUpgradeVersion() string {
|
|
return lookupEnvOrDefault(KuberayTestUpgradeImage, KuberayUpgradeVersion)
|
|
}
|
|
|
|
func lookupEnvOrDefault(key, value string) string {
|
|
if v, ok := os.LookupEnv(key); ok {
|
|
return v
|
|
}
|
|
return value
|
|
}
|