Skip to content

Fix lstk logs to properly detect emulators running under custom container names#387

Merged
anisaoshafi merged 3 commits into
mainfrom
devx-998-use-resolved-container-lookup-in-lstk-logs
Jul 17, 2026
Merged

Fix lstk logs to properly detect emulators running under custom container names#387
anisaoshafi merged 3 commits into
mainfrom
devx-998-use-resolved-container-lookup-in-lstk-logs

Conversation

@anisaoshafi

Copy link
Copy Markdown
Collaborator

lstk logs didn't detect externally named containers.

logs should use the same container resolution logic as the other commands. That would make the behavior consistent across lstk.

Integration test failed and worked after fix.

@anisaoshafi anisaoshafi added semver: patch docs: skip Pull request does not require documentation changes labels Jul 16, 2026
@anisaoshafi
anisaoshafi marked this pull request as ready for review July 16, 2026 08:53
@anisaoshafi
anisaoshafi requested a review from a team as a code owner July 16, 2026 08:53
Comment on lines +46 to +55
if name == "" {
sink.Emit(output.ErrorEvent{
Title: fmt.Sprintf("%s is not running", c.DisplayName()),
Actions: []output.ErrorAction{
{Label: "Start LocalStack:", Value: "lstk"},
{Label: "See help:", Value: "lstk -h"},
},
})
return output.NewSilentError(fmt.Errorf("%s is not running", c.Name()))
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: this is the 4th copy of this code, the first three are in aws.go, az.go and status.go. Maybe we can extract it to a handleNoRunningContainer in, let's say, running.go?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in b1eb7e4, good point

Comment thread internal/container/logs_test.go Outdated
@anisaoshafi
anisaoshafi enabled auto-merge (squash) July 17, 2026 16:38
@anisaoshafi
anisaoshafi merged commit b10e7cd into main Jul 17, 2026
17 checks passed
@anisaoshafi
anisaoshafi deleted the devx-998-use-resolved-container-lookup-in-lstk-logs branch July 17, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs: skip Pull request does not require documentation changes semver: patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants