add more codes

This commit is contained in:
2025-11-23 22:37:27 +07:00
parent b506a64ed1
commit 4fcd71ca05
10 changed files with 448 additions and 52 deletions

View File

@@ -136,6 +136,9 @@ func (s *Store) SaveCT(spec lxc.Spec) error {
if spec.ID == "" {
return fmt.Errorf("ct id is required")
}
if spec.RootfsPool == "" {
return fmt.Errorf("rootfs_pool is required")
}
data, err := yaml.Marshal(spec)
if err != nil {
return err

View File

@@ -3,8 +3,8 @@ package state
import "testing"
func TestTrimExt(t *testing.T) {
got := trimExt("foo.yaml")
if got != "foo" {
t.Fatalf("expected foo, got %s", got)
}
got := trimExt("foo.yaml")
if got != "foo" {
t.Fatalf("expected foo, got %s", got)
}
}