Documentation ¶
Index ¶
- Constants
- Variables
- type BlobStorageDeploymentDetails
- type BlobStorageProvider
- func (b BlobStorageProvider) CreateStorage(ctx context.Context, bs *v1alpha1.BlobStorage) (*providers.BlobStorageInstance, croType.StatusMessage, error)
- func (b BlobStorageProvider) DeleteStorage(ctx context.Context, bs *v1alpha1.BlobStorage) (croType.StatusMessage, error)
- func (b BlobStorageProvider) GetName() string
- func (b BlobStorageProvider) GetReconcileTime(bs *v1alpha1.BlobStorage) time.Duration
- func (b BlobStorageProvider) SupportsStrategy(s string) bool
- type ConfigManager
- type ConfigManagerMock
- type ConfigMapConfigManager
- type PostgresProvider
- func (p *PostgresProvider) CreateDeployment(ctx context.Context, d *appsv1.Deployment, postgresCfg *PostgresStrat) error
- func (p *PostgresProvider) CreatePVC(ctx context.Context, pvc *v1.PersistentVolumeClaim, postgresCfg *PostgresStrat) error
- func (p *PostgresProvider) CreateSecret(ctx context.Context, s *v1.Secret, postgresCfg *PostgresStrat) error
- func (p *PostgresProvider) CreateService(ctx context.Context, s *v1.Service, postgresCfg *PostgresStrat) error
- func (p *PostgresProvider) DeletePostgres(ctx context.Context, ps *v1alpha1.Postgres) (croType.StatusMessage, error)
- func (p *PostgresProvider) GetName() string
- func (p *PostgresProvider) GetReconcileTime(pg *v1alpha1.Postgres) time.Duration
- func (p *PostgresProvider) ReconcileDatabaseUserRoles(ctx context.Context, d *appsv1.Deployment, u string) error
- func (p *PostgresProvider) ReconcilePostgres(ctx context.Context, ps *v1alpha1.Postgres) (*providers.PostgresInstance, croType.StatusMessage, error)
- func (p *PostgresProvider) SupportsStrategy(d string) bool
- type PostgresStrat
- type RedisProvider
- func (p *RedisProvider) CreateConfigMap(ctx context.Context, cm *apiv1.ConfigMap, redisCfg *RedisStrat) error
- func (p *RedisProvider) CreateDeployment(ctx context.Context, d *appsv1.Deployment, redisCfg *RedisStrat) error
- func (p *RedisProvider) CreatePVC(ctx context.Context, pvc *apiv1.PersistentVolumeClaim, redisCfg *RedisStrat) error
- func (p *RedisProvider) CreateRedis(ctx context.Context, r *v1alpha1.Redis) (*providers.RedisCluster, croType.StatusMessage, error)
- func (p *RedisProvider) CreateService(ctx context.Context, s *apiv1.Service, redisCfg *RedisStrat) error
- func (p *RedisProvider) DeleteRedis(ctx context.Context, r *v1alpha1.Redis) (croType.StatusMessage, error)
- func (p *RedisProvider) GetName() string
- func (p *RedisProvider) GetReconcileTime(r *v1alpha1.Redis) time.Duration
- func (p *RedisProvider) SupportsStrategy(d string) bool
- type RedisStrat
- type StrategyConfig
Constants ¶
View Source
const ( DefaultConfigMapName = "cloud-resources-openshift-strategies" DefaultFinalizer = "finalizers.cloud-resources-operator.integreatly.org" NamespacePrefixOpenShift = "openshift-" )
Variables ¶
View Source
var DefaultConfigMapNamespace, _ = k8sutil.GetWatchNamespace()
DefaultConfigMapNamespace get default namespace
Functions ¶
This section is empty.
Types ¶
type BlobStorageDeploymentDetails ¶
type BlobStorageDeploymentDetails struct {
// contains filtered or unexported fields
}
func (*BlobStorageDeploymentDetails) Data ¶
func (d *BlobStorageDeploymentDetails) Data() map[string][]byte
type BlobStorageProvider ¶
func NewBlobStorageProvider ¶
func NewBlobStorageProvider(c client.Client, l *logrus.Entry) *BlobStorageProvider
func (BlobStorageProvider) CreateStorage ¶
func (b BlobStorageProvider) CreateStorage(ctx context.Context, bs *v1alpha1.BlobStorage) (*providers.BlobStorageInstance, croType.StatusMessage, error)
func (BlobStorageProvider) DeleteStorage ¶
func (b BlobStorageProvider) DeleteStorage(ctx context.Context, bs *v1alpha1.BlobStorage) (croType.StatusMessage, error)
func (BlobStorageProvider) GetName ¶
func (b BlobStorageProvider) GetName() string
func (BlobStorageProvider) GetReconcileTime ¶
func (b BlobStorageProvider) GetReconcileTime(bs *v1alpha1.BlobStorage) time.Duration
func (BlobStorageProvider) SupportsStrategy ¶
func (b BlobStorageProvider) SupportsStrategy(s string) bool
type ConfigManager ¶
type ConfigManager interface {
ReadStorageStrategy(ctx context.Context, rt providers.ResourceType, tier string) (*StrategyConfig, error)
}
type ConfigManagerMock ¶
type ConfigManagerMock struct { // ReadStorageStrategyFunc mocks the ReadStorageStrategy method. ReadStorageStrategyFunc func(ctx context.Context, rt providers.ResourceType, tier string) (*StrategyConfig, error) // contains filtered or unexported fields }
ConfigManagerMock is a mock implementation of ConfigManager.
func TestSomethingThatUsesConfigManager(t *testing.T) { // make and configure a mocked ConfigManager mockedConfigManager := &ConfigManagerMock{ ReadStorageStrategyFunc: func(ctx context.Context, rt providers.ResourceType, tier string) (*StrategyConfig, error) { panic("mock out the ReadStorageStrategy method") }, } // use mockedConfigManager in code that requires ConfigManager // and then make assertions. }
func (*ConfigManagerMock) ReadStorageStrategy ¶
func (mock *ConfigManagerMock) ReadStorageStrategy(ctx context.Context, rt providers.ResourceType, tier string) (*StrategyConfig, error)
ReadStorageStrategy calls ReadStorageStrategyFunc.
func (*ConfigManagerMock) ReadStorageStrategyCalls ¶
func (mock *ConfigManagerMock) ReadStorageStrategyCalls() []struct { Ctx context.Context Rt providers.ResourceType Tier string }
ReadStorageStrategyCalls gets all the calls that were made to ReadStorageStrategy. Check the length with:
len(mockedConfigManager.ReadStorageStrategyCalls())
type ConfigMapConfigManager ¶
type ConfigMapConfigManager struct {
// contains filtered or unexported fields
}
func NewConfigMapConfigManager ¶
func NewConfigMapConfigManager(cm string, namespace string, client client.Client) *ConfigMapConfigManager
func NewDefaultConfigManager ¶
func NewDefaultConfigManager(client client.Client) *ConfigMapConfigManager
func (*ConfigMapConfigManager) ReadStorageStrategy ¶
func (m *ConfigMapConfigManager) ReadStorageStrategy(ctx context.Context, rt providers.ResourceType, tier string) (*StrategyConfig, error)
type PostgresProvider ¶
type PostgresProvider struct { Client client.Client Logger *logrus.Entry ConfigManager ConfigManager PodCommander resources.PodCommander }
func NewOpenShiftPostgresProvider ¶
func NewOpenShiftPostgresProvider(client client.Client, cs *kubernetes.Clientset, logger *logrus.Entry) *PostgresProvider
func (*PostgresProvider) CreateDeployment ¶
func (p *PostgresProvider) CreateDeployment(ctx context.Context, d *appsv1.Deployment, postgresCfg *PostgresStrat) error
func (*PostgresProvider) CreatePVC ¶
func (p *PostgresProvider) CreatePVC(ctx context.Context, pvc *v1.PersistentVolumeClaim, postgresCfg *PostgresStrat) error
func (*PostgresProvider) CreateSecret ¶
func (p *PostgresProvider) CreateSecret(ctx context.Context, s *v1.Secret, postgresCfg *PostgresStrat) error
func (*PostgresProvider) CreateService ¶
func (p *PostgresProvider) CreateService(ctx context.Context, s *v1.Service, postgresCfg *PostgresStrat) error
func (*PostgresProvider) DeletePostgres ¶
func (p *PostgresProvider) DeletePostgres(ctx context.Context, ps *v1alpha1.Postgres) (croType.StatusMessage, error)
func (*PostgresProvider) GetName ¶
func (p *PostgresProvider) GetName() string
func (*PostgresProvider) GetReconcileTime ¶
func (p *PostgresProvider) GetReconcileTime(pg *v1alpha1.Postgres) time.Duration
func (*PostgresProvider) ReconcileDatabaseUserRoles ¶
func (p *PostgresProvider) ReconcileDatabaseUserRoles(ctx context.Context, d *appsv1.Deployment, u string) error
func (*PostgresProvider) ReconcilePostgres ¶ added in v0.32.0
func (p *PostgresProvider) ReconcilePostgres(ctx context.Context, ps *v1alpha1.Postgres) (*providers.PostgresInstance, croType.StatusMessage, error)
func (*PostgresProvider) SupportsStrategy ¶
func (p *PostgresProvider) SupportsStrategy(d string) bool
type PostgresStrat ¶
type PostgresStrat struct { PostgresDeploymentSpec *appsv1.DeploymentSpec `json:"deploymentSpec"` PostgresServiceSpec *v1.ServiceSpec `json:"serviceSpec"` PostgresPVCSpec *v1.PersistentVolumeClaimSpec `json:"pvcSpec"` PostgresSecretData map[string]string `json:"secretData"` // contains filtered or unexported fields }
PostgresStrat to be used to unmarshal strat map
type RedisProvider ¶
type RedisProvider struct { Client client.Client Logger *logrus.Entry ConfigManager ConfigManager }
func NewOpenShiftRedisProvider ¶
func NewOpenShiftRedisProvider(client client.Client, logger *logrus.Entry) *RedisProvider
func (*RedisProvider) CreateConfigMap ¶
func (p *RedisProvider) CreateConfigMap(ctx context.Context, cm *apiv1.ConfigMap, redisCfg *RedisStrat) error
func (*RedisProvider) CreateDeployment ¶
func (p *RedisProvider) CreateDeployment(ctx context.Context, d *appsv1.Deployment, redisCfg *RedisStrat) error
func (*RedisProvider) CreatePVC ¶
func (p *RedisProvider) CreatePVC(ctx context.Context, pvc *apiv1.PersistentVolumeClaim, redisCfg *RedisStrat) error
func (*RedisProvider) CreateRedis ¶
func (p *RedisProvider) CreateRedis(ctx context.Context, r *v1alpha1.Redis) (*providers.RedisCluster, croType.StatusMessage, error)
func (*RedisProvider) CreateService ¶
func (p *RedisProvider) CreateService(ctx context.Context, s *apiv1.Service, redisCfg *RedisStrat) error
func (*RedisProvider) DeleteRedis ¶
func (p *RedisProvider) DeleteRedis(ctx context.Context, r *v1alpha1.Redis) (croType.StatusMessage, error)
func (*RedisProvider) GetName ¶
func (p *RedisProvider) GetName() string
func (*RedisProvider) GetReconcileTime ¶
func (p *RedisProvider) GetReconcileTime(r *v1alpha1.Redis) time.Duration
func (*RedisProvider) SupportsStrategy ¶
func (p *RedisProvider) SupportsStrategy(d string) bool
type RedisStrat ¶
type RedisStrat struct { RedisDeploymentSpec *appsv1.DeploymentSpec `json:"deploymentSpec"` RedisServiceSpec *apiv1.ServiceSpec `json:"serviceSpec"` RedisPVCSpec *apiv1.PersistentVolumeClaimSpec `json:"pvcSpec"` RedisConfigMapData map[string]string `json:"configMapData"` // contains filtered or unexported fields }
RedisStrat to be used to unmarshal strat map
type StrategyConfig ¶
type StrategyConfig struct {
RawStrategy json.RawMessage `json:"strategy"`
}
Click to show internal directories.
Click to hide internal directories.