Skip to content

Commit 425b583

Browse files
committed
Address comments
1 parent 8835f03 commit 425b583

4 files changed

Lines changed: 24 additions & 16 deletions

File tree

internal/config/default_config.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ port = "4566" # Host port the emulator will be accessible on
1212
# volume = "" # Host directory for persistent state (default: OS cache dir)
1313
# env = [] # Named environment profiles to apply (see [env.*] sections below)
1414

15-
# To use the Snowflake emulator instead, comment out the AWS block above and uncomment this one.
16-
# [[containers]]
17-
# type = "snowflake"
18-
# tag = "latest"
19-
# port = "4566"
20-
2115
# Environment profiles let you group environment variables and reference
2216
# them by name in one or more containers via the 'env' field above.
2317
#

internal/container/label.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func ResolveEmulatorLabel(ctx context.Context, client api.PlatformAPI, container
3232
tag := c.Tag
3333
if tag == "" || tag == "latest" {
3434
if c.Type == config.EmulatorSnowflake {
35-
return "LocalStack Snowflake", false
35+
return "LocalStack", false
3636
}
3737
apiCtx, cancel := context.WithTimeout(ctx, 2*time.Second)
3838
v, err := client.GetLatestCatalogVersion(apiCtx, string(c.Type))

internal/container/start.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,22 +235,24 @@ func runPostStartSetups(ctx context.Context, sink output.Sink, containers []conf
235235
if err := setup(ctx, sink, interactive, resolvedHost); err != nil {
236236
return err
237237
}
238-
emitPostStartPointers(sink, resolvedHost, webAppURL)
238+
emitPostStartPointers(sink, resolvedHost, webAppURL, true)
239239
}
240240
}
241241
return nil
242242
}
243243

244-
func emitPostStartPointers(sink output.Sink, resolvedHost, webAppURL string) {
244+
func emitPostStartPointers(sink output.Sink, resolvedHost, webAppURL string, showTip bool) {
245245
output.EmitSecondary(sink, fmt.Sprintf("• Endpoint: %s", resolvedHost))
246246
if webAppURL != "" {
247247
output.EmitSecondary(sink, fmt.Sprintf("• Web app: %s", strings.TrimRight(webAppURL, "/")))
248248
}
249-
tips := []string{
250-
"> Tip: View emulator logs: lstk logs --follow",
251-
"> Tip: View deployed resources: lstk status",
249+
if showTip {
250+
tips := []string{
251+
"> Tip: View emulator logs: lstk logs --follow",
252+
"> Tip: View deployed resources: lstk status",
253+
}
254+
output.EmitSecondary(sink, tips[rand.IntN(len(tips))])
252255
}
253-
output.EmitSecondary(sink, tips[rand.IntN(len(tips))])
254256
}
255257

256258
func pullImages(ctx context.Context, rt runtime.Runtime, sink output.Sink, tel *telemetry.Client, containers []runtime.ContainerConfig) (map[string]bool, error) {
@@ -377,7 +379,7 @@ func selectContainersToStart(ctx context.Context, rt runtime.Runtime, sink outpu
377379
if !dnsOK {
378380
output.EmitNote(sink, endpoint.DNSRebindNote)
379381
}
380-
emitPostStartPointers(sink, resolvedHost, webAppURL)
382+
emitPostStartPointers(sink, resolvedHost, webAppURL, c.EmulatorType == string(config.EmulatorAWS))
381383
continue
382384
}
383385
if err := ports.CheckAvailable(c.Port); err != nil {

internal/container/start_test.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func TestEmitPostStartPointers_WithWebApp(t *testing.T) {
3434
var out bytes.Buffer
3535
sink := output.NewPlainSink(&out)
3636

37-
emitPostStartPointers(sink, "localhost.localstack.cloud:4566", "https://app.localstack.cloud/")
37+
emitPostStartPointers(sink, "localhost.localstack.cloud:4566", "https://app.localstack.cloud/", true)
3838

3939
got := out.String()
4040
assert.Contains(t, got, "• Endpoint: localhost.localstack.cloud:4566\n")
@@ -46,13 +46,25 @@ func TestEmitPostStartPointers_WithoutWebApp(t *testing.T) {
4646
var out bytes.Buffer
4747
sink := output.NewPlainSink(&out)
4848

49-
emitPostStartPointers(sink, "127.0.0.1:4566", "")
49+
emitPostStartPointers(sink, "127.0.0.1:4566", "", true)
5050

5151
got := out.String()
5252
assert.Contains(t, got, "• Endpoint: 127.0.0.1:4566\n")
5353
assert.Contains(t, got, "> Tip:")
5454
}
5555

56+
func TestEmitPostStartPointers_NoTip(t *testing.T) {
57+
var out bytes.Buffer
58+
sink := output.NewPlainSink(&out)
59+
60+
emitPostStartPointers(sink, "localhost.localstack.cloud:4566", "https://app.localstack.cloud/", false)
61+
62+
got := out.String()
63+
assert.Contains(t, got, "• Endpoint: localhost.localstack.cloud:4566\n")
64+
assert.Contains(t, got, "• Web app: https://app.localstack.cloud\n")
65+
assert.NotContains(t, got, "> Tip:")
66+
}
67+
5668
func TestServicePortRange_ReturnsExpectedPorts(t *testing.T) {
5769
ports := servicePortRange()
5870

0 commit comments

Comments
 (0)