Skip to content

feat: bump gwapi to v0.6.0#853

Closed
Xunzhuo wants to merge 2 commits intoenvoyproxy:mainfrom
Xunzhuo:bump-gwapi-version
Closed

feat: bump gwapi to v0.6.0#853
Xunzhuo wants to merge 2 commits intoenvoyproxy:mainfrom
Xunzhuo:bump-gwapi-version

Conversation

@Xunzhuo
Copy link
Copy Markdown
Member

@Xunzhuo Xunzhuo commented Jan 4, 2023

Fixes: #839
Fixes: #716

Closes: #828

Signed-off-by: bitliu [email protected]

@Xunzhuo Xunzhuo requested a review from a team as a code owner January 4, 2023 07:11
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 4, 2023

Codecov Report

❌ Patch coverage is 28.57143% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.00%. Comparing base (309566d) to head (f6a179e).
⚠️ Report is 4011 commits behind head on main.

Files with missing lines Patch % Lines
internal/gatewayapi/contexts.go 0.00% 1 Missing and 1 partial ⚠️
internal/provider/kubernetes/controller.go 33.33% 2 Missing ⚠️
internal/status/status.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #853      +/-   ##
==========================================
- Coverage   64.06%   64.00%   -0.06%     
==========================================
  Files          50       51       +1     
  Lines        6486     6873     +387     
==========================================
+ Hits         4155     4399     +244     
- Misses       2075     2200     +125     
- Partials      256      274      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Xunzhuo Xunzhuo self-assigned this Jan 4, 2023
@Xunzhuo Xunzhuo added area/api API-related issues area/conformance Gateway API Conformance Related Issues labels Jan 4, 2023
@Xunzhuo Xunzhuo added this to the 0.3.0-rc.1 milestone Jan 4, 2023
@arkodg
Copy link
Copy Markdown
Contributor

arkodg commented Jan 4, 2023

looks like the core issue is interpretation of mapping of Observed Generation to Status Conditions
The new GAPI tests assert that the new Observed Generation value be asserted on all Status Conditions (kubernetes-sigs/gateway-api#1586) but Envoy Gateway does not update the status conditions for all older conditions if the core fields (such as Status, Reason and Message) have not changed

func conditionChanged(a, b metav1.Condition) bool {
and
// return early if the condition is unchanged
. Imho the latter approach seems more logical. Is there any spec governing this mapping @youngnick @skriss

@sunjayBhatia
Copy link
Copy Markdown
Member

sunjayBhatia commented Jan 4, 2023

looks like the core issue is interpretation of mapping of Observed Generation to Status Conditions The new GAPI tests assert that the new Observed Generation value be asserted on all Status Conditions (kubernetes-sigs/gateway-api#1586) but Envoy Gateway does not update the status conditions for all older conditions if the core fields (such as Status, Reason and Message) have not changed

func conditionChanged(a, b metav1.Condition) bool {

and

// return early if the condition is unchanged

. Imho the latter approach seems more logical. Is there any spec governing this mapping @youngnick @skriss

from the Condition spec: https://github.com/kubernetes/apimachinery/blob/6c409361e35e40e38c4056ba0b86647d4244c047/pkg/apis/meta/v1/types.go#L1480-L1485

even if the type/reason/status haven't changed, the observed generation should be updated to make clear the status condition applies to the latest version of the resource

@arkodg
Copy link
Copy Markdown
Contributor

arkodg commented Jan 4, 2023

thanks for sharing that @sunjayBhatia ! , the spec makes it clear that the condition is considered out of date if the observed generation is older
hey @Xunzhuo if you can enhance these snippets (

func conditionChanged(a, b metav1.Condition) bool {
and
// return early if the condition is unchanged
) with an extra check to consider a condition unchanged or changed if the observed generation is also unchanged or changed respectively, should fix the issue, thanks !

@Xunzhuo Xunzhuo force-pushed the bump-gwapi-version branch from 3a0c333 to d8fc059 Compare January 6, 2023 06:55
@Xunzhuo
Copy link
Copy Markdown
Member Author

Xunzhuo commented Jan 6, 2023

thanks for sharing that @sunjayBhatia ! , the spec makes it clear that the condition is considered out of date if the observed generation is older hey @Xunzhuo if you can enhance these snippets (

func conditionChanged(a, b metav1.Condition) bool {

and

// return early if the condition is unchanged

) with an extra check to consider a condition unchanged or changed if the observed generation is also unchanged or changed respectively, should fix the issue, thanks !

Done.

@Xunzhuo Xunzhuo force-pushed the bump-gwapi-version branch from 74434ff to d8fc059 Compare January 6, 2023 08:08
gCopy := g.DeepCopy()
gCopy.Status.Conditions = status.MergeConditions(gCopy.Status.Conditions, gtw.Status.Conditions...)
for index := range gCopy.Status.Conditions {
gCopy.Status.Conditions[index].ObservedGeneration = gtw.Generation
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this loop needs to be removed, this should happen automatically

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

After removing them, CI fails : (

gCopy := g.DeepCopy()
gCopy.Status.Listeners = val.Status.Listeners

for index := range gCopy.Status.Conditions {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this loop needs to be removed as well

hCopy := h.DeepCopy()
hCopy.Status.Parents = val.Status.Parents

for parentIndex, parent := range hCopy.Status.Parents {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same as above

@arkodg
Copy link
Copy Markdown
Contributor

arkodg commented Jan 6, 2023

@Xunzhuo you will also need to edit this code to

func conditionChanged(a, b metav1.Condition) bool {
	return a.Status != b.Status || a.Reason != b.Reason || a.Message != b.Message || a.ObservedGeneration != b.ObservedGeneration
}

@arkodg
Copy link
Copy Markdown
Contributor

arkodg commented Jan 6, 2023

@Xunzhuo you will also need to rm ObservedGeneration from here

opts := cmpopts.IgnoreFields(metav1.Condition{}, "LastTransitionTime", "ObservedGeneration")
since it is now a comparable field

Signed-off-by: bitliu <[email protected]>
@Xunzhuo Xunzhuo force-pushed the bump-gwapi-version branch from 1f4f5d0 to f6a179e Compare January 9, 2023 06:14
@arkodg
Copy link
Copy Markdown
Contributor

arkodg commented Jan 9, 2023

hey @Xunzhuo looks like there was an issue where the gateway API status updater code path would try and update Status.Listeners without updating the ObservedGeneraton with Status.Conditions causing the test to fail. Ive updated the logic here #874

@Xunzhuo Xunzhuo closed this Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api API-related issues area/conformance Gateway API Conformance Related Issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bump Kube Provider Test Data Manifests to v0.6.0 Update to the v0.6.0 Gateway API release

4 participants