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

Same change as porter-dev/porter-python-sdk#2, for the TypeScript SDK. resolveConfig prefers an explicit baseUrl or PORTER_SANDBOX_BASE_URL, then builds the external Porter API URL from PORTER_PROJECT_ID + PORTER_CLUSTER_ID, then falls back to the in-cluster service URL when KUBERNETES_SERVICE_HOST indicates we're in a cluster.

When nothing resolves, or the external URL is used without an API token, it throws an error saying which env vars to set rather than letting requests fail against an unreachable cluster.local address.

@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