Skip to content

Conversation

@ronething
Copy link
Contributor

Signed-off-by: ashing [email protected]

Type of change:

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches
  • Documentation
  • Refactor
  • Chore
  • CI/CD or Tests

What this PR does / why we need it:

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

ronething added 4 commits May 12, 2025 17:42
Signed-off-by: ashing <[email protected]>
Signed-off-by: ashing <[email protected]>
Signed-off-by: ashing <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented May 12, 2025

conformance test report

apiVersion: gateway.networking.k8s.io/v1
date: "2025-05-13T02:54:42Z"
gatewayAPIChannel: standard
gatewayAPIVersion: v1.2.0
implementation:
  contact: null
  organization: APISIX
  project: apisix-ingress-controller
  url: https://github.com/apache/apisix-ingress-controller.git
  version: v2.0.0
kind: ConformanceReport
mode: default
profiles:
- core:
    failedTests:
    - HTTPRouteListenerHostnameMatching
    result: failure
    skippedTests:
    - GatewayInvalidTLSConfiguration
    - GatewaySecretInvalidReferenceGrant
    - GatewaySecretMissingReferenceGrant
    - HTTPRouteHTTPSListener
    - HTTPRouteInvalidCrossNamespaceBackendRef
    - HTTPRouteInvalidCrossNamespaceParentRef
    - HTTPRouteInvalidNonExistentBackendRef
    - HTTPRouteInvalidParentRefNotMatchingSectionName
    - HTTPRouteInvalidReferenceGrant
    - HTTPRoutePartiallyInvalidViaInvalidReferenceGrant
    - HTTPRouteReferenceGrant
    statistics:
      Failed: 1
      Passed: 21
      Skipped: 11
  name: GATEWAY-HTTP
  summary: Core tests failed with 1 test failures.

Comment on lines +237 to +240
reason := gatewayv1.RouteReasonAccepted
if message == ErrNoMatchingListenerHostname.Error() {
reason = gatewayv1.RouteReasonNoMatchingListenerHostname
}
Copy link
Contributor

Choose a reason for hiding this comment

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

靠 message 来传递 reason 有点怪怪的,是否可以定义一种 error 类型,比如

type ReasonErr struct {
    Reason string
    Message string
}

func (e ReasonErr) Error() string { return e.Message }

在前文相关函数中直接返回这样类型的错误,后文中用 errors.As 来判断错误类型,如果是 ReasonErr,可以取出 Reson。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, but let's wait for the next PR to make a unified adjustment.

Comment on lines 37 to 38
// tests.HTTPRouteHostnameIntersection.ShortName,
// tests.HTTPRouteListenerHostnameMatching.ShortName,
Copy link
Contributor

Choose a reason for hiding this comment

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

It can be deleted

Signed-off-by: ashing <[email protected]>
@ronething ronething merged commit 90574fc into release-v2-dev May 13, 2025
8 of 9 checks passed
@ronething ronething deleted the fix/hostnameinter branch May 13, 2025 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants