Skip to content

Commit

Permalink
fix: to make the unset env variable in CSV work with fallback (red-ha…
Browse files Browse the repository at this point in the history
…t-data-services#1306)

- previous code, will run into opendathaub case if env is not set

Signed-off-by: Wen Zhou <[email protected]>
(cherry picked from commit 0c16075)
  • Loading branch information
zdtsw committed Oct 17, 2024
1 parent 0ae34ee commit 77b5228
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 @@ -118,13 +118,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 77b5228

Please sign in to comment.