Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ jobs:
with:
go-version-file: go.mod
cache: true
- name: Verify local-mode image exists
run: |
set -euo pipefail
docker manifest inspect kong/volcano:local-nightly >/dev/null

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P1] Use a published image tag for local-mode

With the current registry state, kong/volcano:local-nightly does not resolve (docker manifest inspect returns no such manifest), so every localmode-e2e workflow run will fail at this new check before tests start. The same tag is also now the CLI default, so users running volcano start without VOLCANO_IMAGE will hit the same pull failure; publish this tag before merging or keep the default/CI on an existing published image.

Suggested fix: Address this review finding.

- name: Run local-mode CLI contract smoke
env:
VOLCANO_IMAGE: kong/volcano:nightly@sha256:1c57519c86ac156fcc7a6464c9eb6a6812795d8d438306d2a89efe486e523399
VOLCANO_IMAGE: kong/volcano:local-nightly
run: make localmode-e2e
4 changes: 3 additions & 1 deletion internal/auth/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import (
cliruntime "github.com/Kong/volcano-cli/internal/runtime"
)

const authAlphaProjectID = "11111111-1111-4111-8111-111111111111"
const (
authAlphaProjectID = "11111111-1111-4111-8111-111111111111"
)

func TestLoginWithTokenSuccess(t *testing.T) {
cfg := testAuthConfig(t)
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/localmode/localmode.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ func NewStart(deps cliruntime.Deps) *cobra.Command {
Short: "Start the local Volcano development environment",
Long: `Start PostgreSQL, Redis, and the Volcano local-mode server with Docker Compose.

To override the server image, set VOLCANO_IMAGE:
VOLCANO_IMAGE=kong/volcano:nightly volcano start`,
To pin or select a specific server image, set VOLCANO_IMAGE:
VOLCANO_IMAGE=kong/volcano:local-nightly volcano start`,
Comment thread
tkkhq marked this conversation as resolved.
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, _ []string) error {
return localmodecore.NewService(deps).Start(cmd.Context(), cmd.OutOrStdout())
Expand Down
2 changes: 1 addition & 1 deletion internal/localmode/assets/docker-compose.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ services:
retries: 5

server:
image: ${VOLCANO_IMAGE:-kong/volcano:latest}
image: ${VOLCANO_IMAGE:-kong/volcano:local-nightly}
container_name: volcano-server
depends_on:
postgres:
Expand Down
12 changes: 6 additions & 6 deletions internal/localmode/compose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestComposeEnvironmentPrefersProcessImageOverDotEnvImage(t *testing.T) {
cliruntime.Deps{},
WithEnvironment(func() []string { return []string{"PATH=/bin"} }, func(key string) string {
if key == "VOLCANO_IMAGE" {
return "kong/volcano:nightly"
return "kong/volcano:local-nightly"
}
return ""
}),
Expand All @@ -46,10 +46,10 @@ func TestComposeEnvironmentPrefersProcessImageOverDotEnvImage(t *testing.T) {
env, image, err := service.composeEnvironment()

require.NoError(t, err)
assert.Equal(t, "kong/volcano:nightly", image)
assert.Equal(t, "kong/volcano:local-nightly", image)
actual, ok := lastEnvValue(env, "VOLCANO_IMAGE")
require.True(t, ok)
assert.Equal(t, "kong/volcano:nightly", actual)
assert.Equal(t, "kong/volcano:local-nightly", actual)
}

func TestComposeEnvironmentKeepsSingleResolvedVolcanoImage(t *testing.T) {
Expand All @@ -62,7 +62,7 @@ func TestComposeEnvironmentKeepsSingleResolvedVolcanoImage(t *testing.T) {
return []string{"PATH=/bin", "VOLCANO_IMAGE=kong/volcano:from-environ"}
}, func(key string) string {
if key == "VOLCANO_IMAGE" {
return "kong/volcano:nightly"
return "kong/volcano:local-nightly"
}
return ""
}),
Expand All @@ -71,8 +71,8 @@ func TestComposeEnvironmentKeepsSingleResolvedVolcanoImage(t *testing.T) {
env, image, err := service.composeEnvironment()

require.NoError(t, err)
assert.Equal(t, "kong/volcano:nightly", image)
assert.Equal(t, []string{"kong/volcano:nightly"}, envValues(env, "VOLCANO_IMAGE"))
assert.Equal(t, "kong/volcano:local-nightly", image)
assert.Equal(t, []string{"kong/volcano:local-nightly"}, envValues(env, "VOLCANO_IMAGE"))
}

func TestComposeEnvironmentDefaultsVolcanoImage(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/localmode/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
const (
composeProjectName = "volcano"
redisContainerName = "volcano-redis"
defaultVolcanoImage = "kong/volcano:nightly"
defaultVolcanoImage = "kong/volcano:local-nightly"
defaultLocalAPIURL = "http://localhost:8000"
postgresAddress = "localhost:8002"

Expand Down
4 changes: 2 additions & 2 deletions internal/localmode/start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func TestStartCreatesStackPersistsMetadataAndDefaultDatabase(t *testing.T) {
started = true
image, ok := lastEnvValue(command.Env, "VOLCANO_IMAGE")
require.True(t, ok)
assert.Equal(t, "kong/volcano:nightly", image)
assert.Equal(t, "kong/volcano:local-nightly", image)
assert.Contains(t, command.Env, "VOLCANO_LOG_LEVEL=debug")
assert.Contains(t, command.Env, "QUOTED=value")
assert.Contains(t, command.Env, "INLINE=kept")
Expand All @@ -104,7 +104,7 @@ func TestStartCreatesStackPersistsMetadataAndDefaultDatabase(t *testing.T) {
WithDialTCP(func(context.Context, string) error { return nil }),
WithEnvironment(func() []string { return []string{"PATH=/bin"} }, func(key string) string {
if key == "VOLCANO_IMAGE" {
return "kong/volcano:nightly"
return "kong/volcano:local-nightly"
}
return ""
}),
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/localmode/localmode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func localModeE2EEnv(t *testing.T) []string {
"VOLCANO_FIRST_PARTY_DEVICE_CLIENT_ID=",
)
if os.Getenv("VOLCANO_IMAGE") == "" {
env = append(env, "VOLCANO_IMAGE=kong/volcano:nightly")
env = append(env, "VOLCANO_IMAGE=kong/volcano:local-nightly")
}
return env
}
Expand Down
Loading