ocm

package
v0.1.30 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ClustersPageSize = 50
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultOCMInterfaceImpl

type DefaultOCMInterfaceImpl struct{}

func (*DefaultOCMInterfaceImpl) GetClusterInfoByID

func (*DefaultOCMInterfaceImpl) GetClusterInfoByID(clusterID string) (*cmv1.Cluster, error)

GetClusterInfoByID calls the OCM to retrieve the cluster info for a given internal cluster id.

func (*DefaultOCMInterfaceImpl) GetManagingCluster

func (o *DefaultOCMInterfaceImpl) GetManagingCluster(targetClusterID string) (clusterID, clusterName string, isHostedControlPlane bool, err error)

GetManagingCluster returns the managing cluster (hive shard or hypershift management cluster) for the given clusterID

func (*DefaultOCMInterfaceImpl) GetOCMAccessToken

func (*DefaultOCMInterfaceImpl) GetOCMAccessToken() (*string, error)

GetOCMAccessToken initiates the OCM connection and returns the access token

func (*DefaultOCMInterfaceImpl) GetOCMEnvironment added in v0.1.21

func (*DefaultOCMInterfaceImpl) GetOCMEnvironment() (*cmv1.Environment, error)

GetBackplaneURL returns the Backplane API URL based on the OCM env

func (*DefaultOCMInterfaceImpl) GetPullSecret

func (*DefaultOCMInterfaceImpl) GetPullSecret() (string, error)

GetPullSecret returns pull secret from OCM

func (*DefaultOCMInterfaceImpl) GetServiceCluster

func (*DefaultOCMInterfaceImpl) GetServiceCluster(targetClusterID string) (clusterID, clusterName string, err error)

GetServiceCluster gets the service cluster for a given hpyershift hosted cluster

func (*DefaultOCMInterfaceImpl) GetStsSupportJumpRoleARN

func (*DefaultOCMInterfaceImpl) GetStsSupportJumpRoleARN(ocmConnection *ocmsdk.Connection, clusterID string) (string, error)

func (*DefaultOCMInterfaceImpl) GetTargetCluster

func (*DefaultOCMInterfaceImpl) GetTargetCluster(clusterKey string) (clusterID, clusterName string, err error)

GetTargetCluster returns one single cluster based on the search key and survery.

func (*DefaultOCMInterfaceImpl) IsClusterHibernating

func (*DefaultOCMInterfaceImpl) IsClusterHibernating(clusterID string) (bool, error)

IsClusterHibernating returns a boolean to indicate whether the cluster is hibernating

func (*DefaultOCMInterfaceImpl) IsProduction

func (*DefaultOCMInterfaceImpl) IsProduction() (bool, error)

IsProduction checks if OCM is currently in production env

type OCMInterface

type OCMInterface interface {
	IsClusterHibernating(clusterID string) (bool, error)
	GetTargetCluster(clusterKey string) (clusterID, clusterName string, err error)
	GetManagingCluster(clusterKey string) (clusterID, clusterName string, isHostedControlPlane bool, err error)
	GetOCMAccessToken() (*string, error)
	GetServiceCluster(clusterKey string) (clusterID, clusterName string, err error)
	GetClusterInfoByID(clusterID string) (*cmv1.Cluster, error)
	IsProduction() (bool, error)
	GetPullSecret() (string, error)
	GetStsSupportJumpRoleARN(ocmConnection *ocmsdk.Connection, clusterID string) (string, error)
	GetOCMEnvironment() (*cmv1.Environment, error)
}
var DefaultOCMInterface OCMInterface = &DefaultOCMInterfaceImpl{}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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