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

conformance: add test for optional address value #3689

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

EyalPazz
Copy link
Contributor

/kind test
/area conformance

Fixes #3687

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/test area/conformance-test Issues or PRs related to Conformance tests. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 18, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: EyalPazz
Once this PR has been reviewed and has the lgtm label, please assign sunjaybhatia for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 requested review from candita and Xunzhuo March 18, 2025 13:41
@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 Mar 18, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @EyalPazz. 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.

@shaneutt shaneutt added this to the v1.3.0 milestone Mar 18, 2025
@shaneutt shaneutt moved this to Review in Gateway API Pipeline Mar 18, 2025
@youngnick
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 Mar 20, 2025
Copy link
Member

@mlavacca mlavacca left a comment

Choose a reason for hiding this comment

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

Thanks for this PR, @EyalPazz.

I am having hard time to figure out the context of this test and what we want to achieve here. There is no description in the PR and in the linked issue either. Do you mind adding context about what we are testing and what's the expected behavior?

Copy link
Member

@mlavacca mlavacca left a comment

Choose a reason for hiding this comment

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

Have you run this test against any implementation, @EyalPazz?

@EyalPazz EyalPazz force-pushed the address-value-optional-conformance branch from 81191c7 to 748a98b Compare March 30, 2025 08:00
@EyalPazz
Copy link
Contributor Author

EyalPazz commented Mar 30, 2025

Yea I have tested this against istio, obviously it isn't going through because it isn't implementing the feature, but when i remove the feature requirement it fails with gateway-conformance-infra/gateway-without-address-value Gateway not Accepted yet

@mlavacca


// This is being done in order to support the injection of implementation-specific address types
// into the test suite
if len(gwspec.Addresses) > 0 && *gwspec.Addresses[0].Type == "PLACEHOLDER_ADDRESS_TYPE" {
Copy link
Member

Choose a reason for hiding this comment

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

Instead of hardcoding the PLACEHOLDER index to 0, can we look up for it? This would make this code future-proof and more robust.

err := s.Client.Get(ctx, gwNN, currentGW)
require.NoError(t, err, "error getting Gateway: %v", err)
t.Logf("verifying that the Gateway %s/%s is accepted", gwNN.Namespace, gwNN.Name)
kubernetes.GatewayMustHaveCondition(t, s.Client, s.TimeoutConfig, gwNN, metav1.Condition{
Copy link
Member

@mlavacca mlavacca Mar 31, 2025

Choose a reason for hiding this comment

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

The spec says

	// When a value is unspecified, an implementation SHOULD automatically
	// assign an address matching the requested type if possible.

Shouldn't we check that the address gets properly assigned by checking GatewayStatusAddress?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it will produce the same results imo but good idea! will do

if address.Type != nil && (*address.Type == gatewayv1.IPAddressType || *address.Type == v1alpha2.HostnameAddressType) {
if address.Type != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mlavacca regarding this line, do you think it's an OK change? i didn't really understand why it was like at first place

@EyalPazz EyalPazz force-pushed the address-value-optional-conformance branch from 33b8203 to ecc2dd8 Compare April 1, 2025 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/conformance-test Issues or PRs related to Conformance tests. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/test ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Status: Review
Development

Successfully merging this pull request may close these issues.

Add test for optional address value in httproute
5 participants