calico icon indicating copy to clipboard operation
calico copied to clipboard

Add the command to determine whether the system has netstat

Open opencmit2 opened this issue 11 months ago • 2 comments

Description

Add the command to determine whether the system has netstat,Can automatically select commands on the system for log prompt output.

Related issues/PRs

fixes #8653

Todos

  • [x] Tests
  • [x] Documentation
  • [x] Release note

Release Note

TBD

Reminder for the reviewer

Make sure that this PR has the correct labels and milestone set.

Every PR needs one docs-* label.

  • docs-pr-required: This change requires a change to the documentation that has not been completed yet.
  • docs-completed: This change has all necessary documentation completed.
  • docs-not-required: This change has no user-facing impact and requires no docs.

Every PR needs one release-note-* label.

  • release-note-required: This PR has user-facing changes. Most PRs should have this label.
  • release-note-not-required: This PR has no user-facing changes.

Other optional labels:

  • cherry-pick-candidate: This PR should be cherry-picked to an earlier release. For bug fixes only.
  • needs-operator-pr: This PR is related to install and requires a corresponding change to the operator.

opencmit2 avatar Mar 26 '24 12:03 opencmit2

Thanks for the PR! I have suggested a cleaner way to do this

This method is just a modification of the current code, which I think is reasonable. If you need to modify it, I can submit it according to the content of my screenshot

opencmit2 avatar Mar 28 '24 02:03 opencmit2

/sem-approve

caseydavenport avatar Mar 29 '24 16:03 caseydavenport

@caseydavenport This is my first time to contribute to Calico. I am not sure how to solve this CI part. Please tell me how to solve this problem.

image

opencmit2 avatar Apr 01 '24 01:04 opencmit2

The CI is complaining that the diags.go file is "dirty"

make check-dirty01:47
make[1]: Entering directory '/home/semaphore/calico'01:47
The following files are dirty01:48
 calicoctl/calicoctl/commands/node/diags.go | 22 +++++++++++-----------01:48
 1 file changed, 11 insertions(+), 11 deletions(-)01:48
make[1]: *** [lib.Makefile:1125: check-dirty] Error 101:48
make[1]: Leaving directory '/home/semaphore/calico'01:48
make: *** [Makefile:41: ci-preflight-checks] Error 2

CI runs a code formatter to make sure that the code is following standard formatting rules and it seems like something is being picked up here.

Looks like it's 22 lines, which means it's probably all of the lines of code. My guess is that it's complaining about tabs instead of spaces?

caseydavenport avatar Apr 01 '24 17:04 caseydavenport

Removing "merge-when-ready" label due to new commits

marvin-tigera avatar Apr 02 '24 01:04 marvin-tigera

@caseydavenport I have replaced all tab characters, please continue to review.

opencmit2 avatar Apr 02 '24 01:04 opencmit2

/sem-approve

caseydavenport avatar Apr 03 '24 16:04 caseydavenport

Removing "merge-when-ready" label due to new commits

marvin-tigera avatar Apr 07 '24 01:04 marvin-tigera

@caseydavenport I don’t know how to modify it anymore. The places I modified are now not tab characters.

opencmit2 avatar Apr 07 '24 01:04 opencmit2

/sem-approve

caseydavenport avatar Apr 15 '24 17:04 caseydavenport

Removing "merge-when-ready" label due to new commits

marvin-tigera avatar Apr 16 '24 01:04 marvin-tigera

Hi @caseydavenport I confirmed that there are no tab characters. Please continue to review。 image

opencmit2 avatar Apr 16 '24 01:04 opencmit2

/sem-approve

caseydavenport avatar Apr 16 '24 15:04 caseydavenport

Hopefully that's it! If not I will try to reproduce locally :crossed_fingers:

caseydavenport avatar Apr 16 '24 15:04 caseydavenport

@caseydavenport Is it possible that the standard just uses tab characters?

Because I ran the command below to check that all other files contain tab characters. 1713317749114

opencmit2 avatar Apr 17 '24 01:04 opencmit2

I've reverted the code to its original submission state. I'm hoping you can assist me in pinpointing where the formatting issue lies. the CI check failed at the same position.

opencmit2 avatar Apr 17 '24 02:04 opencmit2

@opencmit2 thanks for sticking with this - I put up a fork of this PR and merged it here: https://github.com/projectcalico/calico/pull/8725

I think it was actually extra spaces at the end of the line that was the problem.

caseydavenport avatar Apr 17 '24 22:04 caseydavenport