MCPcopy Create free account
hub / github.com/devfile/devworkspace-operator / Predicates

Function Predicates

pkg/config/predicates.go:25–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23)
24
25func Predicates() predicate.Predicate {
26 return predicate.Funcs{
27 UpdateFunc: func(evt event.UpdateEvent) bool {
28 if config, ok := evt.ObjectNew.(*dw.DevWorkspaceOperatorConfig); ok {
29 syncConfigFrom(config)
30 }
31 return false
32 },
33 CreateFunc: func(evt event.CreateEvent) bool {
34 if config, ok := evt.Object.(*dw.DevWorkspaceOperatorConfig); ok {
35 syncConfigFrom(config)
36 }
37 return false
38 },
39 DeleteFunc: func(evt event.DeleteEvent) bool {
40 if config, ok := evt.Object.(*dw.DevWorkspaceOperatorConfig); ok {
41 if config.Name == OperatorConfigName && config.Namespace == configNamespace {
42 restoreDefaultConfig()
43 }
44 }
45 return false
46 },
47 GenericFunc: func(evt event.GenericEvent) bool {
48 return false
49 },
50 }
51}

Callers

nothing calls this directly

Calls 2

syncConfigFromFunction · 0.85
restoreDefaultConfigFunction · 0.85

Tested by

no test coverage detected