Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add load balancing to oas configuration (TT-881) (#6830)
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-881" title="TT-881" target="_blank">TT-881</a></summary> <br /> <table> <tr> <th>Summary</th> <td>[OAS] Upstream load balancing</td> </tr> <tr> <th>Type</th> <td> <img alt="Story" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10315?size=medium" /> Story </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20A%20ORDER%20BY%20created%20DESC" title="A">A</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20CSE%20ORDER%20BY%20created%20DESC" title="CSE">CSE</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20EMEA%20ORDER%20BY%20created%20DESC" title="EMEA">EMEA</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20Gold%20ORDER%20BY%20created%20DESC" title="Gold">Gold</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20customer_request%20ORDER%20BY%20created%20DESC" title="customer_request">customer_request</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20jira_escalated%20ORDER%20BY%20created%20DESC" title="jira_escalated">jira_escalated</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20updated%20ORDER%20BY%20created%20DESC" title="updated">updated</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- This PR adds weighted load balancing to OAS configuration. ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Refactoring or add test (improvements in base code or adds test coverage to functionality) ___ ### **PR Type** Enhancement, Tests ___ ### **Description** - Added load balancing configuration to the OAS upstream definition. - Implemented `LoadBalancing` and `LoadBalancingTarget` structures with related methods. - Updated schema to include load balancing configuration. - Added comprehensive unit tests for load balancing functionality. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>oas_test.go</strong><dd><code>Remove deprecated load balancing references in tests</code> </dd></summary> <hr> apidef/oas/oas_test.go <li>Removed references to deprecated load balancing fields.<br> <li> Cleaned up test cases to align with new load balancing implementation. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6830/files#diff-74029ee88132d30d6478c96a35f8bb2200e0c8e6f42f2c9b147dc6bb7ce74644">+0/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>upstream_test.go</strong><dd><code>Add unit tests for load balancing functionality</code> </dd></summary> <hr> apidef/oas/upstream_test.go <li>Added unit tests for <code>LoadBalancing</code> and <code>LoadBalancingTarget</code>.<br> <li> Tested <code>fill</code> and <code>extractTo</code> methods for load balancing.<br> <li> Verified behavior with various load balancing configurations. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6830/files#diff-222cc254c0c6c09fa0cf50087860b837a0873e2aef3c84ec7d80b1014c149057">+192/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>upstream.go</strong><dd><code>Add load balancing logic to upstream handling</code> </dd></summary> <hr> apidef/oas/upstream.go <li>Added <code>LoadBalancing</code> and <code>LoadBalancingTarget</code> structures.<br> <li> Implemented methods to populate and extract load balancing <br>configurations.<br> <li> Integrated load balancing logic into upstream handling. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6830/files#diff-7b0941c7f37fe5a2a23047e0822a65519ca11c371660f36555b59a60f000e3f4">+104/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>x-tyk-api-gateway.json</strong><dd><code>Update schema to support load balancing configuration</code> </dd></summary> <hr> apidef/oas/schema/x-tyk-api-gateway.json <li>Updated schema to include <code>loadBalancing</code> configuration.<br> <li> Added definitions for <code>X-Tyk-LoadBalancing</code> and <br><code>X-Tyk-LoadBalancingTarget</code>. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6830/files#diff-78828969c0c04cc1a776dfc93a8bad3c499a8c83e6169f83e96d090bed3e7dd0">+38/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information
- Loading branch information