It references a my_config file that does not exist:
$ cat ./examples/kcl/my_config_test.k
import my_config
debugging
print(my_config.labels) # debugging by print
test
assert len(my_config.labels) > 0, "labels can't be empty" # use len() to get list length
assert "env" in my_config.labels, "env label is a must"
assert my_config.cpu >= 256, "cpu cannot be less than256
I can still build it even though the imported `my_config` is not there:
### 2. What did you expect to see? (Required)
An error about a missing imported module.
### 3. What did you see instead (Required)
The config builds and shows data from an old file that no longer exists.
### 4. What is your KCL components version? (Required)
v.0.9.7 from https://github.com/kcl-lang/cli/releases/download/v0.9.7/kcl-v0.9.7-linux-amd64.tar.gz
Here's a recording of the terminal with the repro: https://asciinema.org/a/jDn28ok1KIWBABvppAWpkolb8
Bug Report
Sometimes when I run
kcl path/to/my/file.k
it will resolve module imports from files that do not (longer) exist.1. Minimal reproduce step (Required)
I don't know how to repro this from scratch but this is what I'm observing:
I have a single file that comes from the codelab: https://www.kcl-lang.io/docs/reference/lang/codelab/simple
It references a
my_config
file that does not exist:import my_config
debugging
print(my_config.labels) # debugging by print
test
assert len(my_config.labels) > 0, "labels can't be empty" # use len() to get list length assert "env" in my_config.labels, "env label is a must" assert my_config.cpu >= 256, "cpu cannot be less than256
$ kcl ./examples/kcl/my_config_test.k {'run': 'my-nginx', 'env': 'pre-prod2'} {}