Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

fix: Fix some path handling in collect-windows-logs script #2488

Merged
merged 1 commit into from
Dec 26, 2019

Conversation

PatrickLang
Copy link
Contributor

Reason for Change:

The previous method I used to create an array of files would sometimes end up creating a two-dimensional array. Allocating it separately as an empty array and always using += avoids this and is easier to read

@acs-bot acs-bot added the size/S label Dec 19, 2019
@PatrickLang
Copy link
Contributor Author

/assign @marosset

@codecov
Copy link

codecov bot commented Dec 19, 2019

Codecov Report

Merging #2488 into master will not change coverage.
The diff coverage is n/a.

@@          Coverage Diff           @@
##           master   #2488   +/-   ##
======================================
  Coverage    72.7%   72.7%           
======================================
  Files         130     130           
  Lines       24105   24105           
======================================
  Hits        17526   17526           
  Misses       5553    5553           
  Partials     1026    1026

marosset
marosset previously approved these changes Dec 19, 2019
Copy link
Contributor

@marosset marosset left a comment

Choose a reason for hiding this comment

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

/lgtm

@acs-bot acs-bot added the lgtm label Dec 19, 2019
@acs-bot acs-bot removed the lgtm label Dec 20, 2019
@PatrickLang PatrickLang changed the title bug: Fix some path handling in collect-windows-logs script fix: Fix some path handling in collect-windows-logs script Dec 20, 2019
@marosset
Copy link
Contributor

I'm testing this out on some of my clusters i have up.

@@ -1,11 +1,24 @@
$lockedFiles = "kubelet.err.log", "kubelet.log", "kubeproxy.log", "kubeproxy.err.log", "containerd.err.log", "containerd.log", "azure-vnet-telemetry.log"
$lockedFiles = "kubelet.err.log", "kubelet.log", "kubeproxy.log", "kubeproxy.err.log", "containerd.err.log", "containerd.log", "azure-vnet-telemetry.log", "azure-vnet.log"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you want to add azure-vnet-ipam.log here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure why not. I haven't seen it fail on that file but if azure-vnet.log can be locked this one probably can too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

interesting - I don't have a c:\k\azure-vnet-ipam.log

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just azure-vnet-ipam.json - is that what you meant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I took azure-vnet-ipam.log back out and rebased to keep the history clean

Copy link
Contributor

Choose a reason for hiding this comment

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

strange

$paths += $tempFile
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be a good idea to add a log statement here like "Fetching ETW events, this may take a while..." because this takes a while and the first time I rant he script I thought it hung copying files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok new output:

.\collect-windows-logs.ps1


    Directory: C:\Users\azureuser\AppData\Local\Temp


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       12/21/2019  12:16 AM                nz3m4hge.ctn
Copying kubelet.err.log to temp
Copying kubelet.log to temp
Copying kubeproxy.log to temp
Copying kubeproxy.err.log to temp
Copying containerd.err.log to temp
Copying containerd.log to temp
Copying azure-vnet-telemetry.log to temp
Copying azure-vnet.log to temp
Exporting ETW events to CSV files
WARNING: The names of some imported commands from the module 'helper' include unapproved verbs that might make them less
discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list  of approved verbs, type Get-Verb.
File c:\k\debug\dumpVfpPolicies.ps1 already exists.
File c:\k\debug\hns.psm1 already exists.
File c:\k\debug\starthnstrace.cmd already exists.
File c:\k\debug\startpacketcapture.cmd already exists.
File c:\k\debug\stoppacketcapture.cmd already exists.
File c:\k\debug\portReservationTest.ps1 already exists.
WARNING: The names of some imported commands from the module 'hns' include unapproved verbs that might make them less discoverable.   To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved    verbs, type Get-Verb.
C:\k\debug\tj5otk5h.5uh
WARNING: The names of some imported commands from the module 'helper' include unapproved verbs that might make them less
discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list  of approved verbs, type Get-Verb.
File c:\k\debug\VFP.psm1 already exists.
Logs are available at C:\k\debug\tj5otk5h.5uh
Compressing all logs to 2758k8s010-20191221-121625_logs.zip



FullName                                                                     Length
--------                                                                     ------
C:\k\azure-vnet-telemetry.log.1                                             5252718
C:\k\azure-vnet-telemetry.log.2                                             5247427
C:\k\azure-vnet-telemetry.log.3                                             5245465
C:\k\azure-vnet-telemetry.log.4                                             5248190
C:\k\azure-vnet-telemetry.log.5                                             5243766
C:\k\azure-vnet-telemetry.log.6                                             5245985
C:\k\azure-vnet-telemetry.log.7                                             5245989
C:\k\azure-vnet.log.1                                                       5243524
C:\k\azure-vnet.log.2                                                       5243613
C:\k\azure-vnet.log.3                                                       5243571
C:\k\azure-vnet.log.4                                                       5242931
C:\k\azure-vnet.log.5                                                       5243187
C:\k\azure-vnet.log.6                                                       5245861
C:\k\azure-vnet.log.7                                                       5243308
C:\k\kubelet.err-20191211T032141.867.log                                    1048609
C:\k\kubelet.err-20191211T081458.750.log                                    1048447
C:\k\kubelet.err-20191211T130814.621.log                                    1048342
C:\k\kubelet.err-20191211T180129.501.log                                    1048300
C:\k\kubelet.err-20191212T011812.436.log                                    1048585
C:\k\kubelet.err-20191212T075412.704.log                                    1048357
C:\k\kubelet.err-20191212T144517.626.log                                    1048505
C:\k\kubelet.err-20191212T195233.336.log                                    1048715
C:\k\kubelet.err-20191212T223313.374.log                                    1048088
C:\k\kubelet.err-20191212T223313.375.log                                        107
C:\k\kubelet.err-20191212T223313.391.log                                        451
C:\k\kubelet.err-20191219T205751.077.log                                    1048601
C:\k\kubelet.err-20191219T225931.084.log                                    1047781
C:\k\kubelet.err-20191219T225931.086.log                                        107
C:\k\kubelet.err-20191219T225931.101.log                                        279
C:\k\kubelet.err-20191220T010050.419.log                                    1048191
C:\k\kubelet.err-20191220T010050.420.log                                        102
C:\k\kubelet.err-20191220T010050.435.log                                        322
C:\k\kubeproxy-20191215T101807.586.log                                      1048612
C:\k\kubeproxy-20191217T230149.480.log                                      1048608
C:\k\kubeproxy.err-20191212T060357.408.log                                  1048632
C:\k\kubeproxy.err-20191218T160308.890.log                                  1048654
C:\k\kubeproxy.err-20191220T181856.436.log                                  1048612
C:\k\windowsnodereset.log                                                      1800
C:\Users\azureuser\AppData\Local\Temp\nz3m4hge.ctn\kubelet.err.log           584131
C:\Users\azureuser\AppData\Local\Temp\nz3m4hge.ctn\kubelet.log                 4729
C:\Users\azureuser\AppData\Local\Temp\nz3m4hge.ctn\kubeproxy.log             355635
C:\Users\azureuser\AppData\Local\Temp\nz3m4hge.ctn\kubeproxy.err.log         192080
C:\Users\azureuser\AppData\Local\Temp\nz3m4hge.ctn\azure-vnet-telemetry.log 1093156
C:\Users\azureuser\AppData\Local\Temp\nz3m4hge.ctn\azure-vnet.log            211162
C:\Users\azureuser\AppData\Local\Temp\\20191221-121625_services.csv
C:\Users\azureuser\AppData\Local\Temp\\20191221-121625_hyper-v-compute-operational.csv
C:\Users\azureuser\AppData\Local\Temp\\20191221-121625_docker.csv
C:\Users\azureuser\AppData\Local\Temp\\20191221-121625_pagefile.txt
C:\k\debug\tj5otk5h.5uh\arp.txt
C:\k\debug\tj5otk5h.5uh\docker.txt
C:\k\debug\tj5otk5h.5uh\dynamicportrange.txt
C:\k\debug\tj5otk5h.5uh\endpoint.txt
C:\k\debug\tj5otk5h.5uh\Ethernet 2_int.txt
C:\k\debug\tj5otk5h.5uh\excludedportrange.txt
C:\k\debug\tj5otk5h.5uh\hcsdiag.txt
C:\k\debug\tj5otk5h.5uh\hnsdiag.txt
C:\k\debug\tj5otk5h.5uh\ip.txt
C:\k\debug\tj5otk5h.5uh\mtu.txt
C:\k\debug\tj5otk5h.5uh\network.txt
C:\k\debug\tj5otk5h.5uh\networkdetailed.txt
C:\k\debug\tj5otk5h.5uh\nmscrub.txt
C:\k\debug\tj5otk5h.5uh\nvspinfo.txt
C:\k\debug\tj5otk5h.5uh\policy.txt
C:\k\debug\tj5otk5h.5uh\ports.txt
C:\k\debug\tj5otk5h.5uh\reservedports.txt
C:\k\debug\tj5otk5h.5uh\routes.txt
C:\k\debug\tj5otk5h.5uh\tcpconnections.txt
C:\k\debug\tj5otk5h.5uh\vEthernet (Ethernet 2)_int.txt
C:\k\debug\tj5otk5h.5uh\vEthernet (nat)_int.txt
C:\k\debug\tj5otk5h.5uh\vfpOutput.txt
C:\k\debug\tj5otk5h.5uh\vswitchForwarding.txt
C:\k\debug\tj5otk5h.5uh\winver.txt




    Directory: C:\Users\azureuser


Mode          LastWriteTime  Length Name
----          -------------  ------ ----
-a---- 12/21/2019  12:16 AM 3258444 2758k8s010-20191221-121625_logs.zip

Copy link
Contributor

@marosset marosset left a comment

Choose a reason for hiding this comment

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

/lgtm

@acs-bot acs-bot added the lgtm label Dec 26, 2019
@acs-bot acs-bot merged commit bbd5e80 into Azure:master Dec 26, 2019
@acs-bot
Copy link

acs-bot commented Dec 26, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: marosset, PatrickLang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [PatrickLang,marosset]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mboersma mboersma added this to the v0.46.0 milestone Jan 7, 2020
acs-bot pushed a commit that referenced this pull request Jan 9, 2020
* Rashmi/ciprod12042019 (#3)

improvement: Update Containermonitoring addon for december release (#1)

* Fixing yaml indentation issues for omsagent (#4)

Fixing yaml indentation issues for omsagent

* Fixing more indentation issues in omsagent yaml (#5)

Fixing more indentation issues in omsagent yaml

* updating templates_generated file

* Fix: Updating generated file to fix unit tests (#6)

fix: Updating generated file to fix unit tests

* Adding test coverage for 1.16 and 1.17 (#7)

Adding test coverage for 1.16 and 1.17

* Merging changes for omsagent latest release - ciprod01072020 after syncing from remote master(#8)

* chore: use go template comments for generate proxy certs script (#2336)

* fix: fix ARM dependency issues with vm user-specified extensions on node pools (#2398)

* fix: fix ARM dependency issues if many extensions are specified for a node profile

* fix scale up case for windows vhd case. (#2483)

* refactor: make cilium addon user-configurable (#2480)

* refactor: make cilium addon user-configurable

* chore: clarify that cilium doesn't work w/ 1.16 and above, add validation

* test: addons UT

* test: go template UT

* ci: use Standard_D8_v3 for cilium test, only run NetworkPolicy tests

* fix: error message language

* chore: remove debug fmt.Println

* ci: revert back to Standard_D2_v3

* chore: upgrade cni-plugins to v0.7.6 (#2484)

* fix: hard-coding hyper-v generation when using VHD URls as a quick unblock (#2487)

* feat: Configuring docker log rotation for Windows nodes (#2478)

* feat: Antrea plugin support in AKS Engine (#2407)

* Antrea plugin support in AKS Engine

* chore: clean up

* chore: use ContainerImage

* chore: generated code

* refactor: Updating antrea yaml to 0.2.0

Co-authored-by: Jack Francis <jackfrancis@gmail.com>

* chore: lint (#2493)

* test: revert change to default kubernetes.json api model example (#2494)

* chore: update cloud-provider-azure components to v0.4.0 (#2473)

* chore: update cloud-provider-azure components to v0.4.0

See https://github.com/kubernetes-sigs/cloud-provider-azure/releases/tag/v0.4.0

* refactor: strip MCR constant to base hostname of URL

* fix: fetch Azure cloud-manager images from /oss/kubernetes/

* refactor: make audit-policy and azure-cloud-provider addons user-configurable (#2496)

* chore: pre-pull k8s v1.15.7-azs (#2490)

* fix: Fix some path handling in collect-windows-logs script (#2488)

* docs: remove mentions of old orchestrators (#2501)

* chore: Targeting dec patches for windows VHD (#2505)

* refactor: move StorageClass into azure-cloud-provider addon (#2497)

* add "Standard_DS3_v2" to "AcceleratedNetworking" supported list (#2509)

* ci: collect logs during E2E runs (#2520)

* refactor: user-configurable flannel and scheduled maintenance addons (#2517)

* chore: update Azure NPM to v1.0.31 (#2521)

* feat: add support for Kubernetes 1.18.0-alpha.1 (#2503)

* feat: add support for Kubernetes 1.18.0-alpha.1

See https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.18.md#changelog-since-v1170

* test: add 1.18 to Jenkinsfile

* ci: disable kms for 1.18

* chore: move flannel 1.18 spec to containeraddons

* chore: generated code

* fix: use new cloudprovider implementation for 1.18

Co-authored-by: Jack Francis <jackfrancis@gmail.com>

* test: don't test non-working >= 1.16 flannel + docker (#2524)

* fix: apply new master node labels for k8s v1.18+ compatibility (#2467)

* fix: apply new master node labels for k8s v1.18+ compatibility

* test: check master labels in the future for back-compat

* feat: cleaning up old kubelet/kubeproxy logs for Windows nodes (#2504)

* feat: cleaning up old kubelet/kubeproxy logs for Windows nodes

* Fixing path to look for logs

* generated files

* refactor: standardize to "addons", deprecate "containeraddons" (#2525)

* fix: configure addons before setting kubelet config (#2513)

* chore: update addon-resizer (#2527)

See https://github.com/kubernetes/autoscaler/releases/tag/addon-resizer-1.8.7

* fix: aci-connector region is ignored (#2535)

* test: use LOCATION env var for api model in E2E tests (#2542)

* fix: promote system addons to system-cluster-critical (#2533)

* test: use northeurope for byok testing (#2536)

* Changes for omsagent-version-ciprod01072020

* Committing generated file

Co-authored-by: Jack Francis <jackfrancis@gmail.com>
Co-authored-by: Mark Rossetti <marosset@microsoft.com>
Co-authored-by: Rohit <rjaini@microsoft.com>
Co-authored-by: Rahul Jain <58573065+reachjainrahul@users.noreply.github.com>
Co-authored-by: Matt Boersma <Matt.Boersma@microsoft.com>
Co-authored-by: Javier Darsie <44655727+jadarsie@users.noreply.github.com>
Co-authored-by: Patrick Lang <PatrickLang@users.noreply.github.com>
Co-authored-by: Wenjun Wu <wenjun.wu@live.com>
Co-authored-by: Jaeryn <13284103+jaer-tsun@users.noreply.github.com>
Co-authored-by: Anish Ramasekar <anish.ramasekar@gmail.com>

* deleting github merge auto-generated files

* Adding back 1.17 omsagent yaml changes

* Updating generated file to address build failures

Co-authored-by: Jack Francis <jackfrancis@gmail.com>
Co-authored-by: Mark Rossetti <marosset@microsoft.com>
Co-authored-by: Rohit <rjaini@microsoft.com>
Co-authored-by: Rahul Jain <58573065+reachjainrahul@users.noreply.github.com>
Co-authored-by: Matt Boersma <Matt.Boersma@microsoft.com>
Co-authored-by: Javier Darsie <44655727+jadarsie@users.noreply.github.com>
Co-authored-by: Patrick Lang <PatrickLang@users.noreply.github.com>
Co-authored-by: Wenjun Wu <wenjun.wu@live.com>
Co-authored-by: Jaeryn <13284103+jaer-tsun@users.noreply.github.com>
Co-authored-by: Anish Ramasekar <anish.ramasekar@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants