-
Notifications
You must be signed in to change notification settings - Fork 26
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
controller: fix watch resources that are created by the controller #160
controller: fix watch resources that are created by the controller #160
Conversation
sorry i can't accept basically any fix without proper tests |
checking - are you up for writing test or we have to take this over |
Yeah I can write a test for this. |
great, simple one would be enough |
e20cdbb
to
87148ec
Compare
✅ Deploy Preview for envoy-ai-gateway ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@mathetake Added a test. Let me know if anything else needs to be done. |
internal/controller/sink.go
Outdated
@@ -159,6 +160,10 @@ func (c *configSink) syncAIGatewayRoute(aiGatewayRoute *aigv1a1.AIGatewayRoute) | |||
}, | |||
Spec: gwapiv1.HTTPRouteSpec{}, | |||
} | |||
err := ctrlutil.SetControllerReference(aiGatewayRoute, &httpRoute, c.client.Scheme()) |
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.
Should I remove the owner reference as we have controller reference ?
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.
http route is not the only thing we create, so i think the change here will be a partial solution. so you could either delete this line or make changes to all resources not only the http route in 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.
This is required for the fix to work, so i will update all other resources to use controller reference.
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.
sounds good
Signed-off-by: Sivanantham Chinnaiyan <[email protected]>
Signed-off-by: Sivanantham Chinnaiyan <[email protected]>
Signed-off-by: Sivanantham Chinnaiyan <[email protected]>
Signed-off-by: Sivanantham Chinnaiyan <[email protected]>
Signed-off-by: Sivanantham Chinnaiyan <[email protected]>
87148ec
to
f58a7b7
Compare
@mathetake I noticed the controller creating HTTPRouteFilter without owner reference. I believe this because the resource is created per namespace. This resource is not watched by the controller. So If it gets deleted accidentally, It won't be recreated until the next reconcilation triggered by some other resource. The controller reference based approach used in this PR may not be appropriate for this resource. |
yeah the HTTPRouteFilter is another issue for sure. |
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.
excellent! thank you for working on this
@sivanantha321 thank you for your contribution, nice work! |
Fixes #134
This PR makes the AIGatewayRoute controller to watch the resources that are created by it and trigger reconcilation.