clusters

package
v0.0.0-...-9b598c7 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterNamePrefix = "mk-"
)

ClusterNamePrefix a prefix used for new OCM cluster names

Variables

View Source
var (
	// AMS quota filters
	AMSQuotaAddonResourceNamePrefix        = "addon"
	AMSQuotaOSDProductName          string = "OSD"
	AMSQuotaComputeNodeResourceType string = "compute.node"
	AMSQuotaClusterResourceType     string = "cluster"
)

Functions

func StrimziOperatorCommonLabels

func StrimziOperatorCommonLabels() map[string]string

Types

type ClusterBuilder

type ClusterBuilder interface {
	// NewOCMClusterFromCluster create an OCM cluster definition that can be used to create a new cluster with the OCM
	// Cluster Service.
	NewOCMClusterFromCluster(clusterRequest *types.ClusterRequest) (*clustersmgmtv1.Cluster, error)
}

NOTE: the current mock generation exports to a _test file, if in the future this should be made public, consider moving the type into a ocmtest package. ClusterBuilder wrapper for the OCM-specific builder struct, to allow for mocking.

func NewClusterBuilder

func NewClusterBuilder(awsConfig *config.AWSConfig, gcpConfig *config.GCPConfig, dataplaneClusterConfig *config.DataplaneClusterConfig) ClusterBuilder

NewClusterBuilder create a new default implementation of ClusterBuilder.

type ClusterBuilderMock

type ClusterBuilderMock struct {
	// NewOCMClusterFromClusterFunc mocks the NewOCMClusterFromCluster method.
	NewOCMClusterFromClusterFunc func(clusterRequest *types.ClusterRequest) (*clustersmgmtv1.Cluster, error)
	// contains filtered or unexported fields
}

ClusterBuilderMock is a mock implementation of ClusterBuilder.

func TestSomethingThatUsesClusterBuilder(t *testing.T) {

	// make and configure a mocked ClusterBuilder
	mockedClusterBuilder := &ClusterBuilderMock{
		NewOCMClusterFromClusterFunc: func(clusterRequest *types.ClusterRequest) (*clustersmgmtv1.Cluster, error) {
			panic("mock out the NewOCMClusterFromCluster method")
		},
	}

	// use mockedClusterBuilder in code that requires ClusterBuilder
	// and then make assertions.

}

func (*ClusterBuilderMock) NewOCMClusterFromCluster

func (mock *ClusterBuilderMock) NewOCMClusterFromCluster(clusterRequest *types.ClusterRequest) (*clustersmgmtv1.Cluster, error)

NewOCMClusterFromCluster calls NewOCMClusterFromClusterFunc.

func (*ClusterBuilderMock) NewOCMClusterFromClusterCalls

func (mock *ClusterBuilderMock) NewOCMClusterFromClusterCalls() []struct {
	ClusterRequest *types.ClusterRequest
}

NewOCMClusterFromClusterCalls gets all the calls that were made to NewOCMClusterFromCluster. Check the length with:

len(mockedClusterBuilder.NewOCMClusterFromClusterCalls())

type DefaultProviderFactory

type DefaultProviderFactory struct {
	// contains filtered or unexported fields
}

DefaultProviderFactory the default implementation for ProviderFactory

func NewDefaultProviderFactory

func NewDefaultProviderFactory(
	ocmClient ocm.ClusterManagementClient,
	connectionFactory *db.ConnectionFactory,
	ocmConfig *ocm.OCMConfig,
	awsConfig *config.AWSConfig,
	gcpConfig *config.GCPConfig,
	dataplaneClusterConfig *config.DataplaneClusterConfig,
) *DefaultProviderFactory

func (*DefaultProviderFactory) GetProvider

func (d *DefaultProviderFactory) GetProvider(providerType api.ClusterProviderType) (Provider, error)

type OCMProvider

type OCMProvider struct {
	// contains filtered or unexported fields
}

func (*OCMProvider) AddIdentityProvider

func (o *OCMProvider) AddIdentityProvider(clusterSpec *types.ClusterSpec, identityProviderInfo types.IdentityProviderInfo) (*types.IdentityProviderInfo, error)

func (*OCMProvider) ApplyResources

func (o *OCMProvider) ApplyResources(clusterSpec *types.ClusterSpec, resources types.ResourceSet) (*types.ResourceSet, error)

func (*OCMProvider) CheckClusterStatus

func (o *OCMProvider) CheckClusterStatus(spec *types.ClusterSpec) (*types.ClusterSpec, error)

func (*OCMProvider) CheckIfOrganizationIsTheClusterOwner

func (o *OCMProvider) CheckIfOrganizationIsTheClusterOwner(externalOrganizationID, clusterID, clusterExternalID string) error

func (*OCMProvider) Create

func (o *OCMProvider) Create(request *types.ClusterRequest) (*types.ClusterSpec, error)

func (*OCMProvider) CreateMachinePool

func (o *OCMProvider) CreateMachinePool(request *types.MachinePoolRequest) (*types.MachinePoolRequest, error)

func (*OCMProvider) Delete

func (o *OCMProvider) Delete(spec *types.ClusterSpec) (bool, error)

func (*OCMProvider) GetCloudProviderRegions

func (o *OCMProvider) GetCloudProviderRegions(providerInfo types.CloudProviderInfo) (*types.CloudProviderRegionInfoList, error)

func (*OCMProvider) GetCloudProviders

func (o *OCMProvider) GetCloudProviders() (*types.CloudProviderInfoList, error)

func (*OCMProvider) GetClusterDNS

func (o *OCMProvider) GetClusterDNS(clusterSpec *types.ClusterSpec) (string, error)

func (*OCMProvider) GetClusterResourceQuotaCosts

func (o *OCMProvider) GetClusterResourceQuotaCosts() ([]types.QuotaCost, error)

GetClusterResourceQuotaCosts returns a list of quota cost information related to ocm resources used for the provisioning and terraforming of data plane clusters for the authenticated user.

Returns a nil slice when no ocm resource quota is assigned to the user

func (*OCMProvider) GetClusterSpec

func (o *OCMProvider) GetClusterSpec(clusterID string) (types.ClusterSpec, error)

func (*OCMProvider) GetMachinePool

func (o *OCMProvider) GetMachinePool(clusterID string, id string) (*types.MachinePoolInfo, error)

func (*OCMProvider) InstallClusterLogging

func (o *OCMProvider) InstallClusterLogging(clusterSpec *types.ClusterSpec, params []types.Parameter) (bool, error)

func (*OCMProvider) InstallKasFleetshard

func (o *OCMProvider) InstallKasFleetshard(clusterSpec *types.ClusterSpec, params []types.Parameter) (bool, error)

func (*OCMProvider) InstallStrimzi

func (o *OCMProvider) InstallStrimzi(clusterSpec *types.ClusterSpec) (bool, error)

func (*OCMProvider) RemoveResources

func (o *OCMProvider) RemoveResources(clusterSpec *types.ClusterSpec, syncSetName string) error

RemoveResources deletes the SyncSet from a cluster. If the SyncSet (or the cluster) is not found, no error is returned

type Provider

type Provider interface {
	// Create using the information provided to request a new OpenShift/k8s cluster from the provider
	Create(request *types.ClusterRequest) (*types.ClusterSpec, error)
	// Delete delete the cluster from the provider
	Delete(spec *types.ClusterSpec) (bool, error)
	// CheckClusterStatus check the status of the cluster. This will be called periodically during cluster provisioning phase to see if the cluster is ready.
	// It should set the status in the returned `ClusterSpec` to either `provisioning`, `ready` or `failed`.
	// If there is additional data that needs to be preserved and passed between checks, add it to the returned `ClusterSpec` and it will be saved to the database and passed into this function again next time it is called.
	CheckClusterStatus(spec *types.ClusterSpec) (*types.ClusterSpec, error)
	// AddIdentityProvider add an identity provider to the cluster
	AddIdentityProvider(clusterSpec *types.ClusterSpec, identityProvider types.IdentityProviderInfo) (*types.IdentityProviderInfo, error)
	// ApplyResources apply openshift/k8s resources to the cluster
	ApplyResources(clusterSpec *types.ClusterSpec, resources types.ResourceSet) (*types.ResourceSet, error)
	// RemoveResources uninstalls resources from a cluster
	RemoveResources(clusterSpec *types.ClusterSpec, syncSetName string) error
	// GetClusterDNS Get the dns of the cluster
	GetClusterDNS(clusterSpec *types.ClusterSpec) (string, error)
	// GetClusterSpec returns the details of the cluster from the cluster provider
	// It should set the status in the returned `ClusterSpec` to either `provisioning`, `ready` or `failed`.
	GetClusterSpec(clusterID string) (types.ClusterSpec, error)
	// GetCloudProviders Get the information about supported cloud providers from the cluster provider
	GetCloudProviders() (*types.CloudProviderInfoList, error)
	// GetCloudProviderRegions Get the regions information for the given cloud provider from the cluster provider
	GetCloudProviderRegions(providerInf types.CloudProviderInfo) (*types.CloudProviderRegionInfoList, error)
	// Install the strimzi operator in a given cluster
	InstallStrimzi(clusterSpec *types.ClusterSpec) (bool, error)
	// Install the cluster logging operator for a given cluster
	InstallClusterLogging(clusterSpec *types.ClusterSpec, params []types.Parameter) (bool, error)
	// Install the cluster logging operator for a given cluster
	InstallKasFleetshard(clusterSpec *types.ClusterSpec, params []types.Parameter) (bool, error)
	GetMachinePool(clusterID string, id string) (*types.MachinePoolInfo, error)
	CreateMachinePool(request *types.MachinePoolRequest) (*types.MachinePoolRequest, error)
	// GetClusterResourceQuotaCosts returns a list of quota cost information related to resources used for the provisioning and
	// terraforming of data plane clusters for the authenticated user.
	GetClusterResourceQuotaCosts() ([]types.QuotaCost, error)
	// CheckIfOrganizationIsTheClusterOwner perform the check to verify if the organization (given by the external organization id) owns the cluster with the given cluster id and cluster external id
	CheckIfOrganizationIsTheClusterOwner(externalOrganizationID, clusterID, clusterExternalID string) error
}

type ProviderFactory

type ProviderFactory interface {
	GetProvider(providerType api.ClusterProviderType) (Provider, error)
}

ProviderFactory used to return an instance of Provider implementation

type ProviderFactoryMock

type ProviderFactoryMock struct {
	// GetProviderFunc mocks the GetProvider method.
	GetProviderFunc func(providerType api.ClusterProviderType) (Provider, error)
	// contains filtered or unexported fields
}

ProviderFactoryMock is a mock implementation of ProviderFactory.

func TestSomethingThatUsesProviderFactory(t *testing.T) {

	// make and configure a mocked ProviderFactory
	mockedProviderFactory := &ProviderFactoryMock{
		GetProviderFunc: func(providerType api.ClusterProviderType) (Provider, error) {
			panic("mock out the GetProvider method")
		},
	}

	// use mockedProviderFactory in code that requires ProviderFactory
	// and then make assertions.

}

func (*ProviderFactoryMock) GetProvider

func (mock *ProviderFactoryMock) GetProvider(providerType api.ClusterProviderType) (Provider, error)

GetProvider calls GetProviderFunc.

func (*ProviderFactoryMock) GetProviderCalls

func (mock *ProviderFactoryMock) GetProviderCalls() []struct {
	ProviderType api.ClusterProviderType
}

GetProviderCalls gets all the calls that were made to GetProvider. Check the length with:

len(mockedProviderFactory.GetProviderCalls())

type ProviderMock

type ProviderMock struct {
	// AddIdentityProviderFunc mocks the AddIdentityProvider method.
	AddIdentityProviderFunc func(clusterSpec *types.ClusterSpec, identityProvider types.IdentityProviderInfo) (*types.IdentityProviderInfo, error)

	// ApplyResourcesFunc mocks the ApplyResources method.
	ApplyResourcesFunc func(clusterSpec *types.ClusterSpec, resources types.ResourceSet) (*types.ResourceSet, error)

	// CheckClusterStatusFunc mocks the CheckClusterStatus method.
	CheckClusterStatusFunc func(spec *types.ClusterSpec) (*types.ClusterSpec, error)

	// CheckIfOrganizationIsTheClusterOwnerFunc mocks the CheckIfOrganizationIsTheClusterOwner method.
	CheckIfOrganizationIsTheClusterOwnerFunc func(externalOrganizationID string, clusterID string, clusterExternalID string) error

	// CreateFunc mocks the Create method.
	CreateFunc func(request *types.ClusterRequest) (*types.ClusterSpec, error)

	// CreateMachinePoolFunc mocks the CreateMachinePool method.
	CreateMachinePoolFunc func(request *types.MachinePoolRequest) (*types.MachinePoolRequest, error)

	// DeleteFunc mocks the Delete method.
	DeleteFunc func(spec *types.ClusterSpec) (bool, error)

	// GetCloudProviderRegionsFunc mocks the GetCloudProviderRegions method.
	GetCloudProviderRegionsFunc func(providerInf types.CloudProviderInfo) (*types.CloudProviderRegionInfoList, error)

	// GetCloudProvidersFunc mocks the GetCloudProviders method.
	GetCloudProvidersFunc func() (*types.CloudProviderInfoList, error)

	// GetClusterDNSFunc mocks the GetClusterDNS method.
	GetClusterDNSFunc func(clusterSpec *types.ClusterSpec) (string, error)

	// GetClusterResourceQuotaCostsFunc mocks the GetClusterResourceQuotaCosts method.
	GetClusterResourceQuotaCostsFunc func() ([]types.QuotaCost, error)

	// GetClusterSpecFunc mocks the GetClusterSpec method.
	GetClusterSpecFunc func(clusterID string) (types.ClusterSpec, error)

	// GetMachinePoolFunc mocks the GetMachinePool method.
	GetMachinePoolFunc func(clusterID string, id string) (*types.MachinePoolInfo, error)

	// InstallClusterLoggingFunc mocks the InstallClusterLogging method.
	InstallClusterLoggingFunc func(clusterSpec *types.ClusterSpec, params []ocm.Parameter) (bool, error)

	// InstallKasFleetshardFunc mocks the InstallKasFleetshard method.
	InstallKasFleetshardFunc func(clusterSpec *types.ClusterSpec, params []ocm.Parameter) (bool, error)

	// InstallStrimziFunc mocks the InstallStrimzi method.
	InstallStrimziFunc func(clusterSpec *types.ClusterSpec) (bool, error)

	// RemoveResourcesFunc mocks the RemoveResources method.
	RemoveResourcesFunc func(clusterSpec *types.ClusterSpec, syncSetName string) error
	// contains filtered or unexported fields
}

ProviderMock is a mock implementation of Provider.

func TestSomethingThatUsesProvider(t *testing.T) {

	// make and configure a mocked Provider
	mockedProvider := &ProviderMock{
		AddIdentityProviderFunc: func(clusterSpec *types.ClusterSpec, identityProvider types.IdentityProviderInfo) (*types.IdentityProviderInfo, error) {
			panic("mock out the AddIdentityProvider method")
		},
		ApplyResourcesFunc: func(clusterSpec *types.ClusterSpec, resources types.ResourceSet) (*types.ResourceSet, error) {
			panic("mock out the ApplyResources method")
		},
		CheckClusterStatusFunc: func(spec *types.ClusterSpec) (*types.ClusterSpec, error) {
			panic("mock out the CheckClusterStatus method")
		},
		CheckIfOrganizationIsTheClusterOwnerFunc: func(externalOrganizationID string, clusterID string, clusterExternalID string) error {
			panic("mock out the CheckIfOrganizationIsTheClusterOwner method")
		},
		CreateFunc: func(request *types.ClusterRequest) (*types.ClusterSpec, error) {
			panic("mock out the Create method")
		},
		CreateMachinePoolFunc: func(request *types.MachinePoolRequest) (*types.MachinePoolRequest, error) {
			panic("mock out the CreateMachinePool method")
		},
		DeleteFunc: func(spec *types.ClusterSpec) (bool, error) {
			panic("mock out the Delete method")
		},
		GetCloudProviderRegionsFunc: func(providerInf types.CloudProviderInfo) (*types.CloudProviderRegionInfoList, error) {
			panic("mock out the GetCloudProviderRegions method")
		},
		GetCloudProvidersFunc: func() (*types.CloudProviderInfoList, error) {
			panic("mock out the GetCloudProviders method")
		},
		GetClusterDNSFunc: func(clusterSpec *types.ClusterSpec) (string, error) {
			panic("mock out the GetClusterDNS method")
		},
		GetClusterResourceQuotaCostsFunc: func() ([]types.QuotaCost, error) {
			panic("mock out the GetClusterResourceQuotaCosts method")
		},
		GetClusterSpecFunc: func(clusterID string) (types.ClusterSpec, error) {
			panic("mock out the GetClusterSpec method")
		},
		GetMachinePoolFunc: func(clusterID string, id string) (*types.MachinePoolInfo, error) {
			panic("mock out the GetMachinePool method")
		},
		InstallClusterLoggingFunc: func(clusterSpec *types.ClusterSpec, params []ocm.Parameter) (bool, error) {
			panic("mock out the InstallClusterLogging method")
		},
		InstallKasFleetshardFunc: func(clusterSpec *types.ClusterSpec, params []ocm.Parameter) (bool, error) {
			panic("mock out the InstallKasFleetshard method")
		},
		InstallStrimziFunc: func(clusterSpec *types.ClusterSpec) (bool, error) {
			panic("mock out the InstallStrimzi method")
		},
		RemoveResourcesFunc: func(clusterSpec *types.ClusterSpec, syncSetName string) error {
			panic("mock out the RemoveResources method")
		},
	}

	// use mockedProvider in code that requires Provider
	// and then make assertions.

}

func (*ProviderMock) AddIdentityProvider

func (mock *ProviderMock) AddIdentityProvider(clusterSpec *types.ClusterSpec, identityProvider types.IdentityProviderInfo) (*types.IdentityProviderInfo, error)

AddIdentityProvider calls AddIdentityProviderFunc.

func (*ProviderMock) AddIdentityProviderCalls

func (mock *ProviderMock) AddIdentityProviderCalls() []struct {
	ClusterSpec      *types.ClusterSpec
	IdentityProvider types.IdentityProviderInfo
}

AddIdentityProviderCalls gets all the calls that were made to AddIdentityProvider. Check the length with:

len(mockedProvider.AddIdentityProviderCalls())

func (*ProviderMock) ApplyResources

func (mock *ProviderMock) ApplyResources(clusterSpec *types.ClusterSpec, resources types.ResourceSet) (*types.ResourceSet, error)

ApplyResources calls ApplyResourcesFunc.

func (*ProviderMock) ApplyResourcesCalls

func (mock *ProviderMock) ApplyResourcesCalls() []struct {
	ClusterSpec *types.ClusterSpec
	Resources   types.ResourceSet
}

ApplyResourcesCalls gets all the calls that were made to ApplyResources. Check the length with:

len(mockedProvider.ApplyResourcesCalls())

func (*ProviderMock) CheckClusterStatus

func (mock *ProviderMock) CheckClusterStatus(spec *types.ClusterSpec) (*types.ClusterSpec, error)

CheckClusterStatus calls CheckClusterStatusFunc.

func (*ProviderMock) CheckClusterStatusCalls

func (mock *ProviderMock) CheckClusterStatusCalls() []struct {
	Spec *types.ClusterSpec
}

CheckClusterStatusCalls gets all the calls that were made to CheckClusterStatus. Check the length with:

len(mockedProvider.CheckClusterStatusCalls())

func (*ProviderMock) CheckIfOrganizationIsTheClusterOwner

func (mock *ProviderMock) CheckIfOrganizationIsTheClusterOwner(externalOrganizationID string, clusterID string, clusterExternalID string) error

CheckIfOrganizationIsTheClusterOwner calls CheckIfOrganizationIsTheClusterOwnerFunc.

func (*ProviderMock) CheckIfOrganizationIsTheClusterOwnerCalls

func (mock *ProviderMock) CheckIfOrganizationIsTheClusterOwnerCalls() []struct {
	ExternalOrganizationID string
	ClusterID              string
	ClusterExternalID      string
}

CheckIfOrganizationIsTheClusterOwnerCalls gets all the calls that were made to CheckIfOrganizationIsTheClusterOwner. Check the length with:

len(mockedProvider.CheckIfOrganizationIsTheClusterOwnerCalls())

func (*ProviderMock) Create

func (mock *ProviderMock) Create(request *types.ClusterRequest) (*types.ClusterSpec, error)

Create calls CreateFunc.

func (*ProviderMock) CreateCalls

func (mock *ProviderMock) CreateCalls() []struct {
	Request *types.ClusterRequest
}

CreateCalls gets all the calls that were made to Create. Check the length with:

len(mockedProvider.CreateCalls())

func (*ProviderMock) CreateMachinePool

func (mock *ProviderMock) CreateMachinePool(request *types.MachinePoolRequest) (*types.MachinePoolRequest, error)

CreateMachinePool calls CreateMachinePoolFunc.

func (*ProviderMock) CreateMachinePoolCalls

func (mock *ProviderMock) CreateMachinePoolCalls() []struct {
	Request *types.MachinePoolRequest
}

CreateMachinePoolCalls gets all the calls that were made to CreateMachinePool. Check the length with:

len(mockedProvider.CreateMachinePoolCalls())

func (*ProviderMock) Delete

func (mock *ProviderMock) Delete(spec *types.ClusterSpec) (bool, error)

Delete calls DeleteFunc.

func (*ProviderMock) DeleteCalls

func (mock *ProviderMock) DeleteCalls() []struct {
	Spec *types.ClusterSpec
}

DeleteCalls gets all the calls that were made to Delete. Check the length with:

len(mockedProvider.DeleteCalls())

func (*ProviderMock) GetCloudProviderRegions

func (mock *ProviderMock) GetCloudProviderRegions(providerInf types.CloudProviderInfo) (*types.CloudProviderRegionInfoList, error)

GetCloudProviderRegions calls GetCloudProviderRegionsFunc.

func (*ProviderMock) GetCloudProviderRegionsCalls

func (mock *ProviderMock) GetCloudProviderRegionsCalls() []struct {
	ProviderInf types.CloudProviderInfo
}

GetCloudProviderRegionsCalls gets all the calls that were made to GetCloudProviderRegions. Check the length with:

len(mockedProvider.GetCloudProviderRegionsCalls())

func (*ProviderMock) GetCloudProviders

func (mock *ProviderMock) GetCloudProviders() (*types.CloudProviderInfoList, error)

GetCloudProviders calls GetCloudProvidersFunc.

func (*ProviderMock) GetCloudProvidersCalls

func (mock *ProviderMock) GetCloudProvidersCalls() []struct {
}

GetCloudProvidersCalls gets all the calls that were made to GetCloudProviders. Check the length with:

len(mockedProvider.GetCloudProvidersCalls())

func (*ProviderMock) GetClusterDNS

func (mock *ProviderMock) GetClusterDNS(clusterSpec *types.ClusterSpec) (string, error)

GetClusterDNS calls GetClusterDNSFunc.

func (*ProviderMock) GetClusterDNSCalls

func (mock *ProviderMock) GetClusterDNSCalls() []struct {
	ClusterSpec *types.ClusterSpec
}

GetClusterDNSCalls gets all the calls that were made to GetClusterDNS. Check the length with:

len(mockedProvider.GetClusterDNSCalls())

func (*ProviderMock) GetClusterResourceQuotaCosts

func (mock *ProviderMock) GetClusterResourceQuotaCosts() ([]types.QuotaCost, error)

GetClusterResourceQuotaCosts calls GetClusterResourceQuotaCostsFunc.

func (*ProviderMock) GetClusterResourceQuotaCostsCalls

func (mock *ProviderMock) GetClusterResourceQuotaCostsCalls() []struct {
}

GetClusterResourceQuotaCostsCalls gets all the calls that were made to GetClusterResourceQuotaCosts. Check the length with:

len(mockedProvider.GetClusterResourceQuotaCostsCalls())

func (*ProviderMock) GetClusterSpec

func (mock *ProviderMock) GetClusterSpec(clusterID string) (types.ClusterSpec, error)

GetClusterSpec calls GetClusterSpecFunc.

func (*ProviderMock) GetClusterSpecCalls

func (mock *ProviderMock) GetClusterSpecCalls() []struct {
	ClusterID string
}

GetClusterSpecCalls gets all the calls that were made to GetClusterSpec. Check the length with:

len(mockedProvider.GetClusterSpecCalls())

func (*ProviderMock) GetMachinePool

func (mock *ProviderMock) GetMachinePool(clusterID string, id string) (*types.MachinePoolInfo, error)

GetMachinePool calls GetMachinePoolFunc.

func (*ProviderMock) GetMachinePoolCalls

func (mock *ProviderMock) GetMachinePoolCalls() []struct {
	ClusterID string
	ID        string
}

GetMachinePoolCalls gets all the calls that were made to GetMachinePool. Check the length with:

len(mockedProvider.GetMachinePoolCalls())

func (*ProviderMock) InstallClusterLogging

func (mock *ProviderMock) InstallClusterLogging(clusterSpec *types.ClusterSpec, params []ocm.Parameter) (bool, error)

InstallClusterLogging calls InstallClusterLoggingFunc.

func (*ProviderMock) InstallClusterLoggingCalls

func (mock *ProviderMock) InstallClusterLoggingCalls() []struct {
	ClusterSpec *types.ClusterSpec
	Params      []ocm.Parameter
}

InstallClusterLoggingCalls gets all the calls that were made to InstallClusterLogging. Check the length with:

len(mockedProvider.InstallClusterLoggingCalls())

func (*ProviderMock) InstallKasFleetshard

func (mock *ProviderMock) InstallKasFleetshard(clusterSpec *types.ClusterSpec, params []ocm.Parameter) (bool, error)

InstallKasFleetshard calls InstallKasFleetshardFunc.

func (*ProviderMock) InstallKasFleetshardCalls

func (mock *ProviderMock) InstallKasFleetshardCalls() []struct {
	ClusterSpec *types.ClusterSpec
	Params      []ocm.Parameter
}

InstallKasFleetshardCalls gets all the calls that were made to InstallKasFleetshard. Check the length with:

len(mockedProvider.InstallKasFleetshardCalls())

func (*ProviderMock) InstallStrimzi

func (mock *ProviderMock) InstallStrimzi(clusterSpec *types.ClusterSpec) (bool, error)

InstallStrimzi calls InstallStrimziFunc.

func (*ProviderMock) InstallStrimziCalls

func (mock *ProviderMock) InstallStrimziCalls() []struct {
	ClusterSpec *types.ClusterSpec
}

InstallStrimziCalls gets all the calls that were made to InstallStrimzi. Check the length with:

len(mockedProvider.InstallStrimziCalls())

func (*ProviderMock) RemoveResources

func (mock *ProviderMock) RemoveResources(clusterSpec *types.ClusterSpec, syncSetName string) error

RemoveResources calls RemoveResourcesFunc.

func (*ProviderMock) RemoveResourcesCalls

func (mock *ProviderMock) RemoveResourcesCalls() []struct {
	ClusterSpec *types.ClusterSpec
	SyncSetName string
}

RemoveResourcesCalls gets all the calls that were made to RemoveResources. Check the length with:

len(mockedProvider.RemoveResourcesCalls())

type StandaloneProvider

type StandaloneProvider struct {
	// contains filtered or unexported fields
}

func (*StandaloneProvider) AddIdentityProvider

func (s *StandaloneProvider) AddIdentityProvider(clusterSpec *types.ClusterSpec, identityProvider types.IdentityProviderInfo) (*types.IdentityProviderInfo, error)

func (*StandaloneProvider) ApplyResources

func (s *StandaloneProvider) ApplyResources(clusterSpec *types.ClusterSpec, resources types.ResourceSet) (*types.ResourceSet, error)

func (*StandaloneProvider) CheckClusterStatus

func (s *StandaloneProvider) CheckClusterStatus(spec *types.ClusterSpec) (*types.ClusterSpec, error)

func (*StandaloneProvider) CheckIfOrganizationIsTheClusterOwner

func (s *StandaloneProvider) CheckIfOrganizationIsTheClusterOwner(externalOrganizationID, clusterID, clusterExternalID string) error

func (*StandaloneProvider) Create

func (*StandaloneProvider) CreateMachinePool

func (s *StandaloneProvider) CreateMachinePool(request *types.MachinePoolRequest) (*types.MachinePoolRequest, error)

func (*StandaloneProvider) Delete

func (s *StandaloneProvider) Delete(spec *types.ClusterSpec) (bool, error)

func (*StandaloneProvider) GetCloudProviderRegions

func (s *StandaloneProvider) GetCloudProviderRegions(providerInf types.CloudProviderInfo) (*types.CloudProviderRegionInfoList, error)

func (*StandaloneProvider) GetCloudProviders

func (s *StandaloneProvider) GetCloudProviders() (*types.CloudProviderInfoList, error)

func (*StandaloneProvider) GetClusterDNS

func (s *StandaloneProvider) GetClusterDNS(clusterSpec *types.ClusterSpec) (string, error)

func (*StandaloneProvider) GetClusterResourceQuotaCosts

func (s *StandaloneProvider) GetClusterResourceQuotaCosts() ([]types.QuotaCost, error)

noop method, it will always return a nil slice as a standalone provider does not have any resource quotas

func (*StandaloneProvider) GetClusterSpec

func (s *StandaloneProvider) GetClusterSpec(clusterID string) (types.ClusterSpec, error)

func (*StandaloneProvider) GetMachinePool

func (s *StandaloneProvider) GetMachinePool(clusterID string, id string) (*types.MachinePoolInfo, error)

func (*StandaloneProvider) InstallClusterLogging

func (s *StandaloneProvider) InstallClusterLogging(clusterSpec *types.ClusterSpec, params []types.Parameter) (bool, error)

func (*StandaloneProvider) InstallKasFleetshard

func (s *StandaloneProvider) InstallKasFleetshard(clusterSpec *types.ClusterSpec, params []types.Parameter) (bool, error)

func (*StandaloneProvider) InstallStrimzi

func (s *StandaloneProvider) InstallStrimzi(clusterSpec *types.ClusterSpec) (bool, error)

func (*StandaloneProvider) RemoveResources

func (s *StandaloneProvider) RemoveResources(clusterSpec *types.ClusterSpec, syncSetName string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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