generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 91
Use server side namespace filter #429
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
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
60c5ab8
Add filter to pod redconciler
hzxuzhonghu 1f5a46d
use poolHasSynced
hzxuzhonghu a40a821
filter using server-side namespace filter
hzxuzhonghu bd84a33
update object filter
hzxuzhonghu 20e5325
update
hzxuzhonghu 430ff72
remove unused scheme and namespace
hzxuzhonghu f057ffd
Move controller manager build function to pkg/epp/server so we can be…
hzxuzhonghu acb1f47
Update integration test
hzxuzhonghu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ import ( | |
"github.com/go-logr/logr" | ||
corev1 "k8s.io/api/core/v1" | ||
apierrors "k8s.io/apimachinery/pkg/api/errors" | ||
"k8s.io/apimachinery/pkg/runtime" | ||
"k8s.io/apimachinery/pkg/types" | ||
"k8s.io/client-go/tools/record" | ||
ctrl "sigs.k8s.io/controller-runtime" | ||
|
@@ -35,19 +34,18 @@ import ( | |
type PodReconciler struct { | ||
client.Client | ||
Datastore datastore.Datastore | ||
Scheme *runtime.Scheme | ||
// namespace of the InferencePool | ||
// we donot support cross namespace pod selection | ||
Namespace string | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we don't need this anymore, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. goodcatch |
||
Record record.EventRecorder | ||
} | ||
|
||
func (c *PodReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { | ||
logger := log.FromContext(ctx) | ||
inferencePool, err := c.Datastore.PoolGet() | ||
if err != nil { | ||
logger.V(logutil.TRACE).Info("Skipping reconciling Pod because the InferencePool is not available yet", "error", err) | ||
if !c.Datastore.PoolHasSynced() { | ||
logger.V(logutil.TRACE).Info("Skipping reconciling Pod because the InferencePool is not available yet") | ||
// When the inferencePool is initialized it lists the appropriate pods and populates the datastore, so no need to requeue. | ||
return ctrl.Result{}, nil | ||
} else if inferencePool.Namespace != req.Namespace { | ||
return ctrl.Result{}, nil | ||
} | ||
|
||
logger.V(logutil.VERBOSE).Info("Pod being reconciled", "name", req.NamespacedName) | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
can we create a
CreateDefaultManager
func perhaps under the server pkg (https://github.com/kubernetes-sigs/gateway-api-inference-extension/tree/main/pkg/epp/server) so that we can invoke it from our integration tests, which would allow us to test this configuration.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.
ok