Skip to content

Commit

Permalink
fix: to make the unset env variable in CSV work with fallback (#1306)
Browse files Browse the repository at this point in the history
- previous code, will run into opendathaub case if env is not set

Signed-off-by: Wen Zhou <[email protected]>
  • Loading branch information
zdtsw authored Oct 17, 2024
1 parent 12fd9e5 commit 0c16075
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/cluster/cluster_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,14 @@ func detectManagedRHODS(ctx context.Context, cli client.Client) (Platform, error

func getPlatform(ctx context.Context, cli client.Client) (Platform, error) {
switch os.Getenv("ODH_PLATFORM_TYPE") {
case "OpenDataHub", "":
case "OpenDataHub":
return OpenDataHub, nil
case "ManagedRHOAI":
return ManagedRhods, nil
case "SelfManagedRHOAI":
return SelfManagedRhods, nil
default: // fall back to detect platform if ODH_PLATFORM_TYPE env is not provided
default:
// fall back to detect platform if ODH_PLATFORM_TYPE env is not provided in CSV or set to ""
if platform, err := detectManagedRHODS(ctx, cli); err != nil {
return Unknown, err
} else if platform == ManagedRhods {
Expand Down

0 comments on commit 0c16075

Please sign in to comment.