Skip to content

Commit

Permalink
[Windows] Remove prefix "rancher-wins" when collecting antrea-agent logs
Browse files Browse the repository at this point in the history
After switching to Containerd runtime, Antrea doesn't depend on rancher-wins
when running agent. So the agent log files should start with "antrea-agent".

Remove the prefix "rancher-wins" in the file name filters when collecting agent
logs on Windows.

Signed-off-by: Wenying Dong <wenyingd@vmware.com>
  • Loading branch information
wenyingd committed Apr 16, 2024
1 parent 90b3710 commit 87f6b9d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/support/dump_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (d *agentDumper) DumpLog(basedir string) error {
logDir := logdir.GetLogDir()
timeFilter := timestampFilter(d.since)

if err := directoryCopy(d.fs, path.Join(basedir, "logs", "agent"), logDir, "rancher-wins-antrea-agent", timeFilter); err != nil {
if err := directoryCopy(d.fs, path.Join(basedir, "logs", "agent"), logDir, "antrea-agent", timeFilter); err != nil {
return err
}
// Dump OVS logs.
Expand Down Expand Up @@ -106,6 +106,6 @@ func (d *agentDumper) dumpHNSResources(basedir string) error {
}

func (d *agentDumper) DumpMemberlist(basedir string) error {
// memberlist never runs on windows.
// memberlist never runs on Windows.
return nil
}
4 changes: 2 additions & 2 deletions pkg/support/dump_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ func TestDumpLog(t *testing.T) {
fs.MkdirAll(logDir, os.ModePerm)
fs.MkdirAll(antreaWindowsOVSLogDir, os.ModePerm)
fs.MkdirAll(antreaWindowsKubeletLogDir, os.ModePerm)
fs.Create(filepath.Join(logDir, "rancher-wins-antrea-agent.log"))
fs.Create(filepath.Join(logDir, "antrea-agent.exe.INFO"))
fs.Create(filepath.Join(antreaWindowsOVSLogDir, "ovs.log"))
fs.Create(filepath.Join(antreaWindowsKubeletLogDir, "kubelet.log"))

dumper := NewAgentDumper(fs, nil, nil, nil, nil, "7s", true, true)
err := dumper.DumpLog(baseDir)
require.NoError(t, err)

ok, err := afero.Exists(fs, filepath.Join(baseDir, "logs", "agent", "rancher-wins-antrea-agent.log"))
ok, err := afero.Exists(fs, filepath.Join(baseDir, "logs", "agent", "antrea-agent.exe.log"))
require.NoError(t, err)
assert.True(t, ok)
ok, err = afero.Exists(fs, filepath.Join(baseDir, "logs", "ovs", "ovs.log"))
Expand Down

0 comments on commit 87f6b9d

Please sign in to comment.