Documentation
¶
Index ¶
- Constants
- func CheckBundleSynced(ctx context.Context, cl client.Client, bundleName string, namespace string, ...) error
- func CheckBundleSyncedAllNamespaces(ctx context.Context, cl client.Client, name string, expectedData string) error
- func CheckBundleSyncedAllNamespacesContains(ctx context.Context, cl client.Client, name string, containedData string) error
- func CheckBundleSyncedContains(ctx context.Context, cl client.Client, name string, namespace string, ...) error
- func CheckJKSFileSynced(jksData []byte, expectedPassword string, expectedCertPEMData string) error
- func EventuallyBundleHasSyncedAllNamespaces(ctx context.Context, cl client.Client, bundleName string, expectedData string)
- func EventuallyBundleHasSyncedAllNamespacesContains(ctx context.Context, cl client.Client, bundleName string, containedData string)
- func EventuallyBundleHasSyncedToNamespace(ctx context.Context, cl client.Client, bundleName string, namespace string, ...)
- func EventuallyBundleHasSyncedToNamespaceContains(ctx context.Context, cl client.Client, bundleName string, namespace string, ...)
- func NewTestBundleConfigMapTarget(ctx context.Context, cl client.Client, trustNamespace string, td TestData) *trustapi.Bundle
- func NewTestBundleSecretTarget(ctx context.Context, cl client.Client, trustNamespace string, td TestData) *trustapi.Bundle
- func RunSuite(t *testing.T, suiteName string)
- type TestData
Constants ¶
const ( EventuallyTimeout = "90s" EventuallyPollInterval = "100ms" )
Variables ¶
This section is empty.
Functions ¶
func CheckBundleSynced ¶ added in v0.4.0
func CheckBundleSynced(ctx context.Context, cl client.Client, bundleName string, namespace string, expectedData string) error
CheckBundleSynced returns nil if the given Bundle has synced the expected data to the given namespace, or else returns a descriptive error if that's not the case. - Skips Namespaces that are Terminating since targets are not synced there. - Ensures the Bundle status has been updated with the appropriate target. - Ensures the Bundle has the correct status condition with the same ObservedGeneration as the current Generation.
func CheckBundleSyncedAllNamespaces ¶ added in v0.4.0
func CheckBundleSyncedAllNamespaces(ctx context.Context, cl client.Client, name string, expectedData string) error
CheckBundleSyncedAllNamespaces calls CheckBundleSynced for all namespaces and returns an error if any of them failed
func CheckBundleSyncedAllNamespacesContains ¶ added in v0.11.1
func CheckBundleSyncedAllNamespacesContains(ctx context.Context, cl client.Client, name string, containedData string) error
CheckBundleSyncedAllNamespacesContains calls CheckBundleSyncedContains for all namespaces and returns an error if any of them failed
func CheckBundleSyncedContains ¶ added in v0.11.1
func CheckBundleSyncedContains(ctx context.Context, cl client.Client, name string, namespace string, containedData string) error
CheckBundleSyncedContains is similar to CheckBundleSynced but only checks that the synced bundle contains the given data, along with checking that the rest of the data contains at least one valid certificate
func CheckJKSFileSynced ¶ added in v0.5.0
CheckJKSFileSynced ensures that the given JKS data
func EventuallyBundleHasSyncedAllNamespaces ¶ added in v0.4.0
func EventuallyBundleHasSyncedAllNamespaces(ctx context.Context, cl client.Client, bundleName string, expectedData string)
EventuallyBundleHasSyncedAllNamespaces tries to assert that the given bundle is synced correctly to every namespace until either the assertion passes or the timeout is triggered
func EventuallyBundleHasSyncedAllNamespacesContains ¶ added in v0.11.1
func EventuallyBundleHasSyncedAllNamespacesContains(ctx context.Context, cl client.Client, bundleName string, containedData string)
EventuallyBundleHasSyncedAllNamespacesContains tries to assert that the given bundle is synced correctly to every namespace until either the assertion passes or the timeout is triggered
func EventuallyBundleHasSyncedToNamespace ¶ added in v0.4.0
func EventuallyBundleHasSyncedToNamespace(ctx context.Context, cl client.Client, bundleName string, namespace string, expectedData string)
EventuallyBundleHasSyncedToNamespace tries to assert that the given bundle is synced correctly to the given namespace until either the assertion passes or the timeout is triggered
func EventuallyBundleHasSyncedToNamespaceContains ¶ added in v0.11.1
func EventuallyBundleHasSyncedToNamespaceContains(ctx context.Context, cl client.Client, bundleName string, namespace string, containedData string)
EventuallyBundleHasSyncedToNamespaceContains tries to assert that the given bundle is synced correctly to the given namespace until either the assertion passes or the timeout is triggered
func NewTestBundleConfigMapTarget ¶ added in v0.7.0
func NewTestBundleConfigMapTarget(ctx context.Context, cl client.Client, trustNamespace string, td TestData) *trustapi.Bundle
newTestBundleConfigMapTarget creates a new Bundle in the API using the input test data with target set to ConfigMap. Returns the create Bundle object.
Types ¶
type TestData ¶
type TestData struct {
Sources struct {
ConfigMap struct {
trustapi.SourceObjectKeySelector
Data string
}
Secret struct {
trustapi.SourceObjectKeySelector
Data string
}
InLine struct {
Data string
}
}
Target trustapi.TargetTemplate
}
TestData is used as a set of input data to a Bundle suite test. It represents a subset of the Bundle API spec.
func DefaultTrustData ¶
func DefaultTrustData() TestData
DefaultTrustData returns a well-known set of default data for a test. Resulting Bundle will sync to the Target "target-key".