diff --git a/reconciler/configstore.go b/reconciler/configstore.go index c5c9c319f..6b61856d5 100644 --- a/reconciler/configstore.go +++ b/reconciler/configstore.go @@ -20,6 +20,20 @@ import "context" // ConfigStore is used to attach the frozen configuration to the context. type ConfigStore interface { - // ConfigStore is used to attach the frozen configuration to the context. + // ToContext is used to attach the frozen configuration to the context. ToContext(ctx context.Context) context.Context } + +// ConfigStores is used to combine multiple ConfigStore and attach multiple frozen configurations +// to the context. +type ConfigStores []ConfigStore + +// ConfigStores implements ConfigStore interface. +var _ ConfigStore = ConfigStores{} + +func (stores ConfigStores) ToContext(ctx context.Context) context.Context { + for _, s := range stores { + ctx = s.ToContext(ctx) + } + return ctx +}