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

Add custom header to specify fleetapi base url #314

Closed

Conversation

tnsetting2023
Copy link
Collaborator

@tnsetting2023 tnsetting2023 commented Sep 23, 2024

Description

Please include a summary of the changes and the related issue.

Fixes # (issue)

Type of change

Please select all options that apply to this change:

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Bug fix (non-breaking change which fixes an issue)
  • Documentation update

Checklist:

Confirm you have completed the following steps:

  • My code follows the style of this project.
  • I have performed a self-review of my code.
  • I have made corresponding updates to the documentation.
  • I have added/updated unit tests to cover my changes.

@sethterashima
Copy link
Collaborator

What problem are we solving here? If the proxy is trying to hit the wrong hostname, then that's a bug that should be fixed without requiring manually intervention from the operator.

@tnsetting2023
Copy link
Collaborator Author

The issue is that there are some complains about proxy not forwarding request to the right host and getting errors like “user out of region, use base URL: https://fleet-api.prd.eu.vn.cloud.tesla.com, see https://developer.tesla.com/docs/fleet-api/getting-started/base-urls”. The pr is trying to provide some means for operator to force the requests to be forwarded to a specified tesla host.

It looks like we have some retry logic already as from the code base

func (c *Connection) SendFleetAPICommand(ctx context.Context, endpoint string, command interface{}) ([]byte, error) {
and
if !protocol.ShouldRetry(err) {
. It seems we would update the serverURL in the Connection and retry from Vehicle class. So the issue feels like a bug

@tnsetting2023
Copy link
Collaborator Author

It looks like only command got forwards but not other requests like vehicle_data

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.

2 participants