env

package
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
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 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

func CheckJKSFileSynced(jksData []byte, expectedPassword string, expectedCertPEMData string) error

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

func NewTestBundleConfigMapTarget added in v0.7.0

func NewTestBundleConfigMapTarget(ctx context.Context, cl client.Client, opts bundle.Options, 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.

func NewTestBundleSecretTarget added in v0.7.0

func NewTestBundleSecretTarget(ctx context.Context, cl client.Client, opts bundle.Options, td TestData) *trustapi.Bundle

NewTestBundleSecretTarget creates a new Bundle in the API using the input test data. Returns the create Bundle object.

func RunSuite

func RunSuite(t *testing.T, suiteName, artifactDir string)

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".

Jump to

Keyboard shortcuts

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