Skip to content
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

Assert observedGeneration is incremented in Status.Conditions. #1586

Merged
merged 22 commits into from Dec 19, 2022

Conversation

dprotaso
Copy link
Contributor

@dprotaso dprotaso commented Dec 7, 2022

What type of PR is this?

/kind cleanup
/kind api-change

What this PR does / why we need it:
This PR ensures Gateway Resources and their conditions update observedGeneration as described in the GEP.

Current it tests

  • Gateway
  • GatewayClass
  • HTTPRoute

Which issue(s) this PR fixes:

Fixes: #1584

Does this PR introduce a user-facing change?:

Conformance tests now assert observedGeneration is incremented in Status.Conditions (GatewayClass, Gateway, HTTPRoute)

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 7, 2022
@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/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 7, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @dprotaso. 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/test-infra repository.

@dprotaso
Copy link
Contributor Author

dprotaso commented Dec 7, 2022

/test pull-gateway-api-test
/test pull-gateway-api-verify

@k8s-ci-robot
Copy link
Contributor

@dprotaso: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test pull-gateway-api-test
/test pull-gateway-api-verify

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/test-infra repository.

@dprotaso
Copy link
Contributor Author

dprotaso commented Dec 7, 2022

Also question: How come there are no existing conformance tests for GatewayClass mutations?

@robscott
Copy link
Member

robscott commented Dec 8, 2022

/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 Dec 8, 2022
@robscott
Copy link
Member

robscott commented Dec 8, 2022

Also question: How come there are no existing conformance tests for GatewayClass mutations?

What would that look like? The conformance tests accept a GatewayClass to run tests against, but I can't think of anything meaningful to actually test on a GatewayClass other than that it is accepted.

Prior when asserting against conditions the helpers didn't check their
observedGeneration. This means the assertions could occur with a stale
status.
@dprotaso
Copy link
Contributor Author

dprotaso commented Dec 8, 2022

but I can't think of anything meaningful to actually test on a GatewayClass other than that it is accepted.

Until now with ensuring observedGeneration gets bumped.

Thus changing the parameterRef or even description should trigger this

@dprotaso
Copy link
Contributor Author

dprotaso commented Dec 8, 2022

/test all

@dprotaso
Copy link
Contributor Author

dprotaso commented Dec 8, 2022

/test all

Copy link
Contributor

@youngnick youngnick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The approach LGTM. This could go into v0.6.0, or a v0.6.1 update later if need be.

conformance/utils/kubernetes/helpers.go Outdated Show resolved Hide resolved
sunjayBhatia added a commit to sunjayBhatia/contour that referenced this pull request Dec 16, 2022
sunjayBhatia added a commit to projectcontour/contour that referenced this pull request Dec 16, 2022
@youngnick
Copy link
Contributor

This seems good to me, especially with the opt-out for the GatewayClass for now, so I'm going to hit the approve button. I'll leave it to one of the other approvers to give it the tick.

/approve

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 19, 2022
Copy link
Member

@shaneutt shaneutt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In terms of implementability, @pmalek @mlavacca and myself all talked about this and don't have any concerns for the multiple GWAPI implementations @ Kong 👍

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso, shaneutt, youngnick

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

@robscott
Copy link
Member

Hey @dprotaso, thanks for all your work on this! The tests LGTM, can you squash this PR into a single commit? (See https://kubernetes.io/docs/contribute/new-content/open-a-pr/#squashing-commits for more info). Once that's done, ping any of us for an LGTM and we'll get it merged.

@dprotaso
Copy link
Contributor Author

dprotaso commented Dec 19, 2022 via email

@shaneutt
Copy link
Member

Weird isn’t your prow configured to squash on merge?

Yes, but I think the suggestion here is since this PR is quite large we would like to give you the opportunity to squash into less commits, if not necessarily one commit. That is to say: if you feel it's important for there to be more than one commit to help keep the history more clear and trackable, do a rebase and squash to a history you feel is solid and we can merge that without simply squashing it all into one.

@dprotaso
Copy link
Contributor Author

dprotaso commented Dec 19, 2022 via email

@robscott robscott added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Dec 19, 2022
@robscott
Copy link
Member

/hold cancel
/lgtm

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 19, 2022
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 19, 2022
@k8s-ci-robot k8s-ci-robot merged commit dc314b1 into kubernetes-sigs:main Dec 19, 2022
@candita
Copy link
Contributor

candita commented Dec 20, 2022

@dprotaso I rebased to include this PR and I'm getting an error that wasn't present before. Is this an issue in the PR or in the implementation I'm testing?

   gateway-observed-generation-bump.go:73: 
                        Error Trace:    /home/cholman/code/gateway-api/conformance/gateway-observed-generation-bump.go:73
                        Error:          Received unexpected error:
                                        Operation cannot be fulfilled on gateways.gateway.networking.k8s.io "gateway-observed-generation-bump": the object has been modified; please apply your changes to the latest version and try again
                        Test:           TestConformance/GatewayObservedGenerationBump/observedGeneration_should_increment
                        Messages:       error updating the Gateway: Operation cannot be fulfilled on gateways.gateway.networking.k8s.io "gateway-observed-generation-bump": the object has been modified; please apply your changes to the latest version and try again

@dprotaso dprotaso deleted the observed-generation branch December 20, 2022 14:58
@dprotaso
Copy link
Contributor Author

The test waits for all gateways to be Accepted prior to getting the Gateway and updating it.

The update can fail if the resource is modified after we fetch it but before we perform the update - this is just regular K8s semantics.

My intention of the test is that the gateway resource is stable prior to doing the Get/Update - it may make more sense that we wait on another condition rather than Accepted.

Can you confirm what the exact mutation is?

@shaneutt shaneutt modified the milestones: v0.6.1, v0.6.0 Feb 7, 2023
yangyy93 pushed a commit to projectsesame/contour that referenced this pull request Feb 16, 2023
…rojectcontour#4932)

Related to kubernetes-sigs/gateway-api#1586

Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
Signed-off-by: yy <yang.yang@daocloud.io>
yangyy93 pushed a commit to projectsesame/contour that referenced this pull request Feb 16, 2023
…rojectcontour#4932)

Related to kubernetes-sigs/gateway-api#1586

Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
Signed-off-by: yy <yang.yang@daocloud.io>
vmw-yingy pushed a commit to vmw-yingy/contour that referenced this pull request Feb 28, 2023
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. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update conformance test to assert observedGeneration is bumped
7 participants