testconfigobserver

package
v0.0.0-...-f3ad71e Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithPrefix

WithPrefix adds a prefix to the path the input observer would otherwise observe into

Types

type ConfigObserver

type ConfigObserver struct {
	// contains filtered or unexported fields
}

func NewConfigObserver

func NewConfigObserver(
	operatorClient v1helpers.OperatorClient,
	listers originalconfigobserver.Listers,
	informers []factory.Informer,
	observers ...originalconfigobserver.ObserveConfigFunc,
) *ConfigObserver

NewConfigObserver creates a config observer that watches changes to a nested field (nestedConfigPath) in the config. Useful when the config is shared across multiple controllers in the same process.

Example:

Given the following configuration, you could run two separate controllers and point each to its own section. The first controller would be responsible for "oauthAPIServer" and the second for "oauthServer" section.

"observedConfig": {
  "oauthAPIServer": {
    "apiServerArguments": {"tls-min-version": "VersionTLS12"}
  },
  "oauthServer": {
    "corsAllowedOrigins": [ "//127\\.0\\.0\\.1(:|$)","//localhost(:|$)"]
  }
}

oauthAPIController := NewNestedConfigObserver(..., []string{"oauthAPIServer"} oauthServerController := NewNestedConfigObserver(..., []string{"oauthServer"}

func (ConfigObserver) Sync

func (c ConfigObserver) Sync(ctx context.Context, syncCtx factory.SyncContext) error

sync reacts to a change in prereqs by finding information that is required to match another value in the cluster. This must be information that is logically "owned" by another component.

Jump to

Keyboard shortcuts

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