-
Notifications
You must be signed in to change notification settings - Fork 336
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
fix: nodes convert failed #1222
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
反序列化兼容处理后,从UpstreamNode序列化为json,apisix本身是否兼容,如果不兼容的话,apisix-ingress-controller是否要做同样的序列化处理?
Nodes has different forms of expression, and only one is supported in the implementation. For different forms of expression, their functions are actually the same. |
pkg/types/apisix/v1/types.go
Outdated
// according to APISIX upstream nodes policy, port is optional | ||
port := "0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
port is not optional.
When APISIX is processing, there is a method to determine the port according to the protocol https://github.com/apache/apisix/blob/c4d5f2fca5b9ef98b551c769e2b1565185ed9630/apisix/upstream.lua#L167-L175
So here I suggest setting it to 80, WDYT @bzp2010
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is appropriate to configure the default port to 80
, unless the user manually specifies a scheme for Upstream. We can perform a similar speculative process as APISIX.
But the port in Ingress should be determined by the k8s service, is this here to be compatible with existing data change scenarios in etcd? For example, ingress data is modified by dashboard, etc.
BTW, the dashboard now uses the object
to store nodes data (when created graphically using a form) it can be created without filling in the port, at this point there will be APISIX to determine the port automatically based on the scheme; when the user manually enters JSON to create it, a schema check will be performed, and if the port does not exist it will not be created successfully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov Report
@@ Coverage Diff @@
## master #1222 +/- ##
===========================================
+ Coverage 29.55% 42.78% +13.22%
===========================================
Files 81 73 -8
Lines 10166 6477 -3689
===========================================
- Hits 3005 2771 -234
+ Misses 6834 3409 -3425
+ Partials 327 297 -30
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
I will cherry-pick it into v1.5 |
Type of change:
What this PR does / why we need it:
Question: At present, the implementation only supports the conversion of array types.
Resolved: Add conversion of object type.
Pre-submission checklist: