mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-06-09 08:55:55 -04:00
Merge pull request #118433 from testwill/ipvs
chore: should use buf.String() instead of string(buf.Bytes())
This commit is contained in:
commit
eca1f9d2d5
1 changed files with 2 additions and 2 deletions
|
|
@ -1698,7 +1698,7 @@ func TestMasqueradeRule(t *testing.T) {
|
|||
|
||||
buf := bytes.NewBuffer(nil)
|
||||
_ = ipt.SaveInto(utiliptables.TableNAT, buf)
|
||||
natRules := strings.Split(string(buf.Bytes()), "\n")
|
||||
natRules := strings.Split(buf.String(), "\n")
|
||||
var hasMasqueradeJump, hasMasqRandomFully bool
|
||||
for _, line := range natRules {
|
||||
rule, _ := iptablestest.ParseRule(line, false)
|
||||
|
|
@ -3890,7 +3890,7 @@ func getRules(ipt *iptablestest.FakeIPTables, chain utiliptables.Chain) []*iptab
|
|||
buf := bytes.NewBuffer(nil)
|
||||
_ = ipt.SaveInto(utiliptables.TableNAT, buf)
|
||||
_ = ipt.SaveInto(utiliptables.TableFilter, buf)
|
||||
lines := strings.Split(string(buf.Bytes()), "\n")
|
||||
lines := strings.Split(buf.String(), "\n")
|
||||
for _, l := range lines {
|
||||
if !strings.HasPrefix(l, "-A ") {
|
||||
continue
|
||||
|
|
|
|||
Loading…
Reference in a new issue