-
Notifications
You must be signed in to change notification settings - Fork 451
/
fluent_operator.go
44 lines (37 loc) · 1.02 KB
/
fluent_operator.go
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors
//
// SPDX-License-Identifier: Apache-2.0
package shared
import (
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/gardener/gardener/imagevector"
"github.com/gardener/gardener/pkg/component"
"github.com/gardener/gardener/pkg/component/observability/logging/fluentoperator"
)
// NewFluentOperator instantiates a new `Fluent Operator` component.
func NewFluentOperator(
c client.Client,
gardenNamespaceName string,
enabled bool,
priorityClassName string,
) (
deployer component.DeployWaiter,
err error,
) {
operatorImage, err := imagevector.ImageVector().FindImage(imagevector.ImageNameFluentOperator)
if err != nil {
return nil, err
}
deployer = fluentoperator.NewFluentOperator(
c,
gardenNamespaceName,
fluentoperator.Values{
Image: operatorImage.String(),
PriorityClassName: priorityClassName,
},
)
if !enabled {
deployer = component.OpDestroyWithoutWait(deployer)
}
return deployer, nil
}