-
Notifications
You must be signed in to change notification settings - Fork 365
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
use random grpc port #672
use random grpc port #672
Conversation
Signed-off-by: nthnieljson <nthnieljson@gmail.com>
this is addressing the issue on #623 to use random grpc port number |
Signed-off-by: nthnieljson <nthnieljson@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @nyrahul need to approve.
Signed-off-by: nthnieljson <nthnieljson@gmail.com>
Codecov Report
@@ Coverage Diff @@
## main #672 +/- ##
==========================================
- Coverage 43.35% 35.89% -7.47%
==========================================
Files 23 25 +2
Lines 8530 9033 +503
==========================================
- Hits 3698 3242 -456
- Misses 4378 5336 +958
- Partials 454 455 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @nthnieljson for handling this. LGTM.
So as i understand the logic is:
If GRPC config is set to 0, then we listen on port 0 which means we will get a dynamically allocated port, whose value will be written in the pid file.
There is another PR in kubearmor-client which will check for this pid file and use the port number.
@nam-jaehyun , WDYT? I like this solution.
…Jason nthnieljson@gmail.com Signed-off-by: Nathaniel Jason <nthnieljson@gmail.com>
…eljson@gmail.com Signed-off-by: Nathaniel Jason <nthnieljson@gmail.com>
@nthnieljson can you make all the changes in a single commit in order to merge this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after squashing the commits, let's merge the PR.
* use random grpc port by Nathaniel Jason Signed-off-by: nthnieljson <nthnieljson@gmail.com> Signed-off-by: rk <ramakant@accuknox.com>
KubeArmor/config/config.go : define a constant for the pid file path
KubeArmor/feeder/feeder.go : use a random grpc port number and save it to a file
previously we can't use random grpc port
now we can use random grpc port number by specifying "0" as the port number, by using port number 0, we will listen on random port and then we save the random port number to a pid file located in /opt/kubearmor
Signed-off-by: nthnieljson nthnieljson@gmail.com