configmap

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeGlobalConfig

func ChangeGlobalConfig(ctx context.Context, t *testing.T, runcnx *params.Run, configMapName string, data map[string]string) func()

ChangeGlobalConfig patches keys into the controller ConfigMap and returns a function restoring the previous values.

func ProviderHost added in v0.51.0

func ProviderHost(t *testing.T, providerURL string) string

ProviderHost extracts the hostname of a provider URL the way the controller stores it in the allowlist, so that a test comparing what the controller wrote against the instance it talks to compares equal spellings.

func ResetTrustedProviderHostnames added in v0.51.0

func ResetTrustedProviderHostnames(ctx context.Context, t *testing.T, runcnx *params.Run, configMapName string) func()

ResetTrustedProviderHostnames hands the policy back to the controller and forgets what it learned, which is the state a fresh install starts from. It returns a function putting both values back as they were.

A test that wants to watch the controller learn a hostname has to start from here: a configured list is authoritative, while an existing learned entry would make the controller skip the write.

func TrustProviderHostname added in v0.51.0

func TrustProviderHostname(ctx context.Context, t *testing.T, runcnx *params.Run, configMapName, providerURL string) func()

TrustProviderHostname adds the hostname of the provider under test to the controller allowlist, so that an incoming webhook, which carries no provider signature and therefore cannot be trusted on first use, reaches it. It returns a function removing that hostname again.

Only the hostname it added is removed on restore; writing the whole key back would otherwise delete another administrator entry added during the test.

func TrustedProviderHostnames added in v0.51.0

func TrustedProviderHostnames(ctx context.Context, t *testing.T, runcnx *params.Run, configMapName string) (allowlist, autoTrusted []string)

TrustedProviderHostnames returns the administrator allowlist together with the hostnames the controller recorded itself.

Types

This section is empty.

Jump to

Keyboard shortcuts

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