ocm

package
v0.1.38 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 12 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) CreateAccessRequestDecision added in v0.1.34

func (o *DefaultOCMInterfaceImpl) CreateAccessRequestDecision(ocmConnection *ocmsdk.Connection, accessRequest *acctrspv1.AccessRequest, decision acctrspv1.DecisionDecision, justification string) (*acctrspv1.Decision, error)

func (*DefaultOCMInterfaceImpl) CreateClusterAccessRequest added in v0.1.34

func (o *DefaultOCMInterfaceImpl) CreateClusterAccessRequest(ocmConnection *ocmsdk.Connection, clusterID, justification, jiraIssueID, approvalDuration string) (*acctrspv1.AccessRequest, error)

func (*DefaultOCMInterfaceImpl) GetClusterActiveAccessRequest added in v0.1.34

func (o *DefaultOCMInterfaceImpl) GetClusterActiveAccessRequest(ocmConnection *ocmsdk.Connection, clusterID string) (*acctrspv1.AccessRequest, error)

func (*DefaultOCMInterfaceImpl) GetClusterInfoByID

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

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

func (*DefaultOCMInterfaceImpl) GetClusterInfoByIDWithConn added in v0.1.31

func (o *DefaultOCMInterfaceImpl) GetClusterInfoByIDWithConn(ocmConnection *ocmsdk.Connection, clusterID string) (*cmv1.Cluster, error)

GetClusterInfoByIDWithConn 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 (o *DefaultOCMInterfaceImpl) GetOCMAccessToken() (*string, error)

GetOCMAccessToken initiates the OCM connection and returns the access token

func (*DefaultOCMInterfaceImpl) GetOCMAccessTokenWithConn added in v0.1.31

func (o *DefaultOCMInterfaceImpl) GetOCMAccessTokenWithConn(ocmConnection *ocmsdk.Connection) (*string, error)

GetOCMAccessTokenWithConn returns the access token of an ocmConnection

func (*DefaultOCMInterfaceImpl) GetOCMEnvironment added in v0.1.21

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

GetOCMEnvironment returns the Backplane API URL based on the OCM env

func (*DefaultOCMInterfaceImpl) GetPullSecret

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

GetPullSecret returns pull secret from OCM

func (*DefaultOCMInterfaceImpl) GetServiceCluster

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

GetServiceCluster gets the service cluster for a given hpyershift hosted cluster

func (*DefaultOCMInterfaceImpl) GetStsSupportJumpRoleARN

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

func (*DefaultOCMInterfaceImpl) GetTargetCluster

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

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

func (*DefaultOCMInterfaceImpl) IsClusterAccessProtectionEnabled added in v0.1.34

func (o *DefaultOCMInterfaceImpl) IsClusterAccessProtectionEnabled(ocmConnection *ocmsdk.Connection, clusterID string) (bool, error)

func (*DefaultOCMInterfaceImpl) IsClusterHibernating

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

IsClusterHibernating returns a boolean to indicate whether the cluster is hibernating

func (*DefaultOCMInterfaceImpl) IsProduction

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

IsProduction checks if OCM is currently in production env

func (*DefaultOCMInterfaceImpl) SetupOCMConnection added in v0.1.35

func (o *DefaultOCMInterfaceImpl) SetupOCMConnection() (*ocmsdk.Connection, error)

SetupOCMConnection setups the ocm connection for all the other ocm requests

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)
	GetOCMAccessTokenWithConn(ocmConnection *ocmsdk.Connection) (*string, error)
	GetClusterInfoByIDWithConn(ocmConnection *ocmsdk.Connection, clusterID string) (*cmv1.Cluster, error)
	IsClusterAccessProtectionEnabled(ocmConnection *ocmsdk.Connection, clusterID string) (bool, error)
	GetClusterActiveAccessRequest(ocmConnection *ocmsdk.Connection, clusterID string) (*acctrspv1.AccessRequest, error)
	CreateClusterAccessRequest(ocmConnection *ocmsdk.Connection, clusterID, reason, jiraIssueID, approvalDuration string) (*acctrspv1.AccessRequest, error)
	CreateAccessRequestDecision(ocmConnection *ocmsdk.Connection, accessRequest *acctrspv1.AccessRequest, decision acctrspv1.DecisionDecision, justification string) (*acctrspv1.Decision, error)
	SetupOCMConnection() (*ocmsdk.Connection, 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