services

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: 46 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KasFleetshardOperatorRoleName = "kas_fleetshard_operator"

	KasFleetshardOperatorParamServiceAccountId     = "sso-client-id"
	KasFleetshardOperatorParamServiceAccountSecret = "sso-secret"
)
View Source
const CanaryServiceAccountPrefix = "canary"

Variables

This section is empty.

Functions

func BuildCustomClaimCheck

func BuildCustomClaimCheck(kafkaRequest *dbapi.KafkaRequest, ssoconfigProvider string) string

func BuildKeycloakClientNameIdentifier

func BuildKeycloakClientNameIdentifier(kafkaRequestID string) string

BuildKeycloakClientNameIdentifier builds an identifier based on the kafka request id

func MaskProceedingandTrailingDash

func MaskProceedingandTrailingDash(name string) string

MaskProceedingandTrailingDash replaces the first and final character of a string with a subdomain safe value if is a dash.

func NewDataPlaneClusterService

func NewDataPlaneClusterService(config dataPlaneClusterService) *dataPlaneClusterService

func NewDataPlaneKafkaService

func NewDataPlaneKafkaService(kafkaSrv KafkaService, clusterSrv ClusterService, kafkaConfig *config.KafkaConfig) *dataPlaneKafkaService

func NewKafkaService

func NewKafkaService(
	connectionFactory *db.ConnectionFactory, clusterService ClusterService, keycloakService sso.KafkaKeycloakService,
	kafkaConfig *config.KafkaConfig, dataplaneClusterConfig *config.DataplaneClusterConfig, awsConfig *config.AWSConfig,
	quotaServiceFactory QuotaServiceFactory, awsClientFactory aws.ClientFactory, authorizationService authorization.Authorization,
	providerConfig *config.ProviderConfig, clusterPlacementStrategy ClusterPlacementStrategy,
	kafkaTLSCertificateManagementService kafkatlscertmgmt.KafkaTLSCertificateManagementService) *kafkaService

func TruncateString

func TruncateString(str string, num int) string

Types

type CNameRecordStatus

type CNameRecordStatus struct {
	Id     *string
	Status *string
}

type CloudProviderWithRegions

type CloudProviderWithRegions struct {
	ID         string
	RegionList *types.CloudProviderRegionInfoList
}

type CloudProvidersService

type CloudProvidersService interface {
	GetCloudProvidersWithRegions() ([]CloudProviderWithRegions, *errors.ServiceError)
	GetCachedCloudProvidersWithRegions() ([]CloudProviderWithRegions, *errors.ServiceError)
	ListCloudProviders() ([]api.CloudProvider, *errors.ServiceError)
	ListCloudProviderRegions(id string) ([]api.CloudRegion, *errors.ServiceError)
	ListCachedCloudProviderRegions(id string) ([]api.CloudRegion, *errors.ServiceError)
}

func NewCloudProvidersService

func NewCloudProvidersService(providerFactory clusters.ProviderFactory, connectionFactory *db.ConnectionFactory) CloudProvidersService

type CloudProvidersServiceMock

type CloudProvidersServiceMock struct {
	// GetCachedCloudProvidersWithRegionsFunc mocks the GetCachedCloudProvidersWithRegions method.
	GetCachedCloudProvidersWithRegionsFunc func() ([]CloudProviderWithRegions, *serviceError.ServiceError)

	// GetCloudProvidersWithRegionsFunc mocks the GetCloudProvidersWithRegions method.
	GetCloudProvidersWithRegionsFunc func() ([]CloudProviderWithRegions, *serviceError.ServiceError)

	// ListCachedCloudProviderRegionsFunc mocks the ListCachedCloudProviderRegions method.
	ListCachedCloudProviderRegionsFunc func(id string) ([]api.CloudRegion, *serviceError.ServiceError)

	// ListCloudProviderRegionsFunc mocks the ListCloudProviderRegions method.
	ListCloudProviderRegionsFunc func(id string) ([]api.CloudRegion, *serviceError.ServiceError)

	// ListCloudProvidersFunc mocks the ListCloudProviders method.
	ListCloudProvidersFunc func() ([]api.CloudProvider, *serviceError.ServiceError)
	// contains filtered or unexported fields
}

CloudProvidersServiceMock is a mock implementation of CloudProvidersService.

func TestSomethingThatUsesCloudProvidersService(t *testing.T) {

	// make and configure a mocked CloudProvidersService
	mockedCloudProvidersService := &CloudProvidersServiceMock{
		GetCachedCloudProvidersWithRegionsFunc: func() ([]CloudProviderWithRegions, *serviceError.ServiceError) {
			panic("mock out the GetCachedCloudProvidersWithRegions method")
		},
		GetCloudProvidersWithRegionsFunc: func() ([]CloudProviderWithRegions, *serviceError.ServiceError) {
			panic("mock out the GetCloudProvidersWithRegions method")
		},
		ListCachedCloudProviderRegionsFunc: func(id string) ([]api.CloudRegion, *serviceError.ServiceError) {
			panic("mock out the ListCachedCloudProviderRegions method")
		},
		ListCloudProviderRegionsFunc: func(id string) ([]api.CloudRegion, *serviceError.ServiceError) {
			panic("mock out the ListCloudProviderRegions method")
		},
		ListCloudProvidersFunc: func() ([]api.CloudProvider, *serviceError.ServiceError) {
			panic("mock out the ListCloudProviders method")
		},
	}

	// use mockedCloudProvidersService in code that requires CloudProvidersService
	// and then make assertions.

}

func (*CloudProvidersServiceMock) GetCachedCloudProvidersWithRegions

func (mock *CloudProvidersServiceMock) GetCachedCloudProvidersWithRegions() ([]CloudProviderWithRegions, *serviceError.ServiceError)

GetCachedCloudProvidersWithRegions calls GetCachedCloudProvidersWithRegionsFunc.

func (*CloudProvidersServiceMock) GetCachedCloudProvidersWithRegionsCalls

func (mock *CloudProvidersServiceMock) GetCachedCloudProvidersWithRegionsCalls() []struct {
}

GetCachedCloudProvidersWithRegionsCalls gets all the calls that were made to GetCachedCloudProvidersWithRegions. Check the length with:

len(mockedCloudProvidersService.GetCachedCloudProvidersWithRegionsCalls())

func (*CloudProvidersServiceMock) GetCloudProvidersWithRegions

func (mock *CloudProvidersServiceMock) GetCloudProvidersWithRegions() ([]CloudProviderWithRegions, *serviceError.ServiceError)

GetCloudProvidersWithRegions calls GetCloudProvidersWithRegionsFunc.

func (*CloudProvidersServiceMock) GetCloudProvidersWithRegionsCalls

func (mock *CloudProvidersServiceMock) GetCloudProvidersWithRegionsCalls() []struct {
}

GetCloudProvidersWithRegionsCalls gets all the calls that were made to GetCloudProvidersWithRegions. Check the length with:

len(mockedCloudProvidersService.GetCloudProvidersWithRegionsCalls())

func (*CloudProvidersServiceMock) ListCachedCloudProviderRegions

func (mock *CloudProvidersServiceMock) ListCachedCloudProviderRegions(id string) ([]api.CloudRegion, *serviceError.ServiceError)

ListCachedCloudProviderRegions calls ListCachedCloudProviderRegionsFunc.

func (*CloudProvidersServiceMock) ListCachedCloudProviderRegionsCalls

func (mock *CloudProvidersServiceMock) ListCachedCloudProviderRegionsCalls() []struct {
	ID string
}

ListCachedCloudProviderRegionsCalls gets all the calls that were made to ListCachedCloudProviderRegions. Check the length with:

len(mockedCloudProvidersService.ListCachedCloudProviderRegionsCalls())

func (*CloudProvidersServiceMock) ListCloudProviderRegions

func (mock *CloudProvidersServiceMock) ListCloudProviderRegions(id string) ([]api.CloudRegion, *serviceError.ServiceError)

ListCloudProviderRegions calls ListCloudProviderRegionsFunc.

func (*CloudProvidersServiceMock) ListCloudProviderRegionsCalls

func (mock *CloudProvidersServiceMock) ListCloudProviderRegionsCalls() []struct {
	ID string
}

ListCloudProviderRegionsCalls gets all the calls that were made to ListCloudProviderRegions. Check the length with:

len(mockedCloudProvidersService.ListCloudProviderRegionsCalls())

func (*CloudProvidersServiceMock) ListCloudProviders

func (mock *CloudProvidersServiceMock) ListCloudProviders() ([]api.CloudProvider, *serviceError.ServiceError)

ListCloudProviders calls ListCloudProvidersFunc.

func (*CloudProvidersServiceMock) ListCloudProvidersCalls

func (mock *CloudProvidersServiceMock) ListCloudProvidersCalls() []struct {
}

ListCloudProvidersCalls gets all the calls that were made to ListCloudProviders. Check the length with:

len(mockedCloudProvidersService.ListCloudProvidersCalls())

type Cluster

type Cluster struct {
	ProviderType api.ClusterProviderType `json:"provider_type"`
}

type ClusterPlacementStrategy

type ClusterPlacementStrategy interface {
	// FindCluster finds and returns a Cluster depends on the specific impl.
	FindCluster(kafka *dbapi.KafkaRequest) (*api.Cluster, error)
}

func NewClusterPlacementStrategy

func NewClusterPlacementStrategy(clusterService ClusterService, dataplaneClusterConfig *config.DataplaneClusterConfig, kafkaConfig *config.KafkaConfig) ClusterPlacementStrategy

NewClusterPlacementStrategy return a concrete strategy impl. depends on the placement configuration

type ClusterPlacementStrategyMock

type ClusterPlacementStrategyMock struct {
	// FindClusterFunc mocks the FindCluster method.
	FindClusterFunc func(kafka *dbapi.KafkaRequest) (*api.Cluster, error)
	// contains filtered or unexported fields
}

ClusterPlacementStrategyMock is a mock implementation of ClusterPlacementStrategy.

func TestSomethingThatUsesClusterPlacementStrategy(t *testing.T) {

	// make and configure a mocked ClusterPlacementStrategy
	mockedClusterPlacementStrategy := &ClusterPlacementStrategyMock{
		FindClusterFunc: func(kafka *dbapi.KafkaRequest) (*api.Cluster, error) {
			panic("mock out the FindCluster method")
		},
	}

	// use mockedClusterPlacementStrategy in code that requires ClusterPlacementStrategy
	// and then make assertions.

}

func (*ClusterPlacementStrategyMock) FindCluster

func (mock *ClusterPlacementStrategyMock) FindCluster(kafka *dbapi.KafkaRequest) (*api.Cluster, error)

FindCluster calls FindClusterFunc.

func (*ClusterPlacementStrategyMock) FindClusterCalls

func (mock *ClusterPlacementStrategyMock) FindClusterCalls() []struct {
	Kafka *dbapi.KafkaRequest
}

FindClusterCalls gets all the calls that were made to FindCluster. Check the length with:

len(mockedClusterPlacementStrategy.FindClusterCalls())

type ClusterSelection

type ClusterSelection struct {
	CloudProvider         string
	ID                    string
	ClusterID             string
	Region                string
	SupportedInstanceType string
	DynamicCapacityInfo   api.JSON
	Status                string
	ClusterType           string
}

type ClusterService

type ClusterService interface {
	Create(cluster *api.Cluster) (*api.Cluster, *apiErrors.ServiceError)
	GetClusterDNS(clusterID string) (string, *apiErrors.ServiceError)
	GetExternalID(clusterID string) (string, *apiErrors.ServiceError)
	// ListEnterpriseClustersOfAnOrganization returns a list of enterprise clusters (ClusterID, AccessKafkasViaPrivateNetwork, Cloud Provider, Region, MultiAZ and Status fields only) which belong to organization obtained from the context
	ListEnterpriseClustersOfAnOrganization(ctx context.Context) ([]*api.Cluster, *apiErrors.ServiceError)
	ListByStatus(state api.ClusterStatus) ([]api.Cluster, *apiErrors.ServiceError)
	UpdateStatus(cluster api.Cluster, status api.ClusterStatus) error
	// Update updates a Cluster. Only fields whose value is different than the
	// zero-value of their corresponding type will be updated
	Update(cluster api.Cluster) *apiErrors.ServiceError
	FindCluster(criteria FindClusterCriteria) (*api.Cluster, error)
	// FindClusterByID returns the cluster corresponding to the provided clusterID.
	// If the cluster has not been found nil is returned. If there has been an issue
	// finding the cluster an error is set
	FindClusterByID(clusterID string) (*api.Cluster, *apiErrors.ServiceError)
	GetClientID(clusterID string) (string, error)
	ListGroupByProviderAndRegion(providers []string, regions []string, status []string) ([]*ResGroupCPRegion, *apiErrors.ServiceError)
	RegisterClusterJob(clusterRequest *api.Cluster) *apiErrors.ServiceError
	DeregisterClusterJob(clusterID string) *apiErrors.ServiceError
	// DeleteByClusterID will delete the cluster from the database
	DeleteByClusterID(clusterID string) *apiErrors.ServiceError
	// HardDeleteByClusterID hard deletes a cluster from the database, no delete flag is set
	HardDeleteByClusterID(clusterID string) *apiErrors.ServiceError
	// FindNonEmptyClusterByID returns a cluster if it present and it is not empty.
	// Cluster emptiness is determined by checking whether the cluster contains Kafkas that have been provisioned, are being provisioned on it,
	// or are being deprovisioned from it i.e kafka that are not in deleting state.
	// NOTE. Kafka in "failed" are included as well since it is not a terminal status at the moment.
	FindNonEmptyClusterByID(clusterID string) (*api.Cluster, *apiErrors.ServiceError)
	// ListNonEnterpriseClusterIDs returns all the valid cluster ids in array (except enterprise clusters)
	ListNonEnterpriseClusterIDs() ([]api.Cluster, *apiErrors.ServiceError)
	// FindAllClusters return all the valid clusters in array
	FindAllClusters(criteria FindClusterCriteria) ([]*api.Cluster, error)
	// FindKafkaInstanceCount returns the kafka instance counts associated with the list of clusters. If the list is empty, it will list all clusterIDs that have Kafka instances assigned.
	// Kafkas that are in deleting state won't be included in the count as they no longer consume resources in the data plane cluster.
	FindKafkaInstanceCount(clusterIDs []string) ([]ResKafkaInstanceCount, error)
	// UpdateMultiClusterStatus updates a list of clusters' status to a status
	UpdateMultiClusterStatus(clusterIDs []string, status api.ClusterStatus) *apiErrors.ServiceError
	// CountByStatus returns the count of clusters for each given status in the database
	CountByStatus([]api.ClusterStatus) ([]ClusterStatusCount, *apiErrors.ServiceError)
	CheckClusterStatus(cluster *api.Cluster) (*api.Cluster, *apiErrors.ServiceError)
	// Delete will delete the cluster from the provider
	Delete(cluster *api.Cluster) (bool, *apiErrors.ServiceError)
	ConfigureAndSaveIdentityProvider(cluster *api.Cluster, identityProviderInfo types.IdentityProviderInfo) (*api.Cluster, *apiErrors.ServiceError)
	ApplyResources(cluster *api.Cluster, resources types.ResourceSet) *apiErrors.ServiceError
	RemoveResources(cluster *api.Cluster, syncSetName string) *apiErrors.ServiceError
	// Install the strimzi operator in a given cluster
	InstallStrimzi(cluster *api.Cluster) (bool, *apiErrors.ServiceError)
	// Install the cluster logging operator for a given cluster
	InstallClusterLogging(cluster *api.Cluster, params []types.Parameter) (bool, *apiErrors.ServiceError)
	CheckStrimziVersionReady(cluster *api.Cluster, strimziVersion string) (bool, error)
	IsStrimziKafkaVersionAvailableInCluster(cluster *api.Cluster, strimziVersion string, kafkaVersion string, ibpVersion string) (bool, error)
	// FindStreamingUnitCountByClusterAndInstanceType returns kafka streaming unit counts per region, cloud provider, cluster id and instance type.
	// Data Plane clusters that are in 'failed' state are not included in the response.
	// Kafkas that are in deleting state won't be included in the count as they no longer consume resources in the data plane cluster.
	FindStreamingUnitCountByClusterAndInstanceType() (KafkaStreamingUnitCountPerClusterList, error)

	// Computes the consumed streaming unit coount per instance of a given cluster.
	// If an instance type if not contained in the returned object, it can be considered that the consumed capacity for that instance type is 0
	ComputeConsumedStreamingUnitCountPerInstanceType(clusterID string) (StreamingUnitCountPerInstanceType, error)
}

func NewClusterService

func NewClusterService(connectionFactory *db.ConnectionFactory, providerFactory clusters.ProviderFactory, kafkaConfig *config.KafkaConfig) ClusterService

NewClusterService creates a new client for the OSD Cluster Service

type ClusterServiceMock

type ClusterServiceMock struct {
	// ApplyResourcesFunc mocks the ApplyResources method.
	ApplyResourcesFunc func(cluster *api.Cluster, resources types.ResourceSet) *serviceError.ServiceError

	// CheckClusterStatusFunc mocks the CheckClusterStatus method.
	CheckClusterStatusFunc func(cluster *api.Cluster) (*api.Cluster, *serviceError.ServiceError)

	// CheckStrimziVersionReadyFunc mocks the CheckStrimziVersionReady method.
	CheckStrimziVersionReadyFunc func(cluster *api.Cluster, strimziVersion string) (bool, error)

	// ComputeConsumedStreamingUnitCountPerInstanceTypeFunc mocks the ComputeConsumedStreamingUnitCountPerInstanceType method.
	ComputeConsumedStreamingUnitCountPerInstanceTypeFunc func(clusterID string) (StreamingUnitCountPerInstanceType, error)

	// ConfigureAndSaveIdentityProviderFunc mocks the ConfigureAndSaveIdentityProvider method.
	ConfigureAndSaveIdentityProviderFunc func(cluster *api.Cluster, identityProviderInfo types.IdentityProviderInfo) (*api.Cluster, *serviceError.ServiceError)

	// CountByStatusFunc mocks the CountByStatus method.
	CountByStatusFunc func(clusterStatuss []api.ClusterStatus) ([]ClusterStatusCount, *serviceError.ServiceError)

	// CreateFunc mocks the Create method.
	CreateFunc func(cluster *api.Cluster) (*api.Cluster, *serviceError.ServiceError)

	// DeleteFunc mocks the Delete method.
	DeleteFunc func(cluster *api.Cluster) (bool, *serviceError.ServiceError)

	// DeleteByClusterIDFunc mocks the DeleteByClusterID method.
	DeleteByClusterIDFunc func(clusterID string) *serviceError.ServiceError

	// DeregisterClusterJobFunc mocks the DeregisterClusterJob method.
	DeregisterClusterJobFunc func(clusterID string) *serviceError.ServiceError

	// FindAllClustersFunc mocks the FindAllClusters method.
	FindAllClustersFunc func(criteria FindClusterCriteria) ([]*api.Cluster, error)

	// FindClusterFunc mocks the FindCluster method.
	FindClusterFunc func(criteria FindClusterCriteria) (*api.Cluster, error)

	// FindClusterByIDFunc mocks the FindClusterByID method.
	FindClusterByIDFunc func(clusterID string) (*api.Cluster, *serviceError.ServiceError)

	// FindKafkaInstanceCountFunc mocks the FindKafkaInstanceCount method.
	FindKafkaInstanceCountFunc func(clusterIDs []string) ([]ResKafkaInstanceCount, error)

	// FindNonEmptyClusterByIDFunc mocks the FindNonEmptyClusterByID method.
	FindNonEmptyClusterByIDFunc func(clusterID string) (*api.Cluster, *serviceError.ServiceError)

	// FindStreamingUnitCountByClusterAndInstanceTypeFunc mocks the FindStreamingUnitCountByClusterAndInstanceType method.
	FindStreamingUnitCountByClusterAndInstanceTypeFunc func() (KafkaStreamingUnitCountPerClusterList, error)

	// GetClientIDFunc mocks the GetClientID method.
	GetClientIDFunc func(clusterID string) (string, error)

	// GetClusterDNSFunc mocks the GetClusterDNS method.
	GetClusterDNSFunc func(clusterID string) (string, *serviceError.ServiceError)

	// GetExternalIDFunc mocks the GetExternalID method.
	GetExternalIDFunc func(clusterID string) (string, *serviceError.ServiceError)

	// HardDeleteByClusterIDFunc mocks the HardDeleteByClusterID method.
	HardDeleteByClusterIDFunc func(clusterID string) *serviceError.ServiceError

	// InstallClusterLoggingFunc mocks the InstallClusterLogging method.
	InstallClusterLoggingFunc func(cluster *api.Cluster, params []ocm.Parameter) (bool, *serviceError.ServiceError)

	// InstallStrimziFunc mocks the InstallStrimzi method.
	InstallStrimziFunc func(cluster *api.Cluster) (bool, *serviceError.ServiceError)

	// IsStrimziKafkaVersionAvailableInClusterFunc mocks the IsStrimziKafkaVersionAvailableInCluster method.
	IsStrimziKafkaVersionAvailableInClusterFunc func(cluster *api.Cluster, strimziVersion string, kafkaVersion string, ibpVersion string) (bool, error)

	// ListByStatusFunc mocks the ListByStatus method.
	ListByStatusFunc func(state api.ClusterStatus) ([]api.Cluster, *serviceError.ServiceError)

	// ListEnterpriseClustersOfAnOrganizationFunc mocks the ListEnterpriseClustersOfAnOrganization method.
	ListEnterpriseClustersOfAnOrganizationFunc func(ctx context.Context) ([]*api.Cluster, *serviceError.ServiceError)

	// ListGroupByProviderAndRegionFunc mocks the ListGroupByProviderAndRegion method.
	ListGroupByProviderAndRegionFunc func(providers []string, regions []string, status []string) ([]*ResGroupCPRegion, *serviceError.ServiceError)

	// ListNonEnterpriseClusterIDsFunc mocks the ListNonEnterpriseClusterIDs method.
	ListNonEnterpriseClusterIDsFunc func() ([]api.Cluster, *serviceError.ServiceError)

	// RegisterClusterJobFunc mocks the RegisterClusterJob method.
	RegisterClusterJobFunc func(clusterRequest *api.Cluster) *serviceError.ServiceError

	// RemoveResourcesFunc mocks the RemoveResources method.
	RemoveResourcesFunc func(cluster *api.Cluster, syncSetName string) *serviceError.ServiceError

	// UpdateFunc mocks the Update method.
	UpdateFunc func(cluster api.Cluster) *serviceError.ServiceError

	// UpdateMultiClusterStatusFunc mocks the UpdateMultiClusterStatus method.
	UpdateMultiClusterStatusFunc func(clusterIDs []string, status api.ClusterStatus) *serviceError.ServiceError

	// UpdateStatusFunc mocks the UpdateStatus method.
	UpdateStatusFunc func(cluster api.Cluster, status api.ClusterStatus) error
	// contains filtered or unexported fields
}

ClusterServiceMock is a mock implementation of ClusterService.

func TestSomethingThatUsesClusterService(t *testing.T) {

	// make and configure a mocked ClusterService
	mockedClusterService := &ClusterServiceMock{
		ApplyResourcesFunc: func(cluster *api.Cluster, resources types.ResourceSet) *serviceError.ServiceError {
			panic("mock out the ApplyResources method")
		},
		CheckClusterStatusFunc: func(cluster *api.Cluster) (*api.Cluster, *serviceError.ServiceError) {
			panic("mock out the CheckClusterStatus method")
		},
		CheckStrimziVersionReadyFunc: func(cluster *api.Cluster, strimziVersion string) (bool, error) {
			panic("mock out the CheckStrimziVersionReady method")
		},
		ComputeConsumedStreamingUnitCountPerInstanceTypeFunc: func(clusterID string) (StreamingUnitCountPerInstanceType, error) {
			panic("mock out the ComputeConsumedStreamingUnitCountPerInstanceType method")
		},
		ConfigureAndSaveIdentityProviderFunc: func(cluster *api.Cluster, identityProviderInfo types.IdentityProviderInfo) (*api.Cluster, *serviceError.ServiceError) {
			panic("mock out the ConfigureAndSaveIdentityProvider method")
		},
		CountByStatusFunc: func(clusterStatuss []api.ClusterStatus) ([]ClusterStatusCount, *serviceError.ServiceError) {
			panic("mock out the CountByStatus method")
		},
		CreateFunc: func(cluster *api.Cluster) (*api.Cluster, *serviceError.ServiceError) {
			panic("mock out the Create method")
		},
		DeleteFunc: func(cluster *api.Cluster) (bool, *serviceError.ServiceError) {
			panic("mock out the Delete method")
		},
		DeleteByClusterIDFunc: func(clusterID string) *serviceError.ServiceError {
			panic("mock out the DeleteByClusterID method")
		},
		DeregisterClusterJobFunc: func(clusterID string) *serviceError.ServiceError {
			panic("mock out the DeregisterClusterJob method")
		},
		FindAllClustersFunc: func(criteria FindClusterCriteria) ([]*api.Cluster, error) {
			panic("mock out the FindAllClusters method")
		},
		FindClusterFunc: func(criteria FindClusterCriteria) (*api.Cluster, error) {
			panic("mock out the FindCluster method")
		},
		FindClusterByIDFunc: func(clusterID string) (*api.Cluster, *serviceError.ServiceError) {
			panic("mock out the FindClusterByID method")
		},
		FindKafkaInstanceCountFunc: func(clusterIDs []string) ([]ResKafkaInstanceCount, error) {
			panic("mock out the FindKafkaInstanceCount method")
		},
		FindNonEmptyClusterByIDFunc: func(clusterID string) (*api.Cluster, *serviceError.ServiceError) {
			panic("mock out the FindNonEmptyClusterByID method")
		},
		FindStreamingUnitCountByClusterAndInstanceTypeFunc: func() (KafkaStreamingUnitCountPerClusterList, error) {
			panic("mock out the FindStreamingUnitCountByClusterAndInstanceType method")
		},
		GetClientIDFunc: func(clusterID string) (string, error) {
			panic("mock out the GetClientID method")
		},
		GetClusterDNSFunc: func(clusterID string) (string, *serviceError.ServiceError) {
			panic("mock out the GetClusterDNS method")
		},
		GetExternalIDFunc: func(clusterID string) (string, *serviceError.ServiceError) {
			panic("mock out the GetExternalID method")
		},
		HardDeleteByClusterIDFunc: func(clusterID string) *serviceError.ServiceError {
			panic("mock out the HardDeleteByClusterID method")
		},
		InstallClusterLoggingFunc: func(cluster *api.Cluster, params []ocm.Parameter) (bool, *serviceError.ServiceError) {
			panic("mock out the InstallClusterLogging method")
		},
		InstallStrimziFunc: func(cluster *api.Cluster) (bool, *serviceError.ServiceError) {
			panic("mock out the InstallStrimzi method")
		},
		IsStrimziKafkaVersionAvailableInClusterFunc: func(cluster *api.Cluster, strimziVersion string, kafkaVersion string, ibpVersion string) (bool, error) {
			panic("mock out the IsStrimziKafkaVersionAvailableInCluster method")
		},
		ListByStatusFunc: func(state api.ClusterStatus) ([]api.Cluster, *serviceError.ServiceError) {
			panic("mock out the ListByStatus method")
		},
		ListEnterpriseClustersOfAnOrganizationFunc: func(ctx context.Context) ([]*api.Cluster, *serviceError.ServiceError) {
			panic("mock out the ListEnterpriseClustersOfAnOrganization method")
		},
		ListGroupByProviderAndRegionFunc: func(providers []string, regions []string, status []string) ([]*ResGroupCPRegion, *serviceError.ServiceError) {
			panic("mock out the ListGroupByProviderAndRegion method")
		},
		ListNonEnterpriseClusterIDsFunc: func() ([]api.Cluster, *serviceError.ServiceError) {
			panic("mock out the ListNonEnterpriseClusterIDs method")
		},
		RegisterClusterJobFunc: func(clusterRequest *api.Cluster) *serviceError.ServiceError {
			panic("mock out the RegisterClusterJob method")
		},
		RemoveResourcesFunc: func(cluster *api.Cluster, syncSetName string) *serviceError.ServiceError {
			panic("mock out the RemoveResources method")
		},
		UpdateFunc: func(cluster api.Cluster) *serviceError.ServiceError {
			panic("mock out the Update method")
		},
		UpdateMultiClusterStatusFunc: func(clusterIDs []string, status api.ClusterStatus) *serviceError.ServiceError {
			panic("mock out the UpdateMultiClusterStatus method")
		},
		UpdateStatusFunc: func(cluster api.Cluster, status api.ClusterStatus) error {
			panic("mock out the UpdateStatus method")
		},
	}

	// use mockedClusterService in code that requires ClusterService
	// and then make assertions.

}

func (*ClusterServiceMock) ApplyResources

func (mock *ClusterServiceMock) ApplyResources(cluster *api.Cluster, resources types.ResourceSet) *serviceError.ServiceError

ApplyResources calls ApplyResourcesFunc.

func (*ClusterServiceMock) ApplyResourcesCalls

func (mock *ClusterServiceMock) ApplyResourcesCalls() []struct {
	Cluster   *api.Cluster
	Resources types.ResourceSet
}

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

len(mockedClusterService.ApplyResourcesCalls())

func (*ClusterServiceMock) CheckClusterStatus

func (mock *ClusterServiceMock) CheckClusterStatus(cluster *api.Cluster) (*api.Cluster, *serviceError.ServiceError)

CheckClusterStatus calls CheckClusterStatusFunc.

func (*ClusterServiceMock) CheckClusterStatusCalls

func (mock *ClusterServiceMock) CheckClusterStatusCalls() []struct {
	Cluster *api.Cluster
}

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

len(mockedClusterService.CheckClusterStatusCalls())

func (*ClusterServiceMock) CheckStrimziVersionReady

func (mock *ClusterServiceMock) CheckStrimziVersionReady(cluster *api.Cluster, strimziVersion string) (bool, error)

CheckStrimziVersionReady calls CheckStrimziVersionReadyFunc.

func (*ClusterServiceMock) CheckStrimziVersionReadyCalls

func (mock *ClusterServiceMock) CheckStrimziVersionReadyCalls() []struct {
	Cluster        *api.Cluster
	StrimziVersion string
}

CheckStrimziVersionReadyCalls gets all the calls that were made to CheckStrimziVersionReady. Check the length with:

len(mockedClusterService.CheckStrimziVersionReadyCalls())

func (*ClusterServiceMock) ComputeConsumedStreamingUnitCountPerInstanceType

func (mock *ClusterServiceMock) ComputeConsumedStreamingUnitCountPerInstanceType(clusterID string) (StreamingUnitCountPerInstanceType, error)

ComputeConsumedStreamingUnitCountPerInstanceType calls ComputeConsumedStreamingUnitCountPerInstanceTypeFunc.

func (*ClusterServiceMock) ComputeConsumedStreamingUnitCountPerInstanceTypeCalls

func (mock *ClusterServiceMock) ComputeConsumedStreamingUnitCountPerInstanceTypeCalls() []struct {
	ClusterID string
}

ComputeConsumedStreamingUnitCountPerInstanceTypeCalls gets all the calls that were made to ComputeConsumedStreamingUnitCountPerInstanceType. Check the length with:

len(mockedClusterService.ComputeConsumedStreamingUnitCountPerInstanceTypeCalls())

func (*ClusterServiceMock) ConfigureAndSaveIdentityProvider

func (mock *ClusterServiceMock) ConfigureAndSaveIdentityProvider(cluster *api.Cluster, identityProviderInfo types.IdentityProviderInfo) (*api.Cluster, *serviceError.ServiceError)

ConfigureAndSaveIdentityProvider calls ConfigureAndSaveIdentityProviderFunc.

func (*ClusterServiceMock) ConfigureAndSaveIdentityProviderCalls

func (mock *ClusterServiceMock) ConfigureAndSaveIdentityProviderCalls() []struct {
	Cluster              *api.Cluster
	IdentityProviderInfo types.IdentityProviderInfo
}

ConfigureAndSaveIdentityProviderCalls gets all the calls that were made to ConfigureAndSaveIdentityProvider. Check the length with:

len(mockedClusterService.ConfigureAndSaveIdentityProviderCalls())

func (*ClusterServiceMock) CountByStatus

func (mock *ClusterServiceMock) CountByStatus(clusterStatuss []api.ClusterStatus) ([]ClusterStatusCount, *serviceError.ServiceError)

CountByStatus calls CountByStatusFunc.

func (*ClusterServiceMock) CountByStatusCalls

func (mock *ClusterServiceMock) CountByStatusCalls() []struct {
	ClusterStatuss []api.ClusterStatus
}

CountByStatusCalls gets all the calls that were made to CountByStatus. Check the length with:

len(mockedClusterService.CountByStatusCalls())

func (*ClusterServiceMock) Create

func (mock *ClusterServiceMock) Create(cluster *api.Cluster) (*api.Cluster, *serviceError.ServiceError)

Create calls CreateFunc.

func (*ClusterServiceMock) CreateCalls

func (mock *ClusterServiceMock) CreateCalls() []struct {
	Cluster *api.Cluster
}

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

len(mockedClusterService.CreateCalls())

func (*ClusterServiceMock) Delete

func (mock *ClusterServiceMock) Delete(cluster *api.Cluster) (bool, *serviceError.ServiceError)

Delete calls DeleteFunc.

func (*ClusterServiceMock) DeleteByClusterID

func (mock *ClusterServiceMock) DeleteByClusterID(clusterID string) *serviceError.ServiceError

DeleteByClusterID calls DeleteByClusterIDFunc.

func (*ClusterServiceMock) DeleteByClusterIDCalls

func (mock *ClusterServiceMock) DeleteByClusterIDCalls() []struct {
	ClusterID string
}

DeleteByClusterIDCalls gets all the calls that were made to DeleteByClusterID. Check the length with:

len(mockedClusterService.DeleteByClusterIDCalls())

func (*ClusterServiceMock) DeleteCalls

func (mock *ClusterServiceMock) DeleteCalls() []struct {
	Cluster *api.Cluster
}

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

len(mockedClusterService.DeleteCalls())

func (*ClusterServiceMock) DeregisterClusterJob

func (mock *ClusterServiceMock) DeregisterClusterJob(clusterID string) *serviceError.ServiceError

DeregisterClusterJob calls DeregisterClusterJobFunc.

func (*ClusterServiceMock) DeregisterClusterJobCalls

func (mock *ClusterServiceMock) DeregisterClusterJobCalls() []struct {
	ClusterID string
}

DeregisterClusterJobCalls gets all the calls that were made to DeregisterClusterJob. Check the length with:

len(mockedClusterService.DeregisterClusterJobCalls())

func (*ClusterServiceMock) FindAllClusters

func (mock *ClusterServiceMock) FindAllClusters(criteria FindClusterCriteria) ([]*api.Cluster, error)

FindAllClusters calls FindAllClustersFunc.

func (*ClusterServiceMock) FindAllClustersCalls

func (mock *ClusterServiceMock) FindAllClustersCalls() []struct {
	Criteria FindClusterCriteria
}

FindAllClustersCalls gets all the calls that were made to FindAllClusters. Check the length with:

len(mockedClusterService.FindAllClustersCalls())

func (*ClusterServiceMock) FindCluster

func (mock *ClusterServiceMock) FindCluster(criteria FindClusterCriteria) (*api.Cluster, error)

FindCluster calls FindClusterFunc.

func (*ClusterServiceMock) FindClusterByID

func (mock *ClusterServiceMock) FindClusterByID(clusterID string) (*api.Cluster, *serviceError.ServiceError)

FindClusterByID calls FindClusterByIDFunc.

func (*ClusterServiceMock) FindClusterByIDCalls

func (mock *ClusterServiceMock) FindClusterByIDCalls() []struct {
	ClusterID string
}

FindClusterByIDCalls gets all the calls that were made to FindClusterByID. Check the length with:

len(mockedClusterService.FindClusterByIDCalls())

func (*ClusterServiceMock) FindClusterCalls

func (mock *ClusterServiceMock) FindClusterCalls() []struct {
	Criteria FindClusterCriteria
}

FindClusterCalls gets all the calls that were made to FindCluster. Check the length with:

len(mockedClusterService.FindClusterCalls())

func (*ClusterServiceMock) FindKafkaInstanceCount

func (mock *ClusterServiceMock) FindKafkaInstanceCount(clusterIDs []string) ([]ResKafkaInstanceCount, error)

FindKafkaInstanceCount calls FindKafkaInstanceCountFunc.

func (*ClusterServiceMock) FindKafkaInstanceCountCalls

func (mock *ClusterServiceMock) FindKafkaInstanceCountCalls() []struct {
	ClusterIDs []string
}

FindKafkaInstanceCountCalls gets all the calls that were made to FindKafkaInstanceCount. Check the length with:

len(mockedClusterService.FindKafkaInstanceCountCalls())

func (*ClusterServiceMock) FindNonEmptyClusterByID

func (mock *ClusterServiceMock) FindNonEmptyClusterByID(clusterID string) (*api.Cluster, *serviceError.ServiceError)

FindNonEmptyClusterByID calls FindNonEmptyClusterByIDFunc.

func (*ClusterServiceMock) FindNonEmptyClusterByIDCalls

func (mock *ClusterServiceMock) FindNonEmptyClusterByIDCalls() []struct {
	ClusterID string
}

FindNonEmptyClusterByIDCalls gets all the calls that were made to FindNonEmptyClusterByID. Check the length with:

len(mockedClusterService.FindNonEmptyClusterByIDCalls())

func (*ClusterServiceMock) FindStreamingUnitCountByClusterAndInstanceType

func (mock *ClusterServiceMock) FindStreamingUnitCountByClusterAndInstanceType() (KafkaStreamingUnitCountPerClusterList, error)

FindStreamingUnitCountByClusterAndInstanceType calls FindStreamingUnitCountByClusterAndInstanceTypeFunc.

func (*ClusterServiceMock) FindStreamingUnitCountByClusterAndInstanceTypeCalls

func (mock *ClusterServiceMock) FindStreamingUnitCountByClusterAndInstanceTypeCalls() []struct {
}

FindStreamingUnitCountByClusterAndInstanceTypeCalls gets all the calls that were made to FindStreamingUnitCountByClusterAndInstanceType. Check the length with:

len(mockedClusterService.FindStreamingUnitCountByClusterAndInstanceTypeCalls())

func (*ClusterServiceMock) GetClientID

func (mock *ClusterServiceMock) GetClientID(clusterID string) (string, error)

GetClientID calls GetClientIDFunc.

func (*ClusterServiceMock) GetClientIDCalls

func (mock *ClusterServiceMock) GetClientIDCalls() []struct {
	ClusterID string
}

GetClientIDCalls gets all the calls that were made to GetClientID. Check the length with:

len(mockedClusterService.GetClientIDCalls())

func (*ClusterServiceMock) GetClusterDNS

func (mock *ClusterServiceMock) GetClusterDNS(clusterID string) (string, *serviceError.ServiceError)

GetClusterDNS calls GetClusterDNSFunc.

func (*ClusterServiceMock) GetClusterDNSCalls

func (mock *ClusterServiceMock) GetClusterDNSCalls() []struct {
	ClusterID string
}

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

len(mockedClusterService.GetClusterDNSCalls())

func (*ClusterServiceMock) GetExternalID

func (mock *ClusterServiceMock) GetExternalID(clusterID string) (string, *serviceError.ServiceError)

GetExternalID calls GetExternalIDFunc.

func (*ClusterServiceMock) GetExternalIDCalls

func (mock *ClusterServiceMock) GetExternalIDCalls() []struct {
	ClusterID string
}

GetExternalIDCalls gets all the calls that were made to GetExternalID. Check the length with:

len(mockedClusterService.GetExternalIDCalls())

func (*ClusterServiceMock) HardDeleteByClusterID

func (mock *ClusterServiceMock) HardDeleteByClusterID(clusterID string) *serviceError.ServiceError

HardDeleteByClusterID calls HardDeleteByClusterIDFunc.

func (*ClusterServiceMock) HardDeleteByClusterIDCalls

func (mock *ClusterServiceMock) HardDeleteByClusterIDCalls() []struct {
	ClusterID string
}

HardDeleteByClusterIDCalls gets all the calls that were made to HardDeleteByClusterID. Check the length with:

len(mockedClusterService.HardDeleteByClusterIDCalls())

func (*ClusterServiceMock) InstallClusterLogging

func (mock *ClusterServiceMock) InstallClusterLogging(cluster *api.Cluster, params []ocm.Parameter) (bool, *serviceError.ServiceError)

InstallClusterLogging calls InstallClusterLoggingFunc.

func (*ClusterServiceMock) InstallClusterLoggingCalls

func (mock *ClusterServiceMock) InstallClusterLoggingCalls() []struct {
	Cluster *api.Cluster
	Params  []ocm.Parameter
}

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

len(mockedClusterService.InstallClusterLoggingCalls())

func (*ClusterServiceMock) InstallStrimzi

func (mock *ClusterServiceMock) InstallStrimzi(cluster *api.Cluster) (bool, *serviceError.ServiceError)

InstallStrimzi calls InstallStrimziFunc.

func (*ClusterServiceMock) InstallStrimziCalls

func (mock *ClusterServiceMock) InstallStrimziCalls() []struct {
	Cluster *api.Cluster
}

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

len(mockedClusterService.InstallStrimziCalls())

func (*ClusterServiceMock) IsStrimziKafkaVersionAvailableInCluster

func (mock *ClusterServiceMock) IsStrimziKafkaVersionAvailableInCluster(cluster *api.Cluster, strimziVersion string, kafkaVersion string, ibpVersion string) (bool, error)

IsStrimziKafkaVersionAvailableInCluster calls IsStrimziKafkaVersionAvailableInClusterFunc.

func (*ClusterServiceMock) IsStrimziKafkaVersionAvailableInClusterCalls

func (mock *ClusterServiceMock) IsStrimziKafkaVersionAvailableInClusterCalls() []struct {
	Cluster        *api.Cluster
	StrimziVersion string
	KafkaVersion   string
	IbpVersion     string
}

IsStrimziKafkaVersionAvailableInClusterCalls gets all the calls that were made to IsStrimziKafkaVersionAvailableInCluster. Check the length with:

len(mockedClusterService.IsStrimziKafkaVersionAvailableInClusterCalls())

func (*ClusterServiceMock) ListByStatus

func (mock *ClusterServiceMock) ListByStatus(state api.ClusterStatus) ([]api.Cluster, *serviceError.ServiceError)

ListByStatus calls ListByStatusFunc.

func (*ClusterServiceMock) ListByStatusCalls

func (mock *ClusterServiceMock) ListByStatusCalls() []struct {
	State api.ClusterStatus
}

ListByStatusCalls gets all the calls that were made to ListByStatus. Check the length with:

len(mockedClusterService.ListByStatusCalls())

func (*ClusterServiceMock) ListEnterpriseClustersOfAnOrganization

func (mock *ClusterServiceMock) ListEnterpriseClustersOfAnOrganization(ctx context.Context) ([]*api.Cluster, *serviceError.ServiceError)

ListEnterpriseClustersOfAnOrganization calls ListEnterpriseClustersOfAnOrganizationFunc.

func (*ClusterServiceMock) ListEnterpriseClustersOfAnOrganizationCalls

func (mock *ClusterServiceMock) ListEnterpriseClustersOfAnOrganizationCalls() []struct {
	Ctx context.Context
}

ListEnterpriseClustersOfAnOrganizationCalls gets all the calls that were made to ListEnterpriseClustersOfAnOrganization. Check the length with:

len(mockedClusterService.ListEnterpriseClustersOfAnOrganizationCalls())

func (*ClusterServiceMock) ListGroupByProviderAndRegion

func (mock *ClusterServiceMock) ListGroupByProviderAndRegion(providers []string, regions []string, status []string) ([]*ResGroupCPRegion, *serviceError.ServiceError)

ListGroupByProviderAndRegion calls ListGroupByProviderAndRegionFunc.

func (*ClusterServiceMock) ListGroupByProviderAndRegionCalls

func (mock *ClusterServiceMock) ListGroupByProviderAndRegionCalls() []struct {
	Providers []string
	Regions   []string
	Status    []string
}

ListGroupByProviderAndRegionCalls gets all the calls that were made to ListGroupByProviderAndRegion. Check the length with:

len(mockedClusterService.ListGroupByProviderAndRegionCalls())

func (*ClusterServiceMock) ListNonEnterpriseClusterIDs

func (mock *ClusterServiceMock) ListNonEnterpriseClusterIDs() ([]api.Cluster, *serviceError.ServiceError)

ListNonEnterpriseClusterIDs calls ListNonEnterpriseClusterIDsFunc.

func (*ClusterServiceMock) ListNonEnterpriseClusterIDsCalls

func (mock *ClusterServiceMock) ListNonEnterpriseClusterIDsCalls() []struct {
}

ListNonEnterpriseClusterIDsCalls gets all the calls that were made to ListNonEnterpriseClusterIDs. Check the length with:

len(mockedClusterService.ListNonEnterpriseClusterIDsCalls())

func (*ClusterServiceMock) RegisterClusterJob

func (mock *ClusterServiceMock) RegisterClusterJob(clusterRequest *api.Cluster) *serviceError.ServiceError

RegisterClusterJob calls RegisterClusterJobFunc.

func (*ClusterServiceMock) RegisterClusterJobCalls

func (mock *ClusterServiceMock) RegisterClusterJobCalls() []struct {
	ClusterRequest *api.Cluster
}

RegisterClusterJobCalls gets all the calls that were made to RegisterClusterJob. Check the length with:

len(mockedClusterService.RegisterClusterJobCalls())

func (*ClusterServiceMock) RemoveResources

func (mock *ClusterServiceMock) RemoveResources(cluster *api.Cluster, syncSetName string) *serviceError.ServiceError

RemoveResources calls RemoveResourcesFunc.

func (*ClusterServiceMock) RemoveResourcesCalls

func (mock *ClusterServiceMock) RemoveResourcesCalls() []struct {
	Cluster     *api.Cluster
	SyncSetName string
}

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

len(mockedClusterService.RemoveResourcesCalls())

func (*ClusterServiceMock) Update

func (mock *ClusterServiceMock) Update(cluster api.Cluster) *serviceError.ServiceError

Update calls UpdateFunc.

func (*ClusterServiceMock) UpdateCalls

func (mock *ClusterServiceMock) UpdateCalls() []struct {
	Cluster api.Cluster
}

UpdateCalls gets all the calls that were made to Update. Check the length with:

len(mockedClusterService.UpdateCalls())

func (*ClusterServiceMock) UpdateMultiClusterStatus

func (mock *ClusterServiceMock) UpdateMultiClusterStatus(clusterIDs []string, status api.ClusterStatus) *serviceError.ServiceError

UpdateMultiClusterStatus calls UpdateMultiClusterStatusFunc.

func (*ClusterServiceMock) UpdateMultiClusterStatusCalls

func (mock *ClusterServiceMock) UpdateMultiClusterStatusCalls() []struct {
	ClusterIDs []string
	Status     api.ClusterStatus
}

UpdateMultiClusterStatusCalls gets all the calls that were made to UpdateMultiClusterStatus. Check the length with:

len(mockedClusterService.UpdateMultiClusterStatusCalls())

func (*ClusterServiceMock) UpdateStatus

func (mock *ClusterServiceMock) UpdateStatus(cluster api.Cluster, status api.ClusterStatus) error

UpdateStatus calls UpdateStatusFunc.

func (*ClusterServiceMock) UpdateStatusCalls

func (mock *ClusterServiceMock) UpdateStatusCalls() []struct {
	Cluster api.Cluster
	Status  api.ClusterStatus
}

UpdateStatusCalls gets all the calls that were made to UpdateStatus. Check the length with:

len(mockedClusterService.UpdateStatusCalls())

type ClusterSizeCountPerInstanceType

type ClusterSizeCountPerInstanceType struct {
	SizeId       string
	Count        int64
	InstanceType string
}

type ClusterStatusCount

type ClusterStatusCount struct {
	Status api.ClusterStatus
	Count  int
}

type DataPlaneClusterService

type DataPlaneClusterService interface {
	UpdateDataPlaneClusterStatus(ctx context.Context, clusterID string, status *dbapi.DataPlaneClusterStatus) *errors.ServiceError
	GetDataPlaneClusterConfig(ctx context.Context, clusterID string) (*dbapi.DataPlaneClusterConfig, *errors.ServiceError)
}

type DataPlaneClusterServiceMock

type DataPlaneClusterServiceMock struct {
	// GetDataPlaneClusterConfigFunc mocks the GetDataPlaneClusterConfig method.
	GetDataPlaneClusterConfigFunc func(ctx context.Context, clusterID string) (*dbapi.DataPlaneClusterConfig, *serviceError.ServiceError)

	// UpdateDataPlaneClusterStatusFunc mocks the UpdateDataPlaneClusterStatus method.
	UpdateDataPlaneClusterStatusFunc func(ctx context.Context, clusterID string, status *dbapi.DataPlaneClusterStatus) *serviceError.ServiceError
	// contains filtered or unexported fields
}

DataPlaneClusterServiceMock is a mock implementation of DataPlaneClusterService.

func TestSomethingThatUsesDataPlaneClusterService(t *testing.T) {

	// make and configure a mocked DataPlaneClusterService
	mockedDataPlaneClusterService := &DataPlaneClusterServiceMock{
		GetDataPlaneClusterConfigFunc: func(ctx context.Context, clusterID string) (*dbapi.DataPlaneClusterConfig, *serviceError.ServiceError) {
			panic("mock out the GetDataPlaneClusterConfig method")
		},
		UpdateDataPlaneClusterStatusFunc: func(ctx context.Context, clusterID string, status *dbapi.DataPlaneClusterStatus) *serviceError.ServiceError {
			panic("mock out the UpdateDataPlaneClusterStatus method")
		},
	}

	// use mockedDataPlaneClusterService in code that requires DataPlaneClusterService
	// and then make assertions.

}

func (*DataPlaneClusterServiceMock) GetDataPlaneClusterConfig

func (mock *DataPlaneClusterServiceMock) GetDataPlaneClusterConfig(ctx context.Context, clusterID string) (*dbapi.DataPlaneClusterConfig, *serviceError.ServiceError)

GetDataPlaneClusterConfig calls GetDataPlaneClusterConfigFunc.

func (*DataPlaneClusterServiceMock) GetDataPlaneClusterConfigCalls

func (mock *DataPlaneClusterServiceMock) GetDataPlaneClusterConfigCalls() []struct {
	Ctx       context.Context
	ClusterID string
}

GetDataPlaneClusterConfigCalls gets all the calls that were made to GetDataPlaneClusterConfig. Check the length with:

len(mockedDataPlaneClusterService.GetDataPlaneClusterConfigCalls())

func (*DataPlaneClusterServiceMock) UpdateDataPlaneClusterStatus

func (mock *DataPlaneClusterServiceMock) UpdateDataPlaneClusterStatus(ctx context.Context, clusterID string, status *dbapi.DataPlaneClusterStatus) *serviceError.ServiceError

UpdateDataPlaneClusterStatus calls UpdateDataPlaneClusterStatusFunc.

func (*DataPlaneClusterServiceMock) UpdateDataPlaneClusterStatusCalls

func (mock *DataPlaneClusterServiceMock) UpdateDataPlaneClusterStatusCalls() []struct {
	Ctx       context.Context
	ClusterID string
	Status    *dbapi.DataPlaneClusterStatus
}

UpdateDataPlaneClusterStatusCalls gets all the calls that were made to UpdateDataPlaneClusterStatus. Check the length with:

len(mockedDataPlaneClusterService.UpdateDataPlaneClusterStatusCalls())

type DataPlaneKafkaService

type DataPlaneKafkaService interface {
	UpdateDataPlaneKafkaService(ctx context.Context, clusterID string, status []*dbapi.DataPlaneKafkaStatus) *serviceError.ServiceError
}

type DataPlaneKafkaServiceMock

type DataPlaneKafkaServiceMock struct {
	// UpdateDataPlaneKafkaServiceFunc mocks the UpdateDataPlaneKafkaService method.
	UpdateDataPlaneKafkaServiceFunc func(ctx context.Context, clusterID string, status []*dbapi.DataPlaneKafkaStatus) *serviceError.ServiceError
	// contains filtered or unexported fields
}

DataPlaneKafkaServiceMock is a mock implementation of DataPlaneKafkaService.

func TestSomethingThatUsesDataPlaneKafkaService(t *testing.T) {

	// make and configure a mocked DataPlaneKafkaService
	mockedDataPlaneKafkaService := &DataPlaneKafkaServiceMock{
		UpdateDataPlaneKafkaServiceFunc: func(ctx context.Context, clusterID string, status []*dbapi.DataPlaneKafkaStatus) *serviceError.ServiceError {
			panic("mock out the UpdateDataPlaneKafkaService method")
		},
	}

	// use mockedDataPlaneKafkaService in code that requires DataPlaneKafkaService
	// and then make assertions.

}

func (*DataPlaneKafkaServiceMock) UpdateDataPlaneKafkaService

func (mock *DataPlaneKafkaServiceMock) UpdateDataPlaneKafkaService(ctx context.Context, clusterID string, status []*dbapi.DataPlaneKafkaStatus) *serviceError.ServiceError

UpdateDataPlaneKafkaService calls UpdateDataPlaneKafkaServiceFunc.

func (*DataPlaneKafkaServiceMock) UpdateDataPlaneKafkaServiceCalls

func (mock *DataPlaneKafkaServiceMock) UpdateDataPlaneKafkaServiceCalls() []struct {
	Ctx       context.Context
	ClusterID string
	Status    []*dbapi.DataPlaneKafkaStatus
}

UpdateDataPlaneKafkaServiceCalls gets all the calls that were made to UpdateDataPlaneKafkaService. Check the length with:

len(mockedDataPlaneKafkaService.UpdateDataPlaneKafkaServiceCalls())

type FindClusterCriteria

type FindClusterCriteria struct {
	Provider              string
	Region                string
	MultiAZ               bool
	Status                api.ClusterStatus
	SupportedInstanceType string
	ExternalID            string
}

type FirstReadyCluster

type FirstReadyCluster struct {
	ClusterService ClusterService
	// contains filtered or unexported fields
}

FirstReadyCluster finds and returns the first cluster with Ready status

func (*FirstReadyCluster) FindCluster

func (f *FirstReadyCluster) FindCluster(kafka *dbapi.KafkaRequest) (*api.Cluster, error)

type FirstReadyWithCapacity

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

FirstReadyWithCapacity finds and returns the first cluster in a Ready status with remaining capacity

func (*FirstReadyWithCapacity) FindCluster

func (f *FirstReadyWithCapacity) FindCluster(kafka *dbapi.KafkaRequest) (*api.Cluster, error)

type FirstSchedulableWithinLimit

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

FirstSchedulableWithinLimit finds and returns the first cluster which is schedulable and the number of Kafka clusters associated with it is within the defined limit.

func (*FirstSchedulableWithinLimit) FindCluster

func (f *FirstSchedulableWithinLimit) FindCluster(kafka *dbapi.KafkaRequest) (*api.Cluster, error)

type KafkaComponentVersions

type KafkaComponentVersions struct {
	ID                     string
	ClusterID              string
	DesiredStrimziVersion  string
	ActualStrimziVersion   string
	StrimziUpgrading       bool
	DesiredKafkaVersion    string
	ActualKafkaVersion     string
	KafkaUpgrading         bool
	DesiredKafkaIBPVersion string
	ActualKafkaIBPVersion  string
	KafkaIBPUpgrading      bool
}

type KafkaPerClusterCount

type KafkaPerClusterCount struct {
	Region        string
	InstanceType  string
	ClusterId     string
	Count         int32
	CloudProvider string
	SizeId        string
}

KafkaPerClusterCount is a struct used to query the database using a "group by" clause

type KafkaRoutesAction

type KafkaRoutesAction string
const (
	KafkaRoutesActionCreate KafkaRoutesAction = "CREATE"
	KafkaRoutesActionDelete KafkaRoutesAction = "DELETE"
)

func (KafkaRoutesAction) String

func (a KafkaRoutesAction) String() string

type KafkaService

type KafkaService interface {
	// PrepareKafkaRequest sets any required information (i.e. bootstrap server host, sso client id and secret)
	// to the Kafka Request record in the database. The kafka request will also be updated with an updated_at
	// timestamp and the corresponding cluster identifier.
	PrepareKafkaRequest(kafkaRequest *dbapi.KafkaRequest) *errors.ServiceError
	// Get method will retrieve the kafkaRequest instance that the give ctx has access to from the database.
	// This should be used when you want to make sure the result is filtered based on the request context.
	Get(ctx context.Context, id string) (*dbapi.KafkaRequest, *errors.ServiceError)
	// GetByID method will retrieve the KafkaRequest instance from the database without checking any permissions.
	// You should only use this if you are sure permission check is not required.
	GetByID(id string) (*dbapi.KafkaRequest, *errors.ServiceError)
	// Delete cleans up all dependencies for a Kafka request and soft deletes the Kafka Request record from the database.
	// The Kafka Request in the database will be updated with a deleted_at timestamp.
	Delete(*dbapi.KafkaRequest) *errors.ServiceError
	List(ctx context.Context, listArgs *services.ListArguments) (dbapi.KafkaList, *api.PagingMeta, *errors.ServiceError)
	// Lists all kafkas. As this returns all Kafka requests without need for authentication, this should only be used for internal purposes
	ListAll() (dbapi.KafkaList, *errors.ServiceError)
	ListKafkasToBePromoted() ([]*dbapi.KafkaRequest, *errors.ServiceError)
	GetManagedKafkaByClusterID(clusterID string) ([]managedkafka.ManagedKafka, *errors.ServiceError)
	// GenerateReservedManagedKafkasByClusterID returns a list of reserved managed
	// kafkas for a given clusterID. The number of generated reserved managed
	// kafkas in the cluster is the sum of the specified number of reserved
	// instances among all instance types supported by the cluster.
	// If the cluster is not in ready status the result is an empty list.
	// Generated kafka names have the following naming schema:
	// reserved-kafka-<instance_type>-<kafka_number> where kafka_number goes from
	// 1..<num_reserved_instances>_for_the_given_instance_type>
	// Each generated reserved kafka has a namespace equal to its name
	GenerateReservedManagedKafkasByClusterID(clusterID string) ([]managedkafka.ManagedKafka, *errors.ServiceError)
	RegisterKafkaJob(kafkaRequest *dbapi.KafkaRequest) *errors.ServiceError
	ListByStatus(status ...constants.KafkaStatus) ([]*dbapi.KafkaRequest, *errors.ServiceError)
	// UpdateStatus change the status of the Kafka cluster
	// The returned boolean is to be used to know if the update has been tried or not. An update is not tried if the
	// original status is 'deprovision' (cluster in deprovision state can't be change state) or if the final status is the
	// same as the original status. The error will contain any error encountered when attempting to update or the reason
	// why no attempt has been done
	UpdateStatus(id string, status constants.KafkaStatus) (bool, *errors.ServiceError)
	Update(kafkaRequest *dbapi.KafkaRequest) *errors.ServiceError
	// Updates() updates the given fields of a kafka. This takes in a map so that even zero-fields can be updated.
	// Use this only when you want to update the multiple columns that may contain zero-fields, otherwise use the `KafkaService.Update()` method.
	// See https://gorm.io/docs/update.html#Updates-multiple-columns for more info
	Updates(kafkaRequest *dbapi.KafkaRequest, values map[string]interface{}) *errors.ServiceError
	ChangeKafkaCNAMErecords(kafkaRequest *dbapi.KafkaRequest, action KafkaRoutesAction) (*route53.ChangeResourceRecordSetsOutput, *errors.ServiceError)
	GetCNAMERecordStatus(kafkaRequest *dbapi.KafkaRequest) (*CNameRecordStatus, error)
	AssignInstanceType(owner string, organisationID string) (types.KafkaInstanceType, *errors.ServiceError)
	RegisterKafkaDeprovisionJob(ctx context.Context, id string) *errors.ServiceError
	// DeprovisionKafkaForUsers registers all kafkas for deprovisioning given the list of owners
	DeprovisionKafkaForUsers(users []string) *errors.ServiceError
	DeprovisionExpiredKafkas() *errors.ServiceError
	CountByStatus(status []constants.KafkaStatus) ([]KafkaStatusCount, error)
	ListKafkasWithRoutesNotCreated() ([]*dbapi.KafkaRequest, *errors.ServiceError)
	VerifyAndUpdateKafkaAdmin(ctx context.Context, kafkaRequest *dbapi.KafkaRequest) *errors.ServiceError
	ListComponentVersions() ([]KafkaComponentVersions, error)
	HasAvailableCapacityInRegion(kafkaRequest *dbapi.KafkaRequest) (bool, *errors.ServiceError)
	// GetAvailableSizesInRegion returns a list of ids of the Kafka instance sizes that can still be created according to the specified criteria
	GetAvailableSizesInRegion(criteria *FindClusterCriteria) ([]string, *errors.ServiceError)
	ValidateBillingAccount(externalId string, instanceType types.KafkaInstanceType, kafkaBillingModelID string, billingCloudAccountId string, marketplace *string) *errors.ServiceError
	AssignBootstrapServerHost(kafkaRequest *dbapi.KafkaRequest) error
	// IsQuotaEntitlementActive checks if the user/organisation have an active entitlement to the quota
	// used by the given Kafka instance.
	//
	// It returns true if the user has an active quota entitlement and false if not.
	// It returns false and an error if it encounters any issues while trying to check the quota entitlement status.
	IsQuotaEntitlementActive(kafkaRequest *dbapi.KafkaRequest) (bool, error)
	// ManagedKafkasRoutesTLSCertificate manages tls certificate for the given kafka.
	// The operation will generate a new certificate if none exists, or renews the existing one.
	// The operation is done only for Kafkas that are alive / active as indicated by the "statusesOfKafkaThatAreNotActive" slice
	ManagedKafkasRoutesTLSCertificate(kafkaRequest *dbapi.KafkaRequest) error
}

type KafkaServiceMock

type KafkaServiceMock struct {
	// AssignBootstrapServerHostFunc mocks the AssignBootstrapServerHost method.
	AssignBootstrapServerHostFunc func(kafkaRequest *dbapi.KafkaRequest) error

	// AssignInstanceTypeFunc mocks the AssignInstanceType method.
	AssignInstanceTypeFunc func(owner string, organisationID string) (kafkaTypes.KafkaInstanceType, *serviceError.ServiceError)

	// ChangeKafkaCNAMErecordsFunc mocks the ChangeKafkaCNAMErecords method.
	ChangeKafkaCNAMErecordsFunc func(kafkaRequest *dbapi.KafkaRequest, action KafkaRoutesAction) (*route53.ChangeResourceRecordSetsOutput, *serviceError.ServiceError)

	// CountByStatusFunc mocks the CountByStatus method.
	CountByStatusFunc func(status []constants.KafkaStatus) ([]KafkaStatusCount, error)

	// DeleteFunc mocks the Delete method.
	DeleteFunc func(kafkaRequest *dbapi.KafkaRequest) *serviceError.ServiceError

	// DeprovisionExpiredKafkasFunc mocks the DeprovisionExpiredKafkas method.
	DeprovisionExpiredKafkasFunc func() *serviceError.ServiceError

	// DeprovisionKafkaForUsersFunc mocks the DeprovisionKafkaForUsers method.
	DeprovisionKafkaForUsersFunc func(users []string) *serviceError.ServiceError

	// GenerateReservedManagedKafkasByClusterIDFunc mocks the GenerateReservedManagedKafkasByClusterID method.
	GenerateReservedManagedKafkasByClusterIDFunc func(clusterID string) ([]managedkafka.ManagedKafka, *serviceError.ServiceError)

	// GetFunc mocks the Get method.
	GetFunc func(ctx context.Context, id string) (*dbapi.KafkaRequest, *serviceError.ServiceError)

	// GetAvailableSizesInRegionFunc mocks the GetAvailableSizesInRegion method.
	GetAvailableSizesInRegionFunc func(criteria *FindClusterCriteria) ([]string, *serviceError.ServiceError)

	// GetByIDFunc mocks the GetByID method.
	GetByIDFunc func(id string) (*dbapi.KafkaRequest, *serviceError.ServiceError)

	// GetCNAMERecordStatusFunc mocks the GetCNAMERecordStatus method.
	GetCNAMERecordStatusFunc func(kafkaRequest *dbapi.KafkaRequest) (*CNameRecordStatus, error)

	// GetManagedKafkaByClusterIDFunc mocks the GetManagedKafkaByClusterID method.
	GetManagedKafkaByClusterIDFunc func(clusterID string) ([]managedkafka.ManagedKafka, *serviceError.ServiceError)

	// HasAvailableCapacityInRegionFunc mocks the HasAvailableCapacityInRegion method.
	HasAvailableCapacityInRegionFunc func(kafkaRequest *dbapi.KafkaRequest) (bool, *serviceError.ServiceError)

	// IsQuotaEntitlementActiveFunc mocks the IsQuotaEntitlementActive method.
	IsQuotaEntitlementActiveFunc func(kafkaRequest *dbapi.KafkaRequest) (bool, error)

	// ListFunc mocks the List method.
	ListFunc func(ctx context.Context, listArgs *services.ListArguments) (dbapi.KafkaList, *api.PagingMeta, *serviceError.ServiceError)

	// ListAllFunc mocks the ListAll method.
	ListAllFunc func() (dbapi.KafkaList, *serviceError.ServiceError)

	// ListByStatusFunc mocks the ListByStatus method.
	ListByStatusFunc func(status ...constants.KafkaStatus) ([]*dbapi.KafkaRequest, *serviceError.ServiceError)

	// ListComponentVersionsFunc mocks the ListComponentVersions method.
	ListComponentVersionsFunc func() ([]KafkaComponentVersions, error)

	// ListKafkasToBePromotedFunc mocks the ListKafkasToBePromoted method.
	ListKafkasToBePromotedFunc func() ([]*dbapi.KafkaRequest, *serviceError.ServiceError)

	// ListKafkasWithRoutesNotCreatedFunc mocks the ListKafkasWithRoutesNotCreated method.
	ListKafkasWithRoutesNotCreatedFunc func() ([]*dbapi.KafkaRequest, *serviceError.ServiceError)

	// ManagedKafkasRoutesTLSCertificateFunc mocks the ManagedKafkasRoutesTLSCertificate method.
	ManagedKafkasRoutesTLSCertificateFunc func(kafkaRequest *dbapi.KafkaRequest) error

	// PrepareKafkaRequestFunc mocks the PrepareKafkaRequest method.
	PrepareKafkaRequestFunc func(kafkaRequest *dbapi.KafkaRequest) *serviceError.ServiceError

	// RegisterKafkaDeprovisionJobFunc mocks the RegisterKafkaDeprovisionJob method.
	RegisterKafkaDeprovisionJobFunc func(ctx context.Context, id string) *serviceError.ServiceError

	// RegisterKafkaJobFunc mocks the RegisterKafkaJob method.
	RegisterKafkaJobFunc func(kafkaRequest *dbapi.KafkaRequest) *serviceError.ServiceError

	// UpdateFunc mocks the Update method.
	UpdateFunc func(kafkaRequest *dbapi.KafkaRequest) *serviceError.ServiceError

	// UpdateStatusFunc mocks the UpdateStatus method.
	UpdateStatusFunc func(id string, status constants.KafkaStatus) (bool, *serviceError.ServiceError)

	// UpdatesFunc mocks the Updates method.
	UpdatesFunc func(kafkaRequest *dbapi.KafkaRequest, values map[string]interface{}) *serviceError.ServiceError

	// ValidateBillingAccountFunc mocks the ValidateBillingAccount method.
	ValidateBillingAccountFunc func(externalId string, instanceType kafkaTypes.KafkaInstanceType, kafkaBillingModelID string, billingCloudAccountId string, marketplace *string) *serviceError.ServiceError

	// VerifyAndUpdateKafkaAdminFunc mocks the VerifyAndUpdateKafkaAdmin method.
	VerifyAndUpdateKafkaAdminFunc func(ctx context.Context, kafkaRequest *dbapi.KafkaRequest) *serviceError.ServiceError
	// contains filtered or unexported fields
}

KafkaServiceMock is a mock implementation of KafkaService.

func TestSomethingThatUsesKafkaService(t *testing.T) {

	// make and configure a mocked KafkaService
	mockedKafkaService := &KafkaServiceMock{
		AssignBootstrapServerHostFunc: func(kafkaRequest *dbapi.KafkaRequest) error {
			panic("mock out the AssignBootstrapServerHost method")
		},
		AssignInstanceTypeFunc: func(owner string, organisationID string) (kafkaTypes.KafkaInstanceType, *serviceError.ServiceError) {
			panic("mock out the AssignInstanceType method")
		},
		ChangeKafkaCNAMErecordsFunc: func(kafkaRequest *dbapi.KafkaRequest, action KafkaRoutesAction) (*route53.ChangeResourceRecordSetsOutput, *serviceError.ServiceError) {
			panic("mock out the ChangeKafkaCNAMErecords method")
		},
		CountByStatusFunc: func(status []constants.KafkaStatus) ([]KafkaStatusCount, error) {
			panic("mock out the CountByStatus method")
		},
		DeleteFunc: func(kafkaRequest *dbapi.KafkaRequest) *serviceError.ServiceError {
			panic("mock out the Delete method")
		},
		DeprovisionExpiredKafkasFunc: func() *serviceError.ServiceError {
			panic("mock out the DeprovisionExpiredKafkas method")
		},
		DeprovisionKafkaForUsersFunc: func(users []string) *serviceError.ServiceError {
			panic("mock out the DeprovisionKafkaForUsers method")
		},
		GenerateReservedManagedKafkasByClusterIDFunc: func(clusterID string) ([]managedkafka.ManagedKafka, *serviceError.ServiceError) {
			panic("mock out the GenerateReservedManagedKafkasByClusterID method")
		},
		GetFunc: func(ctx context.Context, id string) (*dbapi.KafkaRequest, *serviceError.ServiceError) {
			panic("mock out the Get method")
		},
		GetAvailableSizesInRegionFunc: func(criteria *FindClusterCriteria) ([]string, *serviceError.ServiceError) {
			panic("mock out the GetAvailableSizesInRegion method")
		},
		GetByIDFunc: func(id string) (*dbapi.KafkaRequest, *serviceError.ServiceError) {
			panic("mock out the GetByID method")
		},
		GetCNAMERecordStatusFunc: func(kafkaRequest *dbapi.KafkaRequest) (*CNameRecordStatus, error) {
			panic("mock out the GetCNAMERecordStatus method")
		},
		GetManagedKafkaByClusterIDFunc: func(clusterID string) ([]managedkafka.ManagedKafka, *serviceError.ServiceError) {
			panic("mock out the GetManagedKafkaByClusterID method")
		},
		HasAvailableCapacityInRegionFunc: func(kafkaRequest *dbapi.KafkaRequest) (bool, *serviceError.ServiceError) {
			panic("mock out the HasAvailableCapacityInRegion method")
		},
		IsQuotaEntitlementActiveFunc: func(kafkaRequest *dbapi.KafkaRequest) (bool, error) {
			panic("mock out the IsQuotaEntitlementActive method")
		},
		ListFunc: func(ctx context.Context, listArgs *services.ListArguments) (dbapi.KafkaList, *api.PagingMeta, *serviceError.ServiceError) {
			panic("mock out the List method")
		},
		ListAllFunc: func() (dbapi.KafkaList, *serviceError.ServiceError) {
			panic("mock out the ListAll method")
		},
		ListByStatusFunc: func(status ...constants.KafkaStatus) ([]*dbapi.KafkaRequest, *serviceError.ServiceError) {
			panic("mock out the ListByStatus method")
		},
		ListComponentVersionsFunc: func() ([]KafkaComponentVersions, error) {
			panic("mock out the ListComponentVersions method")
		},
		ListKafkasToBePromotedFunc: func() ([]*dbapi.KafkaRequest, *serviceError.ServiceError) {
			panic("mock out the ListKafkasToBePromoted method")
		},
		ListKafkasWithRoutesNotCreatedFunc: func() ([]*dbapi.KafkaRequest, *serviceError.ServiceError) {
			panic("mock out the ListKafkasWithRoutesNotCreated method")
		},
		ManagedKafkasRoutesTLSCertificateFunc: func(kafkaRequest *dbapi.KafkaRequest) error {
			panic("mock out the ManagedKafkasRoutesTLSCertificate method")
		},
		PrepareKafkaRequestFunc: func(kafkaRequest *dbapi.KafkaRequest) *serviceError.ServiceError {
			panic("mock out the PrepareKafkaRequest method")
		},
		RegisterKafkaDeprovisionJobFunc: func(ctx context.Context, id string) *serviceError.ServiceError {
			panic("mock out the RegisterKafkaDeprovisionJob method")
		},
		RegisterKafkaJobFunc: func(kafkaRequest *dbapi.KafkaRequest) *serviceError.ServiceError {
			panic("mock out the RegisterKafkaJob method")
		},
		UpdateFunc: func(kafkaRequest *dbapi.KafkaRequest) *serviceError.ServiceError {
			panic("mock out the Update method")
		},
		UpdateStatusFunc: func(id string, status constants.KafkaStatus) (bool, *serviceError.ServiceError) {
			panic("mock out the UpdateStatus method")
		},
		UpdatesFunc: func(kafkaRequest *dbapi.KafkaRequest, values map[string]interface{}) *serviceError.ServiceError {
			panic("mock out the Updates method")
		},
		ValidateBillingAccountFunc: func(externalId string, instanceType kafkaTypes.KafkaInstanceType, kafkaBillingModelID string, billingCloudAccountId string, marketplace *string) *serviceError.ServiceError {
			panic("mock out the ValidateBillingAccount method")
		},
		VerifyAndUpdateKafkaAdminFunc: func(ctx context.Context, kafkaRequest *dbapi.KafkaRequest) *serviceError.ServiceError {
			panic("mock out the VerifyAndUpdateKafkaAdmin method")
		},
	}

	// use mockedKafkaService in code that requires KafkaService
	// and then make assertions.

}

func (*KafkaServiceMock) AssignBootstrapServerHost

func (mock *KafkaServiceMock) AssignBootstrapServerHost(kafkaRequest *dbapi.KafkaRequest) error

AssignBootstrapServerHost calls AssignBootstrapServerHostFunc.

func (*KafkaServiceMock) AssignBootstrapServerHostCalls

func (mock *KafkaServiceMock) AssignBootstrapServerHostCalls() []struct {
	KafkaRequest *dbapi.KafkaRequest
}

AssignBootstrapServerHostCalls gets all the calls that were made to AssignBootstrapServerHost. Check the length with:

len(mockedKafkaService.AssignBootstrapServerHostCalls())

func (*KafkaServiceMock) AssignInstanceType

func (mock *KafkaServiceMock) AssignInstanceType(owner string, organisationID string) (kafkaTypes.KafkaInstanceType, *serviceError.ServiceError)

AssignInstanceType calls AssignInstanceTypeFunc.

func (*KafkaServiceMock) AssignInstanceTypeCalls

func (mock *KafkaServiceMock) AssignInstanceTypeCalls() []struct {
	Owner          string
	OrganisationID string
}

AssignInstanceTypeCalls gets all the calls that were made to AssignInstanceType. Check the length with:

len(mockedKafkaService.AssignInstanceTypeCalls())

func (*KafkaServiceMock) ChangeKafkaCNAMErecords

func (mock *KafkaServiceMock) ChangeKafkaCNAMErecords(kafkaRequest *dbapi.KafkaRequest, action KafkaRoutesAction) (*route53.ChangeResourceRecordSetsOutput, *serviceError.ServiceError)

ChangeKafkaCNAMErecords calls ChangeKafkaCNAMErecordsFunc.

func (*KafkaServiceMock) ChangeKafkaCNAMErecordsCalls

func (mock *KafkaServiceMock) ChangeKafkaCNAMErecordsCalls() []struct {
	KafkaRequest *dbapi.KafkaRequest
	Action       KafkaRoutesAction
}

ChangeKafkaCNAMErecordsCalls gets all the calls that were made to ChangeKafkaCNAMErecords. Check the length with:

len(mockedKafkaService.ChangeKafkaCNAMErecordsCalls())

func (*KafkaServiceMock) CountByStatus

func (mock *KafkaServiceMock) CountByStatus(status []constants.KafkaStatus) ([]KafkaStatusCount, error)

CountByStatus calls CountByStatusFunc.

func (*KafkaServiceMock) CountByStatusCalls

func (mock *KafkaServiceMock) CountByStatusCalls() []struct {
	Status []constants.KafkaStatus
}

CountByStatusCalls gets all the calls that were made to CountByStatus. Check the length with:

len(mockedKafkaService.CountByStatusCalls())

func (*KafkaServiceMock) Delete

func (mock *KafkaServiceMock) Delete(kafkaRequest *dbapi.KafkaRequest) *serviceError.ServiceError

Delete calls DeleteFunc.

func (*KafkaServiceMock) DeleteCalls

func (mock *KafkaServiceMock) DeleteCalls() []struct {
	KafkaRequest *dbapi.KafkaRequest
}

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

len(mockedKafkaService.DeleteCalls())

func (*KafkaServiceMock) DeprovisionExpiredKafkas

func (mock *KafkaServiceMock) DeprovisionExpiredKafkas() *serviceError.ServiceError

DeprovisionExpiredKafkas calls DeprovisionExpiredKafkasFunc.

func (*KafkaServiceMock) DeprovisionExpiredKafkasCalls

func (mock *KafkaServiceMock) DeprovisionExpiredKafkasCalls() []struct {
}

DeprovisionExpiredKafkasCalls gets all the calls that were made to DeprovisionExpiredKafkas. Check the length with:

len(mockedKafkaService.DeprovisionExpiredKafkasCalls())

func (*KafkaServiceMock) DeprovisionKafkaForUsers

func (mock *KafkaServiceMock) DeprovisionKafkaForUsers(users []string) *serviceError.ServiceError

DeprovisionKafkaForUsers calls DeprovisionKafkaForUsersFunc.

func (*KafkaServiceMock) DeprovisionKafkaForUsersCalls

func (mock *KafkaServiceMock) DeprovisionKafkaForUsersCalls() []struct {
	Users []string
}

DeprovisionKafkaForUsersCalls gets all the calls that were made to DeprovisionKafkaForUsers. Check the length with:

len(mockedKafkaService.DeprovisionKafkaForUsersCalls())

func (*KafkaServiceMock) GenerateReservedManagedKafkasByClusterID

func (mock *KafkaServiceMock) GenerateReservedManagedKafkasByClusterID(clusterID string) ([]managedkafka.ManagedKafka, *serviceError.ServiceError)

GenerateReservedManagedKafkasByClusterID calls GenerateReservedManagedKafkasByClusterIDFunc.

func (*KafkaServiceMock) GenerateReservedManagedKafkasByClusterIDCalls

func (mock *KafkaServiceMock) GenerateReservedManagedKafkasByClusterIDCalls() []struct {
	ClusterID string
}

GenerateReservedManagedKafkasByClusterIDCalls gets all the calls that were made to GenerateReservedManagedKafkasByClusterID. Check the length with:

len(mockedKafkaService.GenerateReservedManagedKafkasByClusterIDCalls())

func (*KafkaServiceMock) Get

Get calls GetFunc.

func (*KafkaServiceMock) GetAvailableSizesInRegion

func (mock *KafkaServiceMock) GetAvailableSizesInRegion(criteria *FindClusterCriteria) ([]string, *serviceError.ServiceError)

GetAvailableSizesInRegion calls GetAvailableSizesInRegionFunc.

func (*KafkaServiceMock) GetAvailableSizesInRegionCalls

func (mock *KafkaServiceMock) GetAvailableSizesInRegionCalls() []struct {
	Criteria *FindClusterCriteria
}

GetAvailableSizesInRegionCalls gets all the calls that were made to GetAvailableSizesInRegion. Check the length with:

len(mockedKafkaService.GetAvailableSizesInRegionCalls())

func (*KafkaServiceMock) GetByID

GetByID calls GetByIDFunc.

func (*KafkaServiceMock) GetByIDCalls

func (mock *KafkaServiceMock) GetByIDCalls() []struct {
	ID string
}

GetByIDCalls gets all the calls that were made to GetByID. Check the length with:

len(mockedKafkaService.GetByIDCalls())

func (*KafkaServiceMock) GetCNAMERecordStatus

func (mock *KafkaServiceMock) GetCNAMERecordStatus(kafkaRequest *dbapi.KafkaRequest) (*CNameRecordStatus, error)

GetCNAMERecordStatus calls GetCNAMERecordStatusFunc.

func (*KafkaServiceMock) GetCNAMERecordStatusCalls

func (mock *KafkaServiceMock) GetCNAMERecordStatusCalls() []struct {
	KafkaRequest *dbapi.KafkaRequest
}

GetCNAMERecordStatusCalls gets all the calls that were made to GetCNAMERecordStatus. Check the length with:

len(mockedKafkaService.GetCNAMERecordStatusCalls())

func (*KafkaServiceMock) GetCalls

func (mock *KafkaServiceMock) GetCalls() []struct {
	Ctx context.Context
	ID  string
}

GetCalls gets all the calls that were made to Get. Check the length with:

len(mockedKafkaService.GetCalls())

func (*KafkaServiceMock) GetManagedKafkaByClusterID

func (mock *KafkaServiceMock) GetManagedKafkaByClusterID(clusterID string) ([]managedkafka.ManagedKafka, *serviceError.ServiceError)

GetManagedKafkaByClusterID calls GetManagedKafkaByClusterIDFunc.

func (*KafkaServiceMock) GetManagedKafkaByClusterIDCalls

func (mock *KafkaServiceMock) GetManagedKafkaByClusterIDCalls() []struct {
	ClusterID string
}

GetManagedKafkaByClusterIDCalls gets all the calls that were made to GetManagedKafkaByClusterID. Check the length with:

len(mockedKafkaService.GetManagedKafkaByClusterIDCalls())

func (*KafkaServiceMock) HasAvailableCapacityInRegion

func (mock *KafkaServiceMock) HasAvailableCapacityInRegion(kafkaRequest *dbapi.KafkaRequest) (bool, *serviceError.ServiceError)

HasAvailableCapacityInRegion calls HasAvailableCapacityInRegionFunc.

func (*KafkaServiceMock) HasAvailableCapacityInRegionCalls

func (mock *KafkaServiceMock) HasAvailableCapacityInRegionCalls() []struct {
	KafkaRequest *dbapi.KafkaRequest
}

HasAvailableCapacityInRegionCalls gets all the calls that were made to HasAvailableCapacityInRegion. Check the length with:

len(mockedKafkaService.HasAvailableCapacityInRegionCalls())

func (*KafkaServiceMock) IsQuotaEntitlementActive

func (mock *KafkaServiceMock) IsQuotaEntitlementActive(kafkaRequest *dbapi.KafkaRequest) (bool, error)

IsQuotaEntitlementActive calls IsQuotaEntitlementActiveFunc.

func (*KafkaServiceMock) IsQuotaEntitlementActiveCalls

func (mock *KafkaServiceMock) IsQuotaEntitlementActiveCalls() []struct {
	KafkaRequest *dbapi.KafkaRequest
}

IsQuotaEntitlementActiveCalls gets all the calls that were made to IsQuotaEntitlementActive. Check the length with:

len(mockedKafkaService.IsQuotaEntitlementActiveCalls())

func (*KafkaServiceMock) List

List calls ListFunc.

func (*KafkaServiceMock) ListAll

ListAll calls ListAllFunc.

func (*KafkaServiceMock) ListAllCalls

func (mock *KafkaServiceMock) ListAllCalls() []struct {
}

ListAllCalls gets all the calls that were made to ListAll. Check the length with:

len(mockedKafkaService.ListAllCalls())

func (*KafkaServiceMock) ListByStatus

func (mock *KafkaServiceMock) ListByStatus(status ...constants.KafkaStatus) ([]*dbapi.KafkaRequest, *serviceError.ServiceError)

ListByStatus calls ListByStatusFunc.

func (*KafkaServiceMock) ListByStatusCalls

func (mock *KafkaServiceMock) ListByStatusCalls() []struct {
	Status []constants.KafkaStatus
}

ListByStatusCalls gets all the calls that were made to ListByStatus. Check the length with:

len(mockedKafkaService.ListByStatusCalls())

func (*KafkaServiceMock) ListCalls

func (mock *KafkaServiceMock) ListCalls() []struct {
	Ctx      context.Context
	ListArgs *services.ListArguments
}

ListCalls gets all the calls that were made to List. Check the length with:

len(mockedKafkaService.ListCalls())

func (*KafkaServiceMock) ListComponentVersions

func (mock *KafkaServiceMock) ListComponentVersions() ([]KafkaComponentVersions, error)

ListComponentVersions calls ListComponentVersionsFunc.

func (*KafkaServiceMock) ListComponentVersionsCalls

func (mock *KafkaServiceMock) ListComponentVersionsCalls() []struct {
}

ListComponentVersionsCalls gets all the calls that were made to ListComponentVersions. Check the length with:

len(mockedKafkaService.ListComponentVersionsCalls())

func (*KafkaServiceMock) ListKafkasToBePromoted

func (mock *KafkaServiceMock) ListKafkasToBePromoted() ([]*dbapi.KafkaRequest, *serviceError.ServiceError)

ListKafkasToBePromoted calls ListKafkasToBePromotedFunc.

func (*KafkaServiceMock) ListKafkasToBePromotedCalls

func (mock *KafkaServiceMock) ListKafkasToBePromotedCalls() []struct {
}

ListKafkasToBePromotedCalls gets all the calls that were made to ListKafkasToBePromoted. Check the length with:

len(mockedKafkaService.ListKafkasToBePromotedCalls())

func (*KafkaServiceMock) ListKafkasWithRoutesNotCreated

func (mock *KafkaServiceMock) ListKafkasWithRoutesNotCreated() ([]*dbapi.KafkaRequest, *serviceError.ServiceError)

ListKafkasWithRoutesNotCreated calls ListKafkasWithRoutesNotCreatedFunc.

func (*KafkaServiceMock) ListKafkasWithRoutesNotCreatedCalls

func (mock *KafkaServiceMock) ListKafkasWithRoutesNotCreatedCalls() []struct {
}

ListKafkasWithRoutesNotCreatedCalls gets all the calls that were made to ListKafkasWithRoutesNotCreated. Check the length with:

len(mockedKafkaService.ListKafkasWithRoutesNotCreatedCalls())

func (*KafkaServiceMock) ManagedKafkasRoutesTLSCertificate

func (mock *KafkaServiceMock) ManagedKafkasRoutesTLSCertificate(kafkaRequest *dbapi.KafkaRequest) error

ManagedKafkasRoutesTLSCertificate calls ManagedKafkasRoutesTLSCertificateFunc.

func (*KafkaServiceMock) ManagedKafkasRoutesTLSCertificateCalls

func (mock *KafkaServiceMock) ManagedKafkasRoutesTLSCertificateCalls() []struct {
	KafkaRequest *dbapi.KafkaRequest
}

ManagedKafkasRoutesTLSCertificateCalls gets all the calls that were made to ManagedKafkasRoutesTLSCertificate. Check the length with:

len(mockedKafkaService.ManagedKafkasRoutesTLSCertificateCalls())

func (*KafkaServiceMock) PrepareKafkaRequest

func (mock *KafkaServiceMock) PrepareKafkaRequest(kafkaRequest *dbapi.KafkaRequest) *serviceError.ServiceError

PrepareKafkaRequest calls PrepareKafkaRequestFunc.

func (*KafkaServiceMock) PrepareKafkaRequestCalls

func (mock *KafkaServiceMock) PrepareKafkaRequestCalls() []struct {
	KafkaRequest *dbapi.KafkaRequest
}

PrepareKafkaRequestCalls gets all the calls that were made to PrepareKafkaRequest. Check the length with:

len(mockedKafkaService.PrepareKafkaRequestCalls())

func (*KafkaServiceMock) RegisterKafkaDeprovisionJob

func (mock *KafkaServiceMock) RegisterKafkaDeprovisionJob(ctx context.Context, id string) *serviceError.ServiceError

RegisterKafkaDeprovisionJob calls RegisterKafkaDeprovisionJobFunc.

func (*KafkaServiceMock) RegisterKafkaDeprovisionJobCalls

func (mock *KafkaServiceMock) RegisterKafkaDeprovisionJobCalls() []struct {
	Ctx context.Context
	ID  string
}

RegisterKafkaDeprovisionJobCalls gets all the calls that were made to RegisterKafkaDeprovisionJob. Check the length with:

len(mockedKafkaService.RegisterKafkaDeprovisionJobCalls())

func (*KafkaServiceMock) RegisterKafkaJob

func (mock *KafkaServiceMock) RegisterKafkaJob(kafkaRequest *dbapi.KafkaRequest) *serviceError.ServiceError

RegisterKafkaJob calls RegisterKafkaJobFunc.

func (*KafkaServiceMock) RegisterKafkaJobCalls

func (mock *KafkaServiceMock) RegisterKafkaJobCalls() []struct {
	KafkaRequest *dbapi.KafkaRequest
}

RegisterKafkaJobCalls gets all the calls that were made to RegisterKafkaJob. Check the length with:

len(mockedKafkaService.RegisterKafkaJobCalls())

func (*KafkaServiceMock) Update

func (mock *KafkaServiceMock) Update(kafkaRequest *dbapi.KafkaRequest) *serviceError.ServiceError

Update calls UpdateFunc.

func (*KafkaServiceMock) UpdateCalls

func (mock *KafkaServiceMock) UpdateCalls() []struct {
	KafkaRequest *dbapi.KafkaRequest
}

UpdateCalls gets all the calls that were made to Update. Check the length with:

len(mockedKafkaService.UpdateCalls())

func (*KafkaServiceMock) UpdateStatus

func (mock *KafkaServiceMock) UpdateStatus(id string, status constants.KafkaStatus) (bool, *serviceError.ServiceError)

UpdateStatus calls UpdateStatusFunc.

func (*KafkaServiceMock) UpdateStatusCalls

func (mock *KafkaServiceMock) UpdateStatusCalls() []struct {
	ID     string
	Status constants.KafkaStatus
}

UpdateStatusCalls gets all the calls that were made to UpdateStatus. Check the length with:

len(mockedKafkaService.UpdateStatusCalls())

func (*KafkaServiceMock) Updates

func (mock *KafkaServiceMock) Updates(kafkaRequest *dbapi.KafkaRequest, values map[string]interface{}) *serviceError.ServiceError

Updates calls UpdatesFunc.

func (*KafkaServiceMock) UpdatesCalls

func (mock *KafkaServiceMock) UpdatesCalls() []struct {
	KafkaRequest *dbapi.KafkaRequest
	Values       map[string]interface{}
}

UpdatesCalls gets all the calls that were made to Updates. Check the length with:

len(mockedKafkaService.UpdatesCalls())

func (*KafkaServiceMock) ValidateBillingAccount

func (mock *KafkaServiceMock) ValidateBillingAccount(externalId string, instanceType kafkaTypes.KafkaInstanceType, kafkaBillingModelID string, billingCloudAccountId string, marketplace *string) *serviceError.ServiceError

ValidateBillingAccount calls ValidateBillingAccountFunc.

func (*KafkaServiceMock) ValidateBillingAccountCalls

func (mock *KafkaServiceMock) ValidateBillingAccountCalls() []struct {
	ExternalId            string
	InstanceType          kafkaTypes.KafkaInstanceType
	KafkaBillingModelID   string
	BillingCloudAccountId string
	Marketplace           *string
}

ValidateBillingAccountCalls gets all the calls that were made to ValidateBillingAccount. Check the length with:

len(mockedKafkaService.ValidateBillingAccountCalls())

func (*KafkaServiceMock) VerifyAndUpdateKafkaAdmin

func (mock *KafkaServiceMock) VerifyAndUpdateKafkaAdmin(ctx context.Context, kafkaRequest *dbapi.KafkaRequest) *serviceError.ServiceError

VerifyAndUpdateKafkaAdmin calls VerifyAndUpdateKafkaAdminFunc.

func (*KafkaServiceMock) VerifyAndUpdateKafkaAdminCalls

func (mock *KafkaServiceMock) VerifyAndUpdateKafkaAdminCalls() []struct {
	Ctx          context.Context
	KafkaRequest *dbapi.KafkaRequest
}

VerifyAndUpdateKafkaAdminCalls gets all the calls that were made to VerifyAndUpdateKafkaAdmin. Check the length with:

len(mockedKafkaService.VerifyAndUpdateKafkaAdminCalls())

type KafkaStatusCount

type KafkaStatusCount struct {
	Status constants.KafkaStatus
	Count  int
}

type KafkaStreamingUnitCountPerCluster

type KafkaStreamingUnitCountPerCluster struct {
	Region        string
	InstanceType  string
	ID            string
	ClusterId     string
	Count         int32
	CloudProvider string
	MaxUnits      int32
	Status        string
	ClusterType   string
}

func (KafkaStreamingUnitCountPerCluster) FreeStreamingUnits

func (k KafkaStreamingUnitCountPerCluster) FreeStreamingUnits() int32

type KafkaStreamingUnitCountPerClusterList

type KafkaStreamingUnitCountPerClusterList []KafkaStreamingUnitCountPerCluster

func (KafkaStreamingUnitCountPerClusterList) GetStreamingUnitCountForClusterAndInstanceType

func (kafkaStreamingUnitCountPerClusterList KafkaStreamingUnitCountPerClusterList) GetStreamingUnitCountForClusterAndInstanceType(clusterId, instanceType string) int

type KasFleetshardOperatorAddon

type KasFleetshardOperatorAddon interface {
	Provision(cluster api.Cluster) (bool, ParameterList, *errors.ServiceError)
	ReconcileParameters(cluster api.Cluster) (ParameterList, *errors.ServiceError)
	RemoveServiceAccount(cluster api.Cluster) *errors.ServiceError
	GetAddonParams(cluster *api.Cluster) (ParameterList, *errors.ServiceError)
}

func NewKasFleetshardOperatorAddon

func NewKasFleetshardOperatorAddon(o kasFleetshardOperatorAddon) KasFleetshardOperatorAddon

type KasFleetshardOperatorAddonMock

type KasFleetshardOperatorAddonMock struct {
	// GetAddonParamsFunc mocks the GetAddonParams method.
	GetAddonParamsFunc func(cluster *api.Cluster) (ParameterList, *serviceError.ServiceError)

	// ProvisionFunc mocks the Provision method.
	ProvisionFunc func(cluster api.Cluster) (bool, ParameterList, *serviceError.ServiceError)

	// ReconcileParametersFunc mocks the ReconcileParameters method.
	ReconcileParametersFunc func(cluster api.Cluster) (ParameterList, *serviceError.ServiceError)

	// RemoveServiceAccountFunc mocks the RemoveServiceAccount method.
	RemoveServiceAccountFunc func(cluster api.Cluster) *serviceError.ServiceError
	// contains filtered or unexported fields
}

KasFleetshardOperatorAddonMock is a mock implementation of KasFleetshardOperatorAddon.

func TestSomethingThatUsesKasFleetshardOperatorAddon(t *testing.T) {

	// make and configure a mocked KasFleetshardOperatorAddon
	mockedKasFleetshardOperatorAddon := &KasFleetshardOperatorAddonMock{
		GetAddonParamsFunc: func(cluster *api.Cluster) (ParameterList, *serviceError.ServiceError) {
			panic("mock out the GetAddonParams method")
		},
		ProvisionFunc: func(cluster api.Cluster) (bool, ParameterList, *serviceError.ServiceError) {
			panic("mock out the Provision method")
		},
		ReconcileParametersFunc: func(cluster api.Cluster) (ParameterList, *serviceError.ServiceError) {
			panic("mock out the ReconcileParameters method")
		},
		RemoveServiceAccountFunc: func(cluster api.Cluster) *serviceError.ServiceError {
			panic("mock out the RemoveServiceAccount method")
		},
	}

	// use mockedKasFleetshardOperatorAddon in code that requires KasFleetshardOperatorAddon
	// and then make assertions.

}

func (*KasFleetshardOperatorAddonMock) GetAddonParams

GetAddonParams calls GetAddonParamsFunc.

func (*KasFleetshardOperatorAddonMock) GetAddonParamsCalls

func (mock *KasFleetshardOperatorAddonMock) GetAddonParamsCalls() []struct {
	Cluster *api.Cluster
}

GetAddonParamsCalls gets all the calls that were made to GetAddonParams. Check the length with:

len(mockedKasFleetshardOperatorAddon.GetAddonParamsCalls())

func (*KasFleetshardOperatorAddonMock) Provision

Provision calls ProvisionFunc.

func (*KasFleetshardOperatorAddonMock) ProvisionCalls

func (mock *KasFleetshardOperatorAddonMock) ProvisionCalls() []struct {
	Cluster api.Cluster
}

ProvisionCalls gets all the calls that were made to Provision. Check the length with:

len(mockedKasFleetshardOperatorAddon.ProvisionCalls())

func (*KasFleetshardOperatorAddonMock) ReconcileParameters

func (mock *KasFleetshardOperatorAddonMock) ReconcileParameters(cluster api.Cluster) (ParameterList, *serviceError.ServiceError)

ReconcileParameters calls ReconcileParametersFunc.

func (*KasFleetshardOperatorAddonMock) ReconcileParametersCalls

func (mock *KasFleetshardOperatorAddonMock) ReconcileParametersCalls() []struct {
	Cluster api.Cluster
}

ReconcileParametersCalls gets all the calls that were made to ReconcileParameters. Check the length with:

len(mockedKasFleetshardOperatorAddon.ReconcileParametersCalls())

func (*KasFleetshardOperatorAddonMock) RemoveServiceAccount

func (mock *KasFleetshardOperatorAddonMock) RemoveServiceAccount(cluster api.Cluster) *serviceError.ServiceError

RemoveServiceAccount calls RemoveServiceAccountFunc.

func (*KasFleetshardOperatorAddonMock) RemoveServiceAccountCalls

func (mock *KasFleetshardOperatorAddonMock) RemoveServiceAccountCalls() []struct {
	Cluster api.Cluster
}

RemoveServiceAccountCalls gets all the calls that were made to RemoveServiceAccount. Check the length with:

len(mockedKasFleetshardOperatorAddon.RemoveServiceAccountCalls())

type KasFleetshardOperatorParams

type KasFleetshardOperatorParams interface {
	GetParam(name string) string
}

type ObservatoriumService

type ObservatoriumService interface {
	GetKafkaState(name string, namespaceName string) (observatorium.KafkaState, error)
	GetMetricsByKafkaId(ctx context.Context, csMetrics *observatorium.KafkaMetrics, id string, query observatorium.MetricsReqParams) (string, *errors.ServiceError)
}

func NewObservatoriumService

func NewObservatoriumService(observatorium *observatorium.Client, kafkaService KafkaService) ObservatoriumService

type ObservatoriumServiceMock

type ObservatoriumServiceMock struct {
	// GetKafkaStateFunc mocks the GetKafkaState method.
	GetKafkaStateFunc func(name string, namespaceName string) (observatorium.KafkaState, error)

	// GetMetricsByKafkaIdFunc mocks the GetMetricsByKafkaId method.
	GetMetricsByKafkaIdFunc func(ctx context.Context, csMetrics *observatorium.KafkaMetrics, id string, query observatorium.MetricsReqParams) (string, *serviceError.ServiceError)
	// contains filtered or unexported fields
}

ObservatoriumServiceMock is a mock implementation of ObservatoriumService.

func TestSomethingThatUsesObservatoriumService(t *testing.T) {

	// make and configure a mocked ObservatoriumService
	mockedObservatoriumService := &ObservatoriumServiceMock{
		GetKafkaStateFunc: func(name string, namespaceName string) (observatorium.KafkaState, error) {
			panic("mock out the GetKafkaState method")
		},
		GetMetricsByKafkaIdFunc: func(ctx context.Context, csMetrics *observatorium.KafkaMetrics, id string, query observatorium.MetricsReqParams) (string, *serviceError.ServiceError) {
			panic("mock out the GetMetricsByKafkaId method")
		},
	}

	// use mockedObservatoriumService in code that requires ObservatoriumService
	// and then make assertions.

}

func (*ObservatoriumServiceMock) GetKafkaState

func (mock *ObservatoriumServiceMock) GetKafkaState(name string, namespaceName string) (observatorium.KafkaState, error)

GetKafkaState calls GetKafkaStateFunc.

func (*ObservatoriumServiceMock) GetKafkaStateCalls

func (mock *ObservatoriumServiceMock) GetKafkaStateCalls() []struct {
	Name          string
	NamespaceName string
}

GetKafkaStateCalls gets all the calls that were made to GetKafkaState. Check the length with:

len(mockedObservatoriumService.GetKafkaStateCalls())

func (*ObservatoriumServiceMock) GetMetricsByKafkaId

GetMetricsByKafkaId calls GetMetricsByKafkaIdFunc.

func (*ObservatoriumServiceMock) GetMetricsByKafkaIdCalls

func (mock *ObservatoriumServiceMock) GetMetricsByKafkaIdCalls() []struct {
	Ctx       context.Context
	CsMetrics *observatorium.KafkaMetrics
	ID        string
	Query     observatorium.MetricsReqParams
}

GetMetricsByKafkaIdCalls gets all the calls that were made to GetMetricsByKafkaId. Check the length with:

len(mockedObservatoriumService.GetMetricsByKafkaIdCalls())

type ParameterList

type ParameterList []types.Parameter

func (ParameterList) GetParam

func (p ParameterList) GetParam(name string) string

type QuotaService

type QuotaService interface {
	// CheckIfQuotaIsDefinedForInstanceType checks if quota is defined for the given instance type
	CheckIfQuotaIsDefinedForInstanceType(username string, externalID string, instanceTypeID types.KafkaInstanceType, kafkaBillingModel config.KafkaBillingModel) (bool, *errors.ServiceError)
	// ReserveQuota reserves a quota for a user and return the reservation id or an error in case of failure
	ReserveQuota(kafka *dbapi.KafkaRequest) (string, *errors.ServiceError)
	// ReserveQuotaIfNotAlreadyReserved reserves a quota for the specified request if the desired quota
	// has not been already reserved. Returns the id of the newly reserved quota or the id of the existing one
	ReserveQuotaIfNotAlreadyReserved(kafka *dbapi.KafkaRequest) (string, *errors.ServiceError)
	// DeleteQuota deletes a reserved quota
	DeleteQuota(subscriptionId string) *errors.ServiceError
	// DeleteQuotaForBillingModel deletes a reserved quota only if it is related to the specified billing model, otherwise exits with no error
	DeleteQuotaForBillingModel(subscriptionId string, kafkaBillingModel config.KafkaBillingModel) *errors.ServiceError
	// ValidateBillingAccount validates if a billing account is contained in the quota cost response
	ValidateBillingAccount(organisationId string, instanceType types.KafkaInstanceType, billingModelID string, billingCloudAccountId string, marketplace *string) *errors.ServiceError
	// IsQuotaEntitlementActive checks if the user/organisation have an active entitlement to the quota used by the
	// given Kafka instance.
	// It returns true if the user has an active quota entitlement and false if not.
	// It returns false and an error if it encounters any issues while trying to check the quota entitlement status
	IsQuotaEntitlementActive(kafka *dbapi.KafkaRequest) (bool, error)
}

type QuotaServiceFactory

type QuotaServiceFactory interface {
	GetQuotaService(quotaType api.QuotaType) (QuotaService, *errors.ServiceError)
}

QuotaServiceFactory used to return an instance of QuotaService implementation

type QuotaServiceFactoryMock

type QuotaServiceFactoryMock struct {
	// GetQuotaServiceFunc mocks the GetQuotaService method.
	GetQuotaServiceFunc func(quotaType api.QuotaType) (QuotaService, *serviceError.ServiceError)
	// contains filtered or unexported fields
}

QuotaServiceFactoryMock is a mock implementation of QuotaServiceFactory.

func TestSomethingThatUsesQuotaServiceFactory(t *testing.T) {

	// make and configure a mocked QuotaServiceFactory
	mockedQuotaServiceFactory := &QuotaServiceFactoryMock{
		GetQuotaServiceFunc: func(quotaType api.QuotaType) (QuotaService, *serviceError.ServiceError) {
			panic("mock out the GetQuotaService method")
		},
	}

	// use mockedQuotaServiceFactory in code that requires QuotaServiceFactory
	// and then make assertions.

}

func (*QuotaServiceFactoryMock) GetQuotaService

func (mock *QuotaServiceFactoryMock) GetQuotaService(quotaType api.QuotaType) (QuotaService, *serviceError.ServiceError)

GetQuotaService calls GetQuotaServiceFunc.

func (*QuotaServiceFactoryMock) GetQuotaServiceCalls

func (mock *QuotaServiceFactoryMock) GetQuotaServiceCalls() []struct {
	QuotaType api.QuotaType
}

GetQuotaServiceCalls gets all the calls that were made to GetQuotaService. Check the length with:

len(mockedQuotaServiceFactory.GetQuotaServiceCalls())

type QuotaServiceMock

type QuotaServiceMock struct {
	// CheckIfQuotaIsDefinedForInstanceTypeFunc mocks the CheckIfQuotaIsDefinedForInstanceType method.
	CheckIfQuotaIsDefinedForInstanceTypeFunc func(username string, externalID string, instanceTypeID kafkaTypes.KafkaInstanceType, kafkaBillingModel config.KafkaBillingModel) (bool, *serviceError.ServiceError)

	// DeleteQuotaFunc mocks the DeleteQuota method.
	DeleteQuotaFunc func(subscriptionId string) *serviceError.ServiceError

	// DeleteQuotaForBillingModelFunc mocks the DeleteQuotaForBillingModel method.
	DeleteQuotaForBillingModelFunc func(subscriptionId string, kafkaBillingModel config.KafkaBillingModel) *serviceError.ServiceError

	// IsQuotaEntitlementActiveFunc mocks the IsQuotaEntitlementActive method.
	IsQuotaEntitlementActiveFunc func(kafka *dbapi.KafkaRequest) (bool, error)

	// ReserveQuotaFunc mocks the ReserveQuota method.
	ReserveQuotaFunc func(kafka *dbapi.KafkaRequest) (string, *serviceError.ServiceError)

	// ReserveQuotaIfNotAlreadyReservedFunc mocks the ReserveQuotaIfNotAlreadyReserved method.
	ReserveQuotaIfNotAlreadyReservedFunc func(kafka *dbapi.KafkaRequest) (string, *serviceError.ServiceError)

	// ValidateBillingAccountFunc mocks the ValidateBillingAccount method.
	ValidateBillingAccountFunc func(organisationId string, instanceType kafkaTypes.KafkaInstanceType, billingModelID string, billingCloudAccountId string, marketplace *string) *serviceError.ServiceError
	// contains filtered or unexported fields
}

QuotaServiceMock is a mock implementation of QuotaService.

func TestSomethingThatUsesQuotaService(t *testing.T) {

	// make and configure a mocked QuotaService
	mockedQuotaService := &QuotaServiceMock{
		CheckIfQuotaIsDefinedForInstanceTypeFunc: func(username string, externalID string, instanceTypeID kafkaTypes.KafkaInstanceType, kafkaBillingModel config.KafkaBillingModel) (bool, *serviceError.ServiceError) {
			panic("mock out the CheckIfQuotaIsDefinedForInstanceType method")
		},
		DeleteQuotaFunc: func(subscriptionId string) *serviceError.ServiceError {
			panic("mock out the DeleteQuota method")
		},
		DeleteQuotaForBillingModelFunc: func(subscriptionId string, kafkaBillingModel config.KafkaBillingModel) *serviceError.ServiceError {
			panic("mock out the DeleteQuotaForBillingModel method")
		},
		IsQuotaEntitlementActiveFunc: func(kafka *dbapi.KafkaRequest) (bool, error) {
			panic("mock out the IsQuotaEntitlementActive method")
		},
		ReserveQuotaFunc: func(kafka *dbapi.KafkaRequest) (string, *serviceError.ServiceError) {
			panic("mock out the ReserveQuota method")
		},
		ReserveQuotaIfNotAlreadyReservedFunc: func(kafka *dbapi.KafkaRequest) (string, *serviceError.ServiceError) {
			panic("mock out the ReserveQuotaIfNotAlreadyReserved method")
		},
		ValidateBillingAccountFunc: func(organisationId string, instanceType kafkaTypes.KafkaInstanceType, billingModelID string, billingCloudAccountId string, marketplace *string) *serviceError.ServiceError {
			panic("mock out the ValidateBillingAccount method")
		},
	}

	// use mockedQuotaService in code that requires QuotaService
	// and then make assertions.

}

func (*QuotaServiceMock) CheckIfQuotaIsDefinedForInstanceType

func (mock *QuotaServiceMock) CheckIfQuotaIsDefinedForInstanceType(username string, externalID string, instanceTypeID kafkaTypes.KafkaInstanceType, kafkaBillingModel config.KafkaBillingModel) (bool, *serviceError.ServiceError)

CheckIfQuotaIsDefinedForInstanceType calls CheckIfQuotaIsDefinedForInstanceTypeFunc.

func (*QuotaServiceMock) CheckIfQuotaIsDefinedForInstanceTypeCalls

func (mock *QuotaServiceMock) CheckIfQuotaIsDefinedForInstanceTypeCalls() []struct {
	Username          string
	ExternalID        string
	InstanceTypeID    kafkaTypes.KafkaInstanceType
	KafkaBillingModel config.KafkaBillingModel
}

CheckIfQuotaIsDefinedForInstanceTypeCalls gets all the calls that were made to CheckIfQuotaIsDefinedForInstanceType. Check the length with:

len(mockedQuotaService.CheckIfQuotaIsDefinedForInstanceTypeCalls())

func (*QuotaServiceMock) DeleteQuota

func (mock *QuotaServiceMock) DeleteQuota(subscriptionId string) *serviceError.ServiceError

DeleteQuota calls DeleteQuotaFunc.

func (*QuotaServiceMock) DeleteQuotaCalls

func (mock *QuotaServiceMock) DeleteQuotaCalls() []struct {
	SubscriptionId string
}

DeleteQuotaCalls gets all the calls that were made to DeleteQuota. Check the length with:

len(mockedQuotaService.DeleteQuotaCalls())

func (*QuotaServiceMock) DeleteQuotaForBillingModel

func (mock *QuotaServiceMock) DeleteQuotaForBillingModel(subscriptionId string, kafkaBillingModel config.KafkaBillingModel) *serviceError.ServiceError

DeleteQuotaForBillingModel calls DeleteQuotaForBillingModelFunc.

func (*QuotaServiceMock) DeleteQuotaForBillingModelCalls

func (mock *QuotaServiceMock) DeleteQuotaForBillingModelCalls() []struct {
	SubscriptionId    string
	KafkaBillingModel config.KafkaBillingModel
}

DeleteQuotaForBillingModelCalls gets all the calls that were made to DeleteQuotaForBillingModel. Check the length with:

len(mockedQuotaService.DeleteQuotaForBillingModelCalls())

func (*QuotaServiceMock) IsQuotaEntitlementActive

func (mock *QuotaServiceMock) IsQuotaEntitlementActive(kafka *dbapi.KafkaRequest) (bool, error)

IsQuotaEntitlementActive calls IsQuotaEntitlementActiveFunc.

func (*QuotaServiceMock) IsQuotaEntitlementActiveCalls

func (mock *QuotaServiceMock) IsQuotaEntitlementActiveCalls() []struct {
	Kafka *dbapi.KafkaRequest
}

IsQuotaEntitlementActiveCalls gets all the calls that were made to IsQuotaEntitlementActive. Check the length with:

len(mockedQuotaService.IsQuotaEntitlementActiveCalls())

func (*QuotaServiceMock) ReserveQuota

func (mock *QuotaServiceMock) ReserveQuota(kafka *dbapi.KafkaRequest) (string, *serviceError.ServiceError)

ReserveQuota calls ReserveQuotaFunc.

func (*QuotaServiceMock) ReserveQuotaCalls

func (mock *QuotaServiceMock) ReserveQuotaCalls() []struct {
	Kafka *dbapi.KafkaRequest
}

ReserveQuotaCalls gets all the calls that were made to ReserveQuota. Check the length with:

len(mockedQuotaService.ReserveQuotaCalls())

func (*QuotaServiceMock) ReserveQuotaIfNotAlreadyReserved

func (mock *QuotaServiceMock) ReserveQuotaIfNotAlreadyReserved(kafka *dbapi.KafkaRequest) (string, *serviceError.ServiceError)

ReserveQuotaIfNotAlreadyReserved calls ReserveQuotaIfNotAlreadyReservedFunc.

func (*QuotaServiceMock) ReserveQuotaIfNotAlreadyReservedCalls

func (mock *QuotaServiceMock) ReserveQuotaIfNotAlreadyReservedCalls() []struct {
	Kafka *dbapi.KafkaRequest
}

ReserveQuotaIfNotAlreadyReservedCalls gets all the calls that were made to ReserveQuotaIfNotAlreadyReserved. Check the length with:

len(mockedQuotaService.ReserveQuotaIfNotAlreadyReservedCalls())

func (*QuotaServiceMock) ValidateBillingAccount

func (mock *QuotaServiceMock) ValidateBillingAccount(organisationId string, instanceType kafkaTypes.KafkaInstanceType, billingModelID string, billingCloudAccountId string, marketplace *string) *serviceError.ServiceError

ValidateBillingAccount calls ValidateBillingAccountFunc.

func (*QuotaServiceMock) ValidateBillingAccountCalls

func (mock *QuotaServiceMock) ValidateBillingAccountCalls() []struct {
	OrganisationId        string
	InstanceType          kafkaTypes.KafkaInstanceType
	BillingModelID        string
	BillingCloudAccountId string
	Marketplace           *string
}

ValidateBillingAccountCalls gets all the calls that were made to ValidateBillingAccount. Check the length with:

len(mockedQuotaService.ValidateBillingAccountCalls())

type ResGroupCPRegion

type ResGroupCPRegion struct {
	Provider string
	Region   string
	Count    int
}

type ResKafkaInstanceCount

type ResKafkaInstanceCount struct {
	ClusterID string
	Count     int
}

type StreamingUnitCountPerInstanceType

type StreamingUnitCountPerInstanceType map[kafkaTypes.KafkaInstanceType]int64

type SupportedKafkaInstanceTypesService

type SupportedKafkaInstanceTypesService interface {
	GetSupportedKafkaInstanceTypesByRegion(providerId string, regionId string) ([]config.KafkaInstanceType, *errors.ServiceError)
}

func NewSupportedKafkaInstanceTypesService

func NewSupportedKafkaInstanceTypesService(providerConfig *config.ProviderConfig, kafkaConfig *config.KafkaConfig) SupportedKafkaInstanceTypesService

type SupportedKafkaInstanceTypesServiceMock

type SupportedKafkaInstanceTypesServiceMock struct {
	// GetSupportedKafkaInstanceTypesByRegionFunc mocks the GetSupportedKafkaInstanceTypesByRegion method.
	GetSupportedKafkaInstanceTypesByRegionFunc func(providerId string, regionId string) ([]config.KafkaInstanceType, *serviceError.ServiceError)
	// contains filtered or unexported fields
}

SupportedKafkaInstanceTypesServiceMock is a mock implementation of SupportedKafkaInstanceTypesService.

func TestSomethingThatUsesSupportedKafkaInstanceTypesService(t *testing.T) {

	// make and configure a mocked SupportedKafkaInstanceTypesService
	mockedSupportedKafkaInstanceTypesService := &SupportedKafkaInstanceTypesServiceMock{
		GetSupportedKafkaInstanceTypesByRegionFunc: func(providerId string, regionId string) ([]config.KafkaInstanceType, *serviceError.ServiceError) {
			panic("mock out the GetSupportedKafkaInstanceTypesByRegion method")
		},
	}

	// use mockedSupportedKafkaInstanceTypesService in code that requires SupportedKafkaInstanceTypesService
	// and then make assertions.

}

func (*SupportedKafkaInstanceTypesServiceMock) GetSupportedKafkaInstanceTypesByRegion

func (mock *SupportedKafkaInstanceTypesServiceMock) GetSupportedKafkaInstanceTypesByRegion(providerId string, regionId string) ([]config.KafkaInstanceType, *serviceError.ServiceError)

GetSupportedKafkaInstanceTypesByRegion calls GetSupportedKafkaInstanceTypesByRegionFunc.

func (*SupportedKafkaInstanceTypesServiceMock) GetSupportedKafkaInstanceTypesByRegionCalls

func (mock *SupportedKafkaInstanceTypesServiceMock) GetSupportedKafkaInstanceTypesByRegionCalls() []struct {
	ProviderId string
	RegionId   string
}

GetSupportedKafkaInstanceTypesByRegionCalls gets all the calls that were made to GetSupportedKafkaInstanceTypesByRegion. Check the length with:

len(mockedSupportedKafkaInstanceTypesService.GetSupportedKafkaInstanceTypesByRegionCalls())

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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