Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: kusion preview generates an unnecessary ci-test folder #581

Closed
SparkYuan opened this issue Oct 23, 2023 · 3 comments · Fixed by #608
Closed

Bug: kusion preview generates an unnecessary ci-test folder #581

SparkYuan opened this issue Oct 23, 2023 · 3 comments · Fixed by #608
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@SparkYuan
Copy link
Member

SparkYuan commented Oct 23, 2023

What happened?

kusion preview generates an unnecessary ci-test fold

What did you expect to happen?

do not generate an unnecessary ci-test fold

How can we reproduce it (as minimally and precisely as possible)?

>>> cat kcl.yaml
kcl_cli_configs:
  file:
    - microservice.k
  package_maps:
    k8s: ../../vendor/k8s_1.24

>>> cat stack.yaml
name: demo

>>> ls
total 12K
-rw-r--r-- 1 prahalad staff 93 Oct 20 16:56 kcl.yaml
-rw-r--r-- 1 prahalad staff 49 Oct 20 17:43 microservice.k
-rw-r--r-- 1 prahalad staff 22 Oct 20 16:56 stack.yaml

>>> kusion preview
 ✔︎  Generating Spec in the Stack api-data-sevbot...
Stack: api-data-sevbot  ID                                                      Action
* ├─                   policy/v1:PodDisruptionBudget:default:nginx-deployment  Create
* └─                   apps/v1:Deployment:default:nginx-deployment             Create

>>> ls
total 12K
drwxr-x--- 2 prahalad staff 64 Oct 20 22:51 ci-test

>>> kusion compile
 ✔︎  Generating Spec in the Stack api-data-sevbot...

>>> ls ci-test
total 4.0K
-rw-r--r-- 1 prahalad staff 832 Oct 20 22:51 stdout.golden.yaml

Anything else we need to know?

No response

Kusion version

$ kusion version
# paste output here

releaseVersion: v0.9.0
gitInfo:
latestTag: v0.9.0
commit: 230d4cc
treeState: clean
buildInfo:
goVersion: go1.19.13
GOOS: linux
GOARCH: amd64
numCPU: 2
compiler: gc
buildTime: "2023-09-28 02:32:41"
dependency:
kclGoVersion: v0.6.0-alpha.1
kclPluginVersion: v0.5.0

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Install tools

@SparkYuan SparkYuan added the kind/bug Something isn't working label Oct 23, 2023
@ffforest ffforest added this to the 0.10.0 milestone Oct 23, 2023
@healthjyk
Copy link
Contributor

healthjyk commented Nov 2, 2023

I didn't reproduce the bug, but I found the reason. Because you didn't organize the project/stack by kpm, so for the old scheme, ci-test will get generated automatically when executing kusion compile.
Should it get changed? I think there are some guys using the old scheme, and they may expect the ci-test get updated automatically. I prefer not change it. What's your opinion? @SparkYuan

Here is my result when using kpm, when the project is generated by kusion init by kusion 0.9.0:

>>> cd single-stack-sample; tree .
.
├── README.md
├── dev
│   ├── kcl.mod
│   ├── kcl.mod.lock
│   ├── main.k
│   └── stack.yaml
└── project.yaml

1 directory, 6 files

>>> cd dev; kusion preview
 ✔︎  Generating Spec in the Stack dev...
Stack: dev  ID                                                  Action
* ├─     v1:Namespace:helloworld                             Create
* ├─     v1:Service:helloworld:helloworld-dev-nginx-private  Create
* └─     apps/v1:Deployment:helloworld:helloworld-dev-nginx  Create

>>> cd ..; tree .
.
├── README.md
├── dev
│   ├── kcl.mod
│   ├── kcl.mod.lock
│   ├── kusion_state.json
│   ├── main.k
│   └── stack.yaml
└── project.yaml

1 directory, 7 files

@ffforest ffforest changed the title Bug: kusion preview generats an unnecessary ci-test fold Bug: kusion preview generates an unnecessary ci-test fold Nov 6, 2023
@ffforest
Copy link
Contributor

ffforest commented Nov 6, 2023

New users should use the kpm route when using kusion preview.

@ffforest ffforest changed the title Bug: kusion preview generates an unnecessary ci-test fold Bug: kusion preview generates an unnecessary ci-test folder Nov 6, 2023
@ffforest ffforest assigned SparkYuan and unassigned healthjyk Nov 6, 2023
@ffforest
Copy link
Contributor

Resolved as part of #608

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants