Skip to content

Commit

Permalink
Merge pull request #160 from jingyuanliang/klog
Browse files Browse the repository at this point in the history
Switch from "github.com/golang/glog" to "k8s.io/klog/v2"
  • Loading branch information
k8s-ci-robot authored Sep 26, 2024
2 parents 75fbd2f + 38d4739 commit 99fef04
Show file tree
Hide file tree
Showing 15 changed files with 11 additions and 2,511 deletions.
20 changes: 10 additions & 10 deletions cmd/ip-masq-agent/ip-masq-agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ import (
"k8s.io/component-base/version/verflag"
"k8s.io/ip-masq-agent/cmd/ip-masq-agent/testing/fakefs"
"k8s.io/ip-masq-agent/pkg/version"
"k8s.io/klog/v2"
utiliptables "k8s.io/kubernetes/pkg/util/iptables"
utilexec "k8s.io/utils/exec"

"github.com/golang/glog"
)

const (
Expand Down Expand Up @@ -129,12 +128,13 @@ func NewMasqDaemon(c *MasqConfig) *MasqDaemon {
}

func main() {
klog.InitFlags(nil)
flag.Parse()

glog.Infof("ip-masq-agent version: %s", version.Version)
klog.Infof("ip-masq-agent version: %s", version.Version)

flag.CommandLine.VisitAll(func(f *flag.Flag) {
glog.Infof("FLAG: --%s=%q", f.Name, f.Value)
klog.Infof("FLAG: --%s=%q", f.Name, f.Value)
})

masqChain = utiliptables.Chain(*masqChainFlag)
Expand All @@ -158,17 +158,17 @@ func (m *MasqDaemon) Run() {
defer time.Sleep(time.Duration(m.config.ResyncInterval))
// resync config
if err := m.osSyncConfig(); err != nil {
glog.Errorf("error syncing configuration: %v", err)
klog.Errorf("error syncing configuration: %v", err)
return
}
// resync rules
if err := m.syncMasqRules(); err != nil {
glog.Errorf("error syncing masquerade rules: %v", err)
klog.Errorf("error syncing masquerade rules: %v", err)
return
}
// resync ipv6 rules
if err := m.syncMasqRulesIPv6(); err != nil {
glog.Errorf("error syncing masquerade rules for ipv6: %v", err)
klog.Errorf("error syncing masquerade rules for ipv6: %v", err)
return
}
}()
Expand All @@ -190,7 +190,7 @@ func (m *MasqDaemon) syncConfig(fs fakefs.FileSystem) error {
defer func() {
if err == nil {
json, _ := utiljson.Marshal(c)
glog.V(2).Infof("using config: %s", string(json))
klog.V(2).Infof("using config: %s", string(json))
}
}()

Expand All @@ -202,10 +202,10 @@ func (m *MasqDaemon) syncConfig(fs fakefs.FileSystem) error {
m.config.MasqLinkLocal = c.MasqLinkLocal
m.config.MasqLinkLocalIPv6 = c.MasqLinkLocalIPv6
m.config.ResyncInterval = c.ResyncInterval
glog.V(2).Infof("no config file found at %q, using default values", configPath)
klog.V(2).Infof("no config file found at %q, using default values", configPath)
return nil
}
glog.V(2).Infof("config file found at %q", configPath)
klog.V(2).Infof("config file found at %q", configPath)

// file exists, read and parse file
yaml, err := fs.ReadFile(configPath)
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module k8s.io/ip-masq-agent
go 1.22

require (
github.com/golang/glog v1.2.0
k8s.io/apimachinery v0.29.1
k8s.io/component-base v0.29.1
k8s.io/klog/v2 v2.110.1
k8s.io/kubernetes v1.29.1
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
)
Expand Down Expand Up @@ -37,7 +37,6 @@ require (
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A=
github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68=
github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
Expand Down
191 changes: 0 additions & 191 deletions vendor/github.com/golang/glog/LICENSE

This file was deleted.

36 changes: 0 additions & 36 deletions vendor/github.com/golang/glog/README.md

This file was deleted.

Loading

0 comments on commit 99fef04

Please sign in to comment.