Fix Default Workdir for Unweave Code/SSH + ExecInfo UX#14
Merged
Conversation
caldempsey
commented
May 30, 2023
| {Key: "SSHKey", Value: fmt.Sprintf("%s", exec.SSHKey.Name)}, | ||
| {Key: "CPUs", Value: fmt.Sprintf("%v", exec.Specs.CPU.Min)}, | ||
| // Uncomment when issues setting RAM are resolved | ||
| // {Key: "RAM", Value: fmt.Sprintf("%vGB", exec.Specs.RAM.Min)}, |
Contributor
Author
There was a problem hiding this comment.
uncomment this line when ready
noorvir
requested changes
May 31, 2023
Comment on lines
-170
to
-189
|
|
||
| // getExecByNameOrID invokes the UnweaveClient and returns the container execution associated a name or ID that matches a given string | ||
| func getExecByNameOrID(ctx context.Context, ref string) (*types.Exec, error) { | ||
| execs, err := getExecs(ctx) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
|
|
||
| for _, e := range execs { | ||
| // handle a case where the user accidentally input the execRef ID as the name | ||
| if ref == e.Name { | ||
| return &e, nil | ||
| } | ||
| if ref == e.ID { | ||
| return &e, nil | ||
| } | ||
| } | ||
|
|
||
| return nil, fmt.Errorf("session %s does not exist", ref) | ||
| } |
Contributor
There was a problem hiding this comment.
Do we not use this anymore? I'm not sure this should be removed since we want to implement getting info about an exec soon.
Contributor
Author
There was a problem hiding this comment.
No references anywhere, will keep it in if you want but I'm an evangelicalist about removing dead code and dead features
Contributor
There was a problem hiding this comment.
We'll probably implement this very soon so let's leave it.
Comment on lines
+13
to
+22
| func ProjectHostDir() string { | ||
| absPath, err := filepath.Abs(".") | ||
| if err != nil { | ||
| ui.HandleError(err) | ||
| } | ||
|
|
||
| _, rootDir := filepath.Split(absPath) | ||
|
|
||
| return filepath.Join(UnweaveHostDir, rootDir) | ||
| } |
Contributor
There was a problem hiding this comment.
This is not correct. The user can be executing an unweave command from a subdirectory too. We have a utility to get the project linked directory here
noorvir
approved these changes
Jun 1, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR cleans up some unused code in the CLI, makes UX improvements based on unweave/unweave-v1#13, and fixes a bug where the workdir used for Node and SSH was inconsistent.