Skip to content

Conversation

@elevran
Copy link
Contributor

@elevran elevran commented Jul 1, 2025

Changed most occurrences of client.Client to client.Reader which is aligned with usage and prevents accidental mutation of API objects.

Note

Some conformance tests are kept with the original client.Client parameter as they internally call Gateway API functions which expect a full fledged client.
If preferred, it might be possible to change the API to accept a Reader and then type assert before calling the Gateway API with a client.Client.

This is in response to comment on #1093

elevran added 2 commits July 1, 2025 13:19
This is more aligned with the actual use abd prevents accidental mutation of k8s objects.

Signed-off-by: Etai Lev Ran <[email protected]>
While this is more aligned with the intent, in some cases the hepler
calls unto gateway API code which is expecting a full fledged client.
In those cases, the original parameter type has been retained (instead
of type casting in the call to Gateway API code)

Signed-off-by: Etai Lev Ran <[email protected]>
@netlify
Copy link

netlify bot commented Jul 1, 2025

Deploy Preview for gateway-api-inference-extension ready!

Name Link
🔨 Latest commit ca45406
🔍 Latest deploy log https://app.netlify.com/projects/gateway-api-inference-extension/deploys/6863b7dea5d4060008be7a57
😎 Deploy Preview https://deploy-preview-1101--gateway-api-inference-extension.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 1, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @elevran. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 1, 2025
@nirrozenbaum
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 1, 2025
@nirrozenbaum
Copy link
Contributor

this lgtm.
@robscott @danehans @LiorLieberman - can you please confirm that this change is acceptable in the conformance tests?

@kfswain
Copy link
Collaborator

kfswain commented Jul 1, 2025

Great call

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 1, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: elevran, kfswain

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 1, 2025
@k8s-ci-robot k8s-ci-robot merged commit 582e5fa into kubernetes-sigs:main Jul 1, 2025
9 checks passed
@ahg-g
Copy link
Contributor

ahg-g commented Jul 1, 2025

this lgtm. @robscott @danehans @LiorLieberman - can you please confirm that this change is acceptable in the conformance tests?

This change should not impact conformance, if it does, something is not right :)

@nirrozenbaum
Copy link
Contributor

this lgtm. @robscott @danehans @LiorLieberman - can you please confirm that this change is acceptable in the conformance tests?

This change should not impact conformance, if it does, something is not right :)

yup, I was verifying 🙂

@elevran elevran deleted the k8s_readonly branch July 2, 2025 07:49
EyalPazz pushed a commit to EyalPazz/gateway-api-inference-extension that referenced this pull request Jul 9, 2025
* Repleace client.Client with client.Reader

This is more aligned with the actual use abd prevents accidental mutation of k8s objects.

Signed-off-by: Etai Lev Ran <[email protected]>

* Replace client.Client with client.Reader

While this is more aligned with the intent, in some cases the hepler
calls unto gateway API code which is expecting a full fledged client.
In those cases, the original parameter type has been retained (instead
of type casting in the call to Gateway API code)

Signed-off-by: Etai Lev Ran <[email protected]>

---------

Signed-off-by: Etai Lev Ran <[email protected]>
BenjaminBraunDev pushed a commit to BenjaminBraunDev/gateway-api-inference-extension that referenced this pull request Aug 12, 2025
* Repleace client.Client with client.Reader

This is more aligned with the actual use abd prevents accidental mutation of k8s objects.

Signed-off-by: Etai Lev Ran <[email protected]>

* Replace client.Client with client.Reader

While this is more aligned with the intent, in some cases the hepler
calls unto gateway API code which is expecting a full fledged client.
In those cases, the original parameter type has been retained (instead
of type casting in the call to Gateway API code)

Signed-off-by: Etai Lev Ran <[email protected]>

---------

Signed-off-by: Etai Lev Ran <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants