Skip to content

feat: resolve the sandbox API base URL automatically#2

Closed
jackowfish wants to merge 1 commit into
mainfrom
jack/sdk-auto-base-url
Closed

feat: resolve the sandbox API base URL automatically#2
jackowfish wants to merge 1 commit into
mainfrom
jack/sdk-auto-base-url

Conversation

@jackowfish

Copy link
Copy Markdown
Contributor

Description

Porter() previously always defaulted to the in-cluster sandbox API URL, so calling from outside the cluster meant hand-assembling the Porter API proxy URL and setting PORTER_SANDBOX_BASE_URL. Now the SDK resolves it: an explicit base_url or PORTER_SANDBOX_BASE_URL still wins, then PORTER_PROJECT_ID + PORTER_CLUSTER_ID build the external Porter API URL, and finally in-cluster detection (KUBERNETES_SERVICE_HOST) falls back to the in-cluster service.

If none of those resolve, Config.resolve raises an error listing the options instead of timing out against a cluster.local address. Going external without an API token, or with only one of the two IDs set, also errors up front with exactly what to set.

@jackowfish

Copy link
Copy Markdown
Contributor Author

Closing - re-doing this so the SDK resolves project + cluster server-side from the API key instead.

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.

1 participant