Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithPrefix ¶
func WithPrefix(observer originalconfigobserver.ObserveConfigFunc, prefix ...string) originalconfigobserver.ObserveConfigFunc
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.