Skip to content

Commit 0e290aa

Browse files
committed
fix review points
Signed-off-by: Aleksandr Zimin <[email protected]>
1 parent b108b4e commit 0e290aa

File tree

6 files changed

+4
-208
lines changed

6 files changed

+4
-208
lines changed

cmd/dataexport.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ func init() {
5959
deCreate.NewCommand(ctx, logger),
6060
deDelete.NewCommand(ctx, logger),
6161
deDownload.NewCommand(ctx, logger),
62-
//deGet.NewCommand(),
6362
deList.NewCommand(ctx, logger),
6463
)
6564

internal/dataexport/cmd/delete/delete.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func parseArgs(args []string) (deName string, err error) {
6969
}
7070

7171
func Run(ctx context.Context, log *slog.Logger, cmd *cobra.Command, args []string) error {
72-
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
72+
ctx, cancel := context.WithTimeout(ctx, 25*time.Second)
7373
defer cancel()
7474
namespace, _ := cmd.Flags().GetString("namespace")
7575

internal/dataexport/cmd/download/download.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func recursiveDownload(ctx context.Context, sClient *safeClient.SafeClient, log
124124
defer resp.Body.Close()
125125

126126
if resp.StatusCode != 200 {
127-
if resp.ContentLength > 0 && resp.ContentLength < 1000 {
127+
if resp.ContentLength > 0 {
128128
msg, err := io.ReadAll(io.LimitReader(resp.Body, 1000))
129129
if err == nil {
130130
return fmt.Errorf("Backend response \"%s\" Msg: %s", resp.Status, string(msg))

internal/dataexport/cmd/get/get.go

Lines changed: 0 additions & 70 deletions
This file was deleted.

internal/dataexport/cmd/kubectlalias/kubectlalias.go

Lines changed: 0 additions & 133 deletions
This file was deleted.

internal/dataexport/cmd/list/list.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ func downloadRaw(ctx context.Context, log *slog.Logger, namespace, deName, srcPa
112112
defer resp.Body.Close()
113113

114114
if resp.StatusCode != 200 {
115-
if resp.ContentLength > 0 && resp.ContentLength < 1000 {
116-
msg, err := io.ReadAll(resp.Body)
115+
if resp.ContentLength > 0 {
116+
msg, err := io.ReadAll(io.LimitReader(resp.Body, 1000))
117117
if err == nil {
118118
return nil, fmt.Errorf("Backend response \"%s\" Msg: %s", resp.Status, string(msg))
119119
}

0 commit comments

Comments
 (0)