utils

package
v0.0.0-...-b411720 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	KserveConfigMapName            = "inferenceservice-config"
	KServeWithServiceMeshComponent = "kserve-service-mesh"
)

Variables

View Source
var GVK = struct {
	DataScienceClusterInitialization,
	DataScienceCluster schema.GroupVersionKind
}{
	DataScienceCluster: schema.GroupVersionKind{
		Group:   "datasciencecluster.opendatahub.io",
		Version: "v1",
		Kind:    "DataScienceCluster",
	},
	DataScienceClusterInitialization: schema.GroupVersionKind{
		Group:   "dscinitialization.opendatahub.io",
		Version: "v1",
		Kind:    "DSCInitialization",
	},
}

GVK is a struct that holds the GroupVersionKind for resources we don't have direct dependency on (by means of golang API) but we still want to interact with them e.g. through unstructured objects.

Functions

func AuthorinoEnabledWhenOperatorNotMissing

func AuthorinoEnabledWhenOperatorNotMissing(_, reason string) bool

AuthorinoEnabledWhenOperatorNotMissing is a helper function to check if Authorino is enabled when the Operator is not missing. This is defined by Condition.Reason=MissingOperator. In any other case, it is assumed that Authorino is enabled but DSC might not be in the Ready state and will reconcile.

func ConvertToStructuredResource

func ConvertToStructuredResource(yamlContent []byte, out runtime.Object) error

func ConvertToUnstructuredResource

func ConvertToUnstructuredResource(yamlContent []byte, out *unstructured.Unstructured) error

func IsNil

func IsNil(i any) bool

func IsNotNil

func IsNotNil(i any) bool

func RegisterSchemes

func RegisterSchemes(s *runtime.Scheme)

RegisterSchemes adds schemes of used resources to controller's scheme.

func VerifyIfCapabilityIsEnabled

func VerifyIfCapabilityIsEnabled(ctx context.Context, cli client.Client, capabilityName string, enabledWhen func(status, reason string) bool) (bool, error)

VerifyIfCapabilityIsEnabled checks if given DSCI capability is enabled. It only fails if client call to fetch DSCI fails. In other cases it assumes capability is not enabled.

func VerifyIfComponentIsEnabled

func VerifyIfComponentIsEnabled(ctx context.Context, cli client.Client, componentName string) (bool, error)

VerifyIfComponentIsEnabled will query the DCS in the cluster and see if the desired componentName is enabled

Types

type IsvcDeploymentMode

type IsvcDeploymentMode string
var (
	Serverless    IsvcDeploymentMode = "Serverless"
	RawDeployment IsvcDeploymentMode = "RawDeployment"
	ModelMesh     IsvcDeploymentMode = "ModelMesh"
)

Jump to

Keyboard shortcuts

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