Skip to content

Commit

Permalink
Bump all dependencies to latest to upgrade controller-runtime
Browse files Browse the repository at this point in the history
This upgrades all dependencies of the project to their latest releases. The most notable of those is controller-runtime, which has seen some significant rework. No semantic changes are intended in this change.

Signed-off-by: Markus Thömmes <[email protected]>
  • Loading branch information
markusthoemmes committed Jan 30, 2024
1 parent 02e3d56 commit 501e36c
Show file tree
Hide file tree
Showing 10 changed files with 187 additions and 634 deletions.
23 changes: 11 additions & 12 deletions cmd/fluent-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,24 @@ limitations under the License.
package main

import (
"errors"
"flag"
"os"
"strings"

"errors"

"github.com/joho/godotenv"
"sigs.k8s.io/controller-runtime/pkg/cache"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
// to ensure that exec-entrypoint and run can make use of them.
_ "k8s.io/client-go/plugin/pkg/client/auth"

"github.com/joho/godotenv"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"

fluentbitv1alpha2 "github.com/fluent/fluent-operator/v2/apis/fluentbit/v1alpha2"
fluentdv1alpha1 "github.com/fluent/fluent-operator/v2/apis/fluentd/v1alpha1"
Expand Down Expand Up @@ -87,9 +86,10 @@ func main() {

ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
ctrlOpts := ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Port: 9443,
Scheme: scheme,
Metrics: server.Options{
BindAddress: metricsAddr,
},
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "45c4fdd2.fluent.io",
Expand All @@ -98,10 +98,9 @@ func main() {
if watchNamespaces != "" {
namespacedController = true
namespaces := strings.Split(watchNamespaces, ",")
if len(namespaces) > 1 {
ctrlOpts.NewCache = cache.MultiNamespacedCacheBuilder(namespaces)
} else {
ctrlOpts.Namespace = namespaces[0]
ctrlOpts.Cache.DefaultNamespaces = make(map[string]cache.Config, len(namespaces))
for _, ns := range namespaces {
ctrlOpts.Cache.DefaultNamespaces[ns] = cache.Config{}
}
}

Expand Down
20 changes: 0 additions & 20 deletions config/default/manager_config_patch.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions config/manager/controller_manager_config.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
resources:
- manager.yaml

generatorOptions:
disableNameSuffixHash: true

configMapGenerator:
- name: manager-config
files:
- controller_manager_config.yaml
21 changes: 10 additions & 11 deletions controllers/fluentbitconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"crypto/md5"
"fmt"
"os"
"strings"

"github.com/fluent/fluent-operator/v2/apis/fluentbit/v1alpha2/plugins"

Expand All @@ -35,8 +36,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
"sigs.k8s.io/controller-runtime/pkg/handler"
"sigs.k8s.io/controller-runtime/pkg/source"
"strings"

fluentbitv1alpha2 "github.com/fluent/fluent-operator/v2/apis/fluentbit/v1alpha2"
)
Expand Down Expand Up @@ -334,14 +333,14 @@ func (r *FluentBitConfigReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
For(&fluentbitv1alpha2.FluentBit{}).
Owns(&corev1.Secret{}).
Watches(&source.Kind{Type: &fluentbitv1alpha2.ClusterFluentBitConfig{}}, &handler.EnqueueRequestForObject{}).
Watches(&source.Kind{Type: &fluentbitv1alpha2.FluentBitConfig{}}, &handler.EnqueueRequestForObject{}).
Watches(&source.Kind{Type: &fluentbitv1alpha2.ClusterInput{}}, &handler.EnqueueRequestForObject{}).
Watches(&source.Kind{Type: &fluentbitv1alpha2.ClusterFilter{}}, &handler.EnqueueRequestForObject{}).
Watches(&source.Kind{Type: &fluentbitv1alpha2.ClusterOutput{}}, &handler.EnqueueRequestForObject{}).
Watches(&source.Kind{Type: &fluentbitv1alpha2.ClusterParser{}}, &handler.EnqueueRequestForObject{}).
Watches(&source.Kind{Type: &fluentbitv1alpha2.Filter{}}, &handler.EnqueueRequestForObject{}).
Watches(&source.Kind{Type: &fluentbitv1alpha2.Output{}}, &handler.EnqueueRequestForObject{}).
Watches(&source.Kind{Type: &fluentbitv1alpha2.Parser{}}, &handler.EnqueueRequestForObject{}).
Watches(&fluentbitv1alpha2.ClusterFluentBitConfig{}, &handler.EnqueueRequestForObject{}).
Watches(&fluentbitv1alpha2.FluentBitConfig{}, &handler.EnqueueRequestForObject{}).
Watches(&fluentbitv1alpha2.ClusterInput{}, &handler.EnqueueRequestForObject{}).
Watches(&fluentbitv1alpha2.ClusterFilter{}, &handler.EnqueueRequestForObject{}).
Watches(&fluentbitv1alpha2.ClusterOutput{}, &handler.EnqueueRequestForObject{}).
Watches(&fluentbitv1alpha2.ClusterParser{}, &handler.EnqueueRequestForObject{}).
Watches(&fluentbitv1alpha2.Filter{}, &handler.EnqueueRequestForObject{}).
Watches(&fluentbitv1alpha2.Output{}, &handler.EnqueueRequestForObject{}).
Watches(&fluentbitv1alpha2.Parser{}, &handler.EnqueueRequestForObject{}).
Complete(r)
}
13 changes: 6 additions & 7 deletions controllers/fluentdconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
"sigs.k8s.io/controller-runtime/pkg/handler"
"sigs.k8s.io/controller-runtime/pkg/source"

fluentdv1alpha1 "github.com/fluent/fluent-operator/v2/apis/fluentd/v1alpha1"
"github.com/fluent/fluent-operator/v2/apis/fluentd/v1alpha1/plugins"
Expand Down Expand Up @@ -613,11 +612,11 @@ func (r *FluentdConfigReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
For(&fluentdv1alpha1.Fluentd{}).
Owns(&corev1.Secret{}).
Watches(&source.Kind{Type: &fluentdv1alpha1.ClusterFluentdConfig{}}, &handler.EnqueueRequestForObject{}).
Watches(&source.Kind{Type: &fluentdv1alpha1.FluentdConfig{}}, &handler.EnqueueRequestForObject{}).
Watches(&source.Kind{Type: &fluentdv1alpha1.Filter{}}, &handler.EnqueueRequestForObject{}).
Watches(&source.Kind{Type: &fluentdv1alpha1.ClusterFilter{}}, &handler.EnqueueRequestForObject{}).
Watches(&source.Kind{Type: &fluentdv1alpha1.Output{}}, &handler.EnqueueRequestForObject{}).
Watches(&source.Kind{Type: &fluentdv1alpha1.ClusterOutput{}}, &handler.EnqueueRequestForObject{}).
Watches(&fluentdv1alpha1.ClusterFluentdConfig{}, &handler.EnqueueRequestForObject{}).
Watches(&fluentdv1alpha1.FluentdConfig{}, &handler.EnqueueRequestForObject{}).
Watches(&fluentdv1alpha1.Filter{}, &handler.EnqueueRequestForObject{}).
Watches(&fluentdv1alpha1.ClusterFilter{}, &handler.EnqueueRequestForObject{}).
Watches(&fluentdv1alpha1.Output{}, &handler.EnqueueRequestForObject{}).
Watches(&fluentdv1alpha1.ClusterOutput{}, &handler.EnqueueRequestForObject{}).
Complete(r)
}
93 changes: 47 additions & 46 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,75 +6,76 @@ require (
github.com/fsnotify/fsnotify v1.7.0
github.com/go-kit/kit v0.13.0
github.com/go-kit/log v0.2.1
github.com/go-logr/logr v1.3.0
github.com/go-openapi/errors v0.20.4
github.com/go-logr/logr v1.4.1
github.com/go-openapi/errors v0.21.0
github.com/joho/godotenv v1.5.1
github.com/oklog/run v1.1.0
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.30.0
k8s.io/api v0.26.3
k8s.io/apimachinery v0.27.4
k8s.io/client-go v0.26.3
k8s.io/klog/v2 v2.100.1
sigs.k8s.io/controller-runtime v0.14.6
sigs.k8s.io/yaml v1.3.0
github.com/onsi/gomega v1.31.1
k8s.io/api v0.29.1
k8s.io/apimachinery v0.29.1
k8s.io/client-go v0.29.1
k8s.io/klog/v2 v2.120.1
sigs.k8s.io/controller-runtime v0.17.0
sigs.k8s.io/yaml v1.4.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/emicklei/go-restful/v3 v3.11.2 // indirect
github.com/evanphx/json-patch v5.9.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.20.2 // indirect
github.com/go-openapi/jsonreference v0.20.4 // indirect
github.com/go-openapi/swag v0.22.9 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/imdario/mergo v1.0.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/nxadm/tail v1.4.11 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.46.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/exp v0.0.0-20240119083558-1b970713d09a // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/oauth2 v0.16.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/term v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.32.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.26.1 // indirect
k8s.io/component-base v0.26.1 // indirect
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
k8s.io/apiextensions-apiserver v0.29.1 // indirect
k8s.io/component-base v0.29.1 // indirect
k8s.io/kube-openapi v0.0.0-20240126223410-2919ad4fcfec // indirect
k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
)

replace github.com/imdario/mergo => github.com/imdario/mergo v0.3.12
Loading

0 comments on commit 501e36c

Please sign in to comment.