Documentation ¶
Index ¶
- Variables
- func ExpectStatusConditionMetric(g prometheus.Gatherer, expectedMetrics []*StatusConditionValue)
- type ITestStorage
- func (i *ITestStorage) Delete(ctx context.Context, id *api.RemoteSecret) error
- func (i *ITestStorage) Examine(ctx context.Context) error
- func (i *ITestStorage) Get(ctx context.Context, id *api.RemoteSecret) (*remotesecretstorage.SecretData, error)
- func (i *ITestStorage) Initialize(ctx context.Context) error
- func (i *ITestStorage) Len() int
- func (i *ITestStorage) PartialUpdate(ctx context.Context, id *api.RemoteSecret, ...) error
- func (i *ITestStorage) Reset()
- func (i *ITestStorage) SecretStorage() secretstorage.SecretStorage
- func (i *ITestStorage) Store(ctx context.Context, id *api.RemoteSecret, ...) error
- type StatusConditionValue
- type TestClientFactory
Constants ¶
This section is empty.
Variables ¶
View Source
var ITest = struct { TestEnvironment *envtest.Environment Context context.Context //nolint: containedctx // we DO want the context shared across all integration tests... Cancel context.CancelFunc Client client.Client ClientFactory TestClientFactory Storage *ITestStorage OperatorConfiguration *config.OperatorConfiguration Registry *prometheus.Registry }{}
Functions ¶
func ExpectStatusConditionMetric ¶
func ExpectStatusConditionMetric(g prometheus.Gatherer, expectedMetrics []*StatusConditionValue)
ExpectStatusConditionMetric ensure provided Gatherer has a necessary metrics in redhat_appstudio_remotesecret_status_condition
Types ¶
type ITestStorage ¶
type ITestStorage struct {
// contains filtered or unexported fields
}
ITestStorage implements RemoteSecretStorage and uses MemoryStorage as a backend. Provides additional methods to reset backed storage after each test.
func (*ITestStorage) Delete ¶
func (i *ITestStorage) Delete(ctx context.Context, id *api.RemoteSecret) error
func (*ITestStorage) Get ¶
func (i *ITestStorage) Get(ctx context.Context, id *api.RemoteSecret) (*remotesecretstorage.SecretData, error)
func (*ITestStorage) Initialize ¶
func (i *ITestStorage) Initialize(ctx context.Context) error
func (*ITestStorage) Len ¶
func (i *ITestStorage) Len() int
Len return the number of records in the backend storage
func (*ITestStorage) PartialUpdate ¶
func (i *ITestStorage) PartialUpdate(ctx context.Context, id *api.RemoteSecret, dataUpdates *remotesecretstorage.SecretData, deleteKeys []string) error
func (*ITestStorage) Reset ¶
func (i *ITestStorage) Reset()
Reset backend storage to the initial state
func (*ITestStorage) SecretStorage ¶
func (i *ITestStorage) SecretStorage() secretstorage.SecretStorage
SecretStorage returns backend storage
func (*ITestStorage) Store ¶
func (i *ITestStorage) Store(ctx context.Context, id *api.RemoteSecret, data *remotesecretstorage.SecretData) error
type StatusConditionValue ¶
type TestClientFactory ¶
type TestClientFactory struct { GetClientImpl func(ctx context.Context, currentNamespace string, targetSpec *v1beta1.RemoteSecretTarget, targetStatus *v1beta1.TargetStatus) (client.Client, error) ServiceAccountChangedImpl func(client.ObjectKey) }
func (*TestClientFactory) GetClient ¶
func (tcf *TestClientFactory) GetClient(ctx context.Context, currentNamespace string, targetSpec *v1beta1.RemoteSecretTarget, targetStatus *v1beta1.TargetStatus) (client.Client, error)
GetClient implements bindings.ClientFactory
func (*TestClientFactory) ServiceAccountChanged ¶
func (tcf *TestClientFactory) ServiceAccountChanged(sa types.NamespacedName)
ServiceAccountChanged implements bindings.ClientFactory
Click to show internal directories.
Click to hide internal directories.