Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't get historical enclaves for service logs completion #2636

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func NewHistoricalEnclaveIdentifiersArgWithValidationDisabled(
DefaultValue: "",
IsGreedy: isGreedy,
ValidationFunc: noValidationFunc,
ArgCompletionProvider: args.NewManualCompletionsProvider(getExistingAndHistoricalCompletions),
ArgCompletionProvider: args.NewManualCompletionsProvider(getCompletions),
}
}

Expand Down Expand Up @@ -89,27 +89,6 @@ func getCompletions(ctx context.Context, flags *flags.ParsedFlags, previousArgs
return enclaveNames, nil
}

// Make best-effort attempt to get enclave names
func getExistingAndHistoricalCompletions(ctx context.Context, _ *flags.ParsedFlags, _ *args.ParsedArgs) ([]string, error) {
kurtosisCtx, err := kurtosis_context.NewKurtosisContextFromLocalEngine()
if err != nil {
return nil, stacktrace.Propagate(
err,
"An error occurred connecting to the Kurtosis engine for retrieving the names for tab completion",
)
}

enclaveIdentifiers, err := kurtosisCtx.GetExistingAndHistoricalEnclaveIdentifiers(ctx)
if err != nil {
return nil, stacktrace.Propagate(
err,
"An error occurred getting the enclave identifiers",
)
}

return enclaveIdentifiers.GetOrderedListOfNames(), nil
}

// Create a validation function using the previously-created
func getValidationFunc(argKey string, _ string, isGreedy bool) func(context.Context, *flags.ParsedFlags, *args.ParsedArgs) error {
return func(ctx context.Context, flags *flags.ParsedFlags, args *args.ParsedArgs) error {
Expand Down
Loading