Skip to content

Commit ca29345

Browse files
committed
refactor: replace common package with config package for configuration loading
- Updated `down.go` and `up.go` to load configuration from the new `config` package instead of the deprecated `common` package. - Removed `types.go` and `device.go` from the `common` package, consolidating validation logic into the new `validation` package. - Adjusted related tests and container management code to reflect the new structure and ensure compatibility with the updated configuration handling.
1 parent d9e8068 commit ca29345

File tree

21 files changed

+661
-2142
lines changed

21 files changed

+661
-2142
lines changed

cmd/lxc-compose/down.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"fmt"
55

6-
"github.com/larkinwc/proxmox-lxc-compose/pkg/common"
6+
"github.com/larkinwc/proxmox-lxc-compose/pkg/config"
77
"github.com/larkinwc/proxmox-lxc-compose/pkg/container"
88

99
"github.com/spf13/cobra"
@@ -37,7 +37,7 @@ func downCmdRunE(_ *cobra.Command, args []string, configFile string) error {
3737
}
3838

3939
// Load configuration
40-
cfg, err := common.Load(configFile)
40+
cfg, err := config.Load(configFile)
4141
if err != nil {
4242
return fmt.Errorf("failed to load config: %w", err)
4343
}

cmd/lxc-compose/up.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"fmt"
55

6-
"github.com/larkinwc/proxmox-lxc-compose/pkg/common"
6+
"github.com/larkinwc/proxmox-lxc-compose/pkg/config"
77
"github.com/larkinwc/proxmox-lxc-compose/pkg/container"
88

99
"github.com/spf13/cobra"
@@ -31,7 +31,7 @@ func upCmdRunE(_ *cobra.Command, args []string) error {
3131
}
3232

3333
// Load configuration
34-
cfg, err := common.Load(configFile)
34+
cfg, err := config.Load(configFile)
3535
if err != nil {
3636
return fmt.Errorf("failed to load config: %w", err)
3737
}

pkg/common/common.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package common

pkg/common/types.go

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

0 commit comments

Comments
 (0)