Commit 9603938
committed
Refactor exec command and improve code quality
- Refactor ExecFargate for KISS/DRY compliance:
* Extract helper functions (trySSMParent, tryDirectExecution, etc.)
* Replace boolean flags with execResult struct
* Reduce ExecFargate from ~180 lines to ~20 lines
* Improve error handling and readability
- Fix container name handling in exec command:
* Add validation when container_name flag is not provided
* Ensure command is not empty after container name extraction
* Provide clear error messages for invalid usage
- Remove debug print statement from cmd/run.go
- Fix redundant string wrapping in lib/runFargate.go:
* Remove unnecessary aws.String()/aws.StringValue() wrapping
* Use strings directly in log fields
- Add documentation comment about public IP usage in Fargate
* Note that IPv6 implementation will change this behavior
- Fix linter warnings and improve code consistency1 parent dce0f5e commit 9603938
5 files changed
+368
-350
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
| 32 | + | |
26 | 33 | | |
27 | 34 | | |
28 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
29 | 42 | | |
30 | 43 | | |
31 | 44 | | |
| |||
35 | 48 | | |
36 | 49 | | |
37 | 50 | | |
38 | | - | |
| 51 | + | |
39 | 52 | | |
40 | 53 | | |
41 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
60 | | - | |
61 | 59 | | |
0 commit comments