Skip to content

fix: fix Conntrack GC running in Retina default #1323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 10, 2025

Conversation

manojks1999
Copy link
Contributor

@manojks1999 manojks1999 commented Feb 6, 2025

Description

Please provide a brief description of the changes made in this pull request.

Related Issue

#1314

Below are changes made in current PR:

  • Added a condition of check before creating a instance
  • Check is made by the configs of instance
  • Added with appropriate log

Checklist

  • [ * ] I have read the contributing documentation.
  • [ * ] I signed and signed-off the commits (git commit -S -s ...). See this documentation on signing commits.
  • [ * ] I have correctly attributed the author(s) of the code.
  • [ * ] I have tested the changes locally.
  • [ * ] I have followed the project's style guidelines.
  • [ * ] I have updated the documentation, if necessary.
  • [ * ] I have added tests, if applicable.

@manojks1999 manojks1999 requested a review from a team as a code owner February 6, 2025 19:35
@manojks1999
Copy link
Contributor Author

@microsoft-github-policy-service agree

@microsoft-github-policy-service agree

Copy link
Member

@SRodi SRodi left a comment

Choose a reason for hiding this comment

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

Hi @manojks1999, thanks for opening this PR! Can you please fix all unsuccessful checks? If needed you can "convert to draft" and then switch to "ready for review" once you are done.

@manojks1999
Copy link
Contributor Author

@SRodi , I have fixed the runtime build, able to create a make file locally, but unable to create a docker file as some dependency issue in config.

@manojks1999
Copy link
Contributor Author

@SRodi, I have made changes now we are getting the correct output,

ts=2025-02-08T16:22:14.299Z level=info caller=conntrack/conntrack_linux.go:101 msg="Skipping Conntrack GC loop as packetparser plugin is not enabled"

Please verify once and also can you provide command related to helm install
with respect to packetparser both enabled and disabled, so that I can test your command too, so that have a extra verification.

@manojks1999 manojks1999 changed the title Fix [1314] Conntrack GC running in Retina default fix: fix Conntrack GC running in Retina default Feb 9, 2025
@manojks1999
Copy link
Contributor Author

manojks1999 commented Feb 9, 2025

@SRodi Added a set method for the widows files too.

Copy link
Member

@SRodi SRodi left a comment

Choose a reason for hiding this comment

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

@manojks1999 Thanks for looking into this. I don't think we want and/or is necessary to add the config to Conntrack struct. Have you looked into adding a conditional when we start Conntrack?

// run conntrack GC
ct, err := conntrack.New()

Also, for development environment set up instructions please see this doc https://retina.sh/docs/Contributing/development

Make sure this is tested and you add test results (or screenshots) to the PR description when possible. Please also provide a clear description for this PR.

I'll mark this PR as draft for now, once you have all bits in order, please feel free to change it to "Ready to review". Thanks again!

@SRodi SRodi marked this pull request as draft February 11, 2025 09:42
Copy link
Member

@SRodi SRodi left a comment

Choose a reason for hiding this comment

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

By removing the function isPluginEnables you should also be able to fix the existing golint errors on receiver name and shadow declaration.

Error: pkg/managers/pluginmanager/pluginmanager.go:214:1: receiver-naming: receiver name pm should be consistent with previous receiver name p for PluginManager (revive)
  func (pm *PluginManager) isPluginEnabled(name string) bool {
  	if pm.cfg.EnabledPlugin == nil {
  		return false
  	}
  	for _, plugin := range pm.cfg.EnabledPlugin {
  		if plugin == name {
  			return true
  		}
  	}
  	return false
  }
  Error: pkg/managers/pluginmanager/pluginmanager.go:1[42](https://github.com/microsoft/retina/actions/runs/13476073474/job/37767750405?pr=1323#step:4:44):7: shadow: declaration of "err" shadows declaration at line 119 (govet)
  		ct, err := conntrack.New()
  		    ^

@manojks1999
Copy link
Contributor Author

@SRodi made a changes with variable names

@nddq nddq marked this pull request as ready for review February 27, 2025 22:44
SRodi
SRodi previously approved these changes Mar 3, 2025
Copy link
Member

@SRodi SRodi left a comment

Choose a reason for hiding this comment

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

LGTM but I'd like @nddq to also take a look/approve. Please @manojks1999 also update the branch based on latest main.

nddq
nddq previously approved these changes Mar 3, 2025
@nddq
Copy link
Member

nddq commented Mar 3, 2025

@manojks1999 please sign the commits so we can merge this, thanks!

@manojks1999
Copy link
Contributor Author

@manojks1999 please sign the commits so we can merge this, thanks!

Sure will do that

@manojks1999 manojks1999 force-pushed the disabling_gc_with_packetparser branch from 2d98d04 to 7d83f7a Compare March 8, 2025 20:47
@manojks1999 manojks1999 dismissed stale reviews from nddq and SRodi via cfc2797 March 8, 2025 20:51
@manojks1999 manojks1999 force-pushed the disabling_gc_with_packetparser branch from 7d83f7a to cfc2797 Compare March 8, 2025 20:51
@manojks1999 manojks1999 force-pushed the disabling_gc_with_packetparser branch from cfc2797 to 42d8721 Compare March 8, 2025 21:06
@manojks1999
Copy link
Contributor Author

@manojks1999 please sign the commits so we can merge this, thanks!

Sure will do that

@nddq Done with signing all existing commits

@manojks1999 manojks1999 requested a review from nddq March 9, 2025 07:14
Copy link
Member

@SRodi SRodi left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @manojks1999!

@SRodi SRodi enabled auto-merge March 10, 2025 15:38
@SRodi SRodi added this pull request to the merge queue Mar 10, 2025
Merged via the queue into microsoft:main with commit 0226a8b Mar 10, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants