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 CheckBundleSyncedAllNamespacesStartsWith(ctx context.Context, cl client.Client, name string, startingData string) error
- func CheckBundleSyncedStartsWith(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 EventuallyBundleHasSyncedAllNamespacesStartsWith(ctx context.Context, cl client.Client, bundleName string, startingData string)
- func EventuallyBundleHasSyncedToNamespace(ctx context.Context, cl client.Client, bundleName string, namespace string, ...)
- func EventuallyBundleHasSyncedToNamespaceStartsWith(ctx context.Context, cl client.Client, bundleName string, namespace string, ...)
- func NewTestBundle(ctx context.Context, cl client.Client, opts bundle.Options, td TestData) *trustapi.Bundle
- func RunSuite(t *testing.T, suiteName, artifactDir string)
- type TestData
Constants ¶
const ( EventuallyTimeout = "30s" 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 CheckBundleSyncedAllNamespacesStartsWith ¶ added in v0.4.0
func CheckBundleSyncedAllNamespacesStartsWith(ctx context.Context, cl client.Client, name string, startingData string) error
CheckBundleSyncedAllNamespacesStartsWith calls CheckBundleSyncedStartsWith for all namespaces and returns an error if any of them failed
func CheckBundleSyncedStartsWith ¶ added in v0.4.0
func CheckBundleSyncedStartsWith(ctx context.Context, cl client.Client, name string, namespace string, startingData string) error
CheckBundleSyncedStartsWith is similar to CheckBundleSynced but only checks that the synced bundle starts with 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 EventuallyBundleHasSyncedAllNamespacesStartsWith ¶ added in v0.4.0
func EventuallyBundleHasSyncedAllNamespacesStartsWith(ctx context.Context, cl client.Client, bundleName string, startingData string)
EventuallyBundleHasSyncedAllNamespacesStartsWith 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 EventuallyBundleHasSyncedToNamespaceStartsWith ¶ added in v0.4.0
func EventuallyBundleHasSyncedToNamespaceStartsWith(ctx context.Context, cl client.Client, bundleName string, namespace string, startingData string)
EventuallyBundleHasSyncedToNamespaceStartsWith tries to assert that the given bundle is synced correctly to the given namespace until either the assertion passes or the timeout is triggered
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.KeySelector }
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".