-
Notifications
You must be signed in to change notification settings - Fork 5
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 cronjob labels #156
use cronjob labels #156
Conversation
Signed-off-by: DanielGrunbergerCA <[email protected]>
PR Description updated to latest commit (097e6aa) |
PR Analysis
PR Feedback
How to useInstructions
|
Summary:
|
Signed-off-by: DanielGrunbergerCA <[email protected]>
Signed-off-by: DanielGrunbergerCA <[email protected]>
Summary:
|
type:
bug_fix
description:
This PR addresses an issue with the labels of
NetworkNeighbors
generated forCronJobs
. Previously, the labels of theCronJob
were used as the labels of theNetworkNeighbors
, which could lead to incorrect policy enforcement, as the labels of thePod
generated by theJob
may differ. The PR modifies this behavior to use the labels from thepodTemplate
inside thejobSpec
, which will be present in thePods
generated by theJob
.main_files_walkthrough:
files:
pkg/networkmanager/network_manager.go
: The changes in this file include a new condition to check if the parent workload is aCronJob
. If it is, the labels from thepodTemplate
inside thejobSpec
are used to create a newLabelSelector
. If the parent workload is not aCronJob
, the previous behavior is maintained. This change ensures that the correct labels are used forNetworkNeighbors
in the case ofCronJobs
.User Description:
Overview
This PR fixes the labels of
NetworkNeighbors
generated forCronJobs
. Previously we were using the labels of theCronJob
as the labels of theNetworkNeighbors
, which will cause the policy to be not always correct, since the labels of thePod
generated by theJob
may differ. Instead, we will take the labels from thepodTemplate
inside thejobSpec
, which will be present at thePods
generated by theJob
.