Skip to content

Commit

Permalink
Remove unimplemented flag 'never'
Browse files Browse the repository at this point in the history
  • Loading branch information
lostbean committed Oct 19, 2023
1 parent eee5e3d commit 24124f2
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 32 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions cli/cli/command_args/run/image_download.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package run
type ImageDownload int

const (
never ImageDownload = iota
always
always ImageDownload = iota
missing
)
28 changes: 12 additions & 16 deletions cli/cli/command_args/run/imagedownload_enumer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cli/cli/commands/run/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ var StarlarkRunCmd = &engine_consuming_kurtosis_command.EngineConsumingKurtosisC
},
{
Key: imageDownloadFlagKey,
Usage: "If unset, it defaults to `missing` for fetching the latest image only if not available in local cache. Use `never` to only use local cached image (never fetch new images) and `always` to always fetch the latest image.",
Usage: "If unset, it defaults to `missing` for fetching the latest image only if not available in local cache. Use `always` to always fetch the latest image.",
Type: flags.FlagType_String,
Default: defaultImageDownload,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,6 @@ func (builder *CreateAndStartContainerArgsBuilder) WithPullingLatestImageAlways(
return builder
}

func (builder *CreateAndStartContainerArgsBuilder) WithPullingLatestImageNever() *CreateAndStartContainerArgsBuilder {
builder.imageDownloadMode = image_download_mode.Never
return builder
}

func (builder *CreateAndStartContainerArgsBuilder) WithPullingLatestImageOnMissing() *CreateAndStartContainerArgsBuilder {
builder.imageDownloadMode = image_download_mode.Missing
return builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ func (manager *DockerManager) FetchImage(ctx context.Context, image string, down
err = manager.FetchLatestImage(ctx, image)
case image_download_mode.Missing:
pulledFromRemote, err = manager.FetchImageMissing(ctx, image)
case image_download_mode.Never:
default:
return false, stacktrace.NewError("Undefined image pulling mode: '%v'", image_pulling)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ package image_download_mode
import "github.com/kurtosis-tech/kurtosis/api/golang/core/kurtosis_core_rpc_api_bindings"

const (
Never ImageDownloadMode = "never"
Always = "always"
Missing = "missing"
Always = "always"
Missing = "missing"
)

type ImageDownloadMode string

func FromAPI(api_mode kurtosis_core_rpc_api_bindings.ImageDownloadMode) ImageDownloadMode {
switch kurtosis_core_rpc_api_bindings.ImageDownloadMode_name[int32(api_mode)] {
case "never":
return Never
case "always":
return Always
case "missing":
Expand Down

0 comments on commit 24124f2

Please sign in to comment.