platform

package
v4.0.0-...-faced96 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorPlatformNotDetected = errors.New("platform not detected")

	// SkipObjectStorePlatforms is a list of all PlatformTypes where CephObjectStores will not be deployed.
	SkipObjectStorePlatforms = []configv1.PlatformType{
		configv1.AWSPlatformType,
		configv1.GCPPlatformType,
		configv1.AzurePlatformType,
		configv1.IBMCloudPlatformType,
	}
)

Functions

func Detect

func Detect()

Detect instantiates the platform only once. It is thread-safe.

func DevicesDefaultToFastForThisPlatform

func DevicesDefaultToFastForThisPlatform() (bool, error)

DevicesDefaultToFastForThisPlatform determines whether we should TuneFastDeviceClass for this platform. It returns false if we shouldn't TuneFastDeviceClass or if platform is not yet detected.

func GetPlatformType

func GetPlatformType() (configv1.PlatformType, error)

GetPlatformType is used to get the PlatformType of the running cluster. It returns a PlatformType only when running on OpenShift clusters. If it is not running on OpenShift or platform is not yet detected, it return empty PlatformType.

func IsPlatformOpenShift

func IsPlatformOpenShift() (bool, error)

IsPlatformOpenShift returns true if platform is detected to be OpenShift. It returns false in all other cases, including when platform is not yet detected.

func IsPlatformROSAHCP

func IsPlatformROSAHCP() (bool, error)

func PlatformsShouldSkipObjectStore

func PlatformsShouldSkipObjectStore() (bool, error)

PlatformsShouldSkipObjectStore determines whether an object store should be created for the platform. It returns false if ObjectStore should not be skipped or if platform is not yet detected.

func SetFakePlatformInstanceForTesting

func SetFakePlatformInstanceForTesting(isOpenShift bool, platformType configv1.PlatformType)

SetFakePlatformInstanceForTesting can be used to fake a Platform while testing. It should only be used for testing. This is not thread-safe.

func SkipObjectStore

func SkipObjectStore(p configv1.PlatformType) bool

func UnsetFakePlatformInstanceForTesting

func UnsetFakePlatformInstanceForTesting()

UnsetFakePlatformInstanceForTesting can be used to unset the fake Platform while testing. It should only be used for testing. This is not thread-safe.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL