Skip to content

Commit

Permalink
use logsapi.LoggingConfiguration instead of logs.Options
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
  • Loading branch information
inteon committed Aug 17, 2023
1 parent 955db5a commit dfdbeb8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
5 changes: 2 additions & 3 deletions internal/apis/config/controller/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ package controller
import (
"time"

"k8s.io/component-base/logs"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
logsapi "k8s.io/component-base/logs/api/v1"
)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down Expand Up @@ -110,7 +109,7 @@ type ControllerConfiguration struct {
PprofAddress string

// https://pkg.go.dev/k8s.io/component-base@v0.27.3/logs/api/v1#LoggingConfiguration
Logging logs.Options
Logging logsapi.LoggingConfiguration

// featureGates is a map of feature names to bools that enable or disable experimental
// features.
Expand Down
4 changes: 2 additions & 2 deletions internal/apis/config/webhook/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package webhook

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/component-base/logs"
logsapi "k8s.io/component-base/logs/api/v1"
)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down Expand Up @@ -55,7 +55,7 @@ type WebhookConfiguration struct {
PprofAddress string

// https://pkg.go.dev/k8s.io/component-base@v0.27.3/logs/api/v1#LoggingConfiguration
Logging logs.Options
Logging logsapi.LoggingConfiguration

// featureGates is a map of feature names to bools that enable or disable experimental
// features.
Expand Down
6 changes: 3 additions & 3 deletions pkg/logs/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func InitLogs() {
log.SetFlags(0)
}

func AddFlagsNonDeprecated(opts *logs.Options, fs *pflag.FlagSet) {
func AddFlagsNonDeprecated(opts *logsapi.LoggingConfiguration, fs *pflag.FlagSet) {
var allFlags pflag.FlagSet
logsapi.AddFlags(opts, &allFlags)

Expand All @@ -80,7 +80,7 @@ func AddFlagsNonDeprecated(opts *logs.Options, fs *pflag.FlagSet) {
})
}

func AddFlags(opts *logs.Options, fs *pflag.FlagSet) {
func AddFlags(opts *logsapi.LoggingConfiguration, fs *pflag.FlagSet) {
var allFlags flag.FlagSet
klog.InitFlags(&allFlags)

Expand All @@ -95,7 +95,7 @@ func AddFlags(opts *logs.Options, fs *pflag.FlagSet) {
AddFlagsNonDeprecated(opts, fs)
}

func ValidateAndApply(opts *logs.Options) error {
func ValidateAndApply(opts *logsapi.LoggingConfiguration) error {
return logsapi.ValidateAndApply(opts, nil)
}

Expand Down

0 comments on commit dfdbeb8

Please sign in to comment.