Skip to content

Prevent skipping dependency download when cache folder is empty #664

@wolfchkov

Description

@wolfchkov

Bug Report

If the initial module download fails but its directory is created, subsequent attempts will always result in a "package not found" error, with no retry attempted.

This can be easily reproduced: press Ctrl+C to cancel the download before kcl run finishes downloading the module, then run kcl run again.

1. Minimal reproduce step (Required)

➜  kcl test tests                              
downloading 'kcl-lang/k8s:1.31.2' from 'ghcr.io/kcl-lang/k8s:1.31.2'
^C

➜  kcl test tests          
package 'k8s:1.31.2' not found

2. What did you expect to see? (Required)

Since, the folder is empty (there is no kcl.mod file), the module should be downloaded without any error.

3. What did you see instead (Required)

The error:

package 'k8s:1.31.2' not found

4. What is your KCL components version? (Required)

kcl version 0.11.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions