Skip to content

Fix mangled endpoint - #469

Merged
peterdeme merged 1 commit into
spacelift-io:mainfrom
darnaut:darnaut--fix-trimmed-endpoint
Jul 28, 2026
Merged

peterdeme merged 1 commit into
spacelift-io:mainfrom
darnaut:darnaut--fix-trimmed-endpoint

Conversation

@darnaut

@darnaut darnaut commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

Some commands were failing with DNS resolution errors:

spacectl api --schema     
2026/07/27 16:11:33 error executing request: Post "https://spacelift.foobar.o/graphql": dial tcp: lookup spacelift.foobar.o: no such host

The problem is that strings.TrimRight trims any trailing characters found in the /graphql cutset, which mangled hosts that end with characters in the /graphql set (such as .org, .ph, etc).

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Changes Made

  • Replaced strings.TrimRight with strings.TrimSuffix as recommended by Go's documentation.

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All existing tests pass

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code where necessary
  • My changes generate no new warnings

@darnaut
darnaut requested a review from a team as a code owner July 27, 2026 23:14
@darnaut
darnaut force-pushed the darnaut--fix-trimmed-endpoint branch from ce0c8da to 302b573 Compare July 27, 2026 23:27
@darnaut
darnaut force-pushed the darnaut--fix-trimmed-endpoint branch from 302b573 to cea5eca Compare July 27, 2026 23:29
@peterdeme
peterdeme merged commit 01e01b6 into spacelift-io:main Jul 28, 2026
@darnaut
darnaut deleted the darnaut--fix-trimmed-endpoint branch July 28, 2026 03:01
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