forked from gardener/gardener
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd.go
More file actions
27 lines (21 loc) · 867 Bytes
/
add.go
File metadata and controls
27 lines (21 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors
//
// SPDX-License-Identifier: Apache-2.0
package extension
import (
"fmt"
"sigs.k8s.io/controller-runtime/pkg/manager"
"github.com/gardener/gardener/pkg/client/kubernetes/clientmap"
operatorconfigv1alpha1 "github.com/gardener/gardener/pkg/operator/apis/config/v1alpha1"
"github.com/gardener/gardener/pkg/operator/controller/extension/extension"
)
// AddToManager adds the extension controllers to the given manager.
func AddToManager(mgr manager.Manager, cfg *operatorconfigv1alpha1.OperatorConfiguration, gardenClientMap clientmap.ClientMap) error {
if err := (&extension.Reconciler{
Config: *cfg,
GardenClientMap: gardenClientMap,
}).AddToManager(mgr); err != nil {
return fmt.Errorf("failed adding main reconciler: %w", err)
}
return nil
}