Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Load ipvs modules before enabling conntrack #521

Merged
merged 2 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix typo and replaced deprecated ioutil package.
  • Loading branch information
mneverov committed Aug 22, 2023
commit 82bbfbb574aab2ef2666b7387d198bfc54651b68
4 changes: 2 additions & 2 deletions backends/ipvs/internal/ipvs/util.go
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can move both the changes in a separate commit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type procSysctl struct {

// GetSysctl returns the value for the specified sysctl setting
func (*procSysctl) GetSysctl(sysctl string) (int, error) {
data, err := ioutil.ReadFile(path.Join(sysctlBase, sysctl))
data, err := os.ReadFile(path.Join(sysctlBase, sysctl))
if err != nil {
return -1, err
}
Expand All @@ -64,7 +64,7 @@ func (*procSysctl) GetSysctl(sysctl string) (int, error) {

// SetSysctl modifies the specified sysctl flag to the new value
func (*procSysctl) SetSysctl(sysctl string, newVal int) error {
return ioutil.WriteFile(path.Join(sysctlBase, sysctl), []byte(strconv.Itoa(newVal)), 0640)
return os.WriteFile(path.Join(sysctlBase, sysctl), []byte(strconv.Itoa(newVal)), 0640)
}

// EnsureSysctl sets a kernel sysctl to a given numeric value.
Expand Down
2 changes: 1 addition & 1 deletion backends/ipvs/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (b *backend) Setup() {
// right now it's a No-Op, will shift ipset initialization there
err = controller.ipsetsManager.Setup()
if err != nil {
klog.Fatal("unable to initialize ipvs manager", "error", err)
klog.Fatal("unable to initialize ipsets manager", "error", err)
}

// initialize ip sets
Expand Down