Skip to content

Commit b4b44ee

Browse files
authored
Merge pull request #57 from ajayd-san/podman
✨ Podman compatibility ✨
2 parents fe91335 + f8e014e commit b4b44ee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+4545
-1137
lines changed

.github/workflows/go.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
name: Go
55

66
on:
7+
workflow_dispatch:
78
push:
89
branches: [ "main" ]
910
pull_request:
@@ -14,9 +15,18 @@ jobs:
1415
runs-on: ${{ matrix.os }}
1516
strategy:
1617
matrix:
17-
os: [ubuntu-20.04, windows-2019, macos-12]
18+
os: [ubuntu-20.04, macos-12]
1819
steps:
1920
- uses: actions/checkout@v4
21+
- uses: awalsh128/cache-apt-pkgs-action@latest
22+
if: ${{ matrix.os == 'ubuntu-20.04' }}
23+
with:
24+
packages: dia libbtrfs-dev libgpgme-dev
25+
version: 1.0
26+
27+
- name: install mac os deps
28+
if: ${{ matrix.os == 'macos-12' }}
29+
run: brew install gpgme
2030

2131
- name: Set up Go
2232
uses: actions/setup-go@v4

cmd/p.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
Copyright © 2024 Saivenkat Ajay D. <[email protected]>
3+
*/
4+
package cmd
5+
6+
import (
7+
"github.com/ajayd-san/gomanagedocker/service/types"
8+
"github.com/ajayd-san/gomanagedocker/tui"
9+
"github.com/spf13/cobra"
10+
)
11+
12+
// pCmd represents the p command
13+
var pCmd = &cobra.Command{
14+
Use: "p",
15+
Short: "Manage Podman objects",
16+
RunE: func(cmd *cobra.Command, args []string) error {
17+
return tui.StartTUI(debug, types.Podman)
18+
},
19+
}
20+
21+
func init() {
22+
rootCmd.AddCommand(pCmd)
23+
}

cmd/root.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
_ "embed"
88
"os"
99

10+
"github.com/ajayd-san/gomanagedocker/service/types"
1011
"github.com/ajayd-san/gomanagedocker/tui"
1112
"github.com/spf13/cobra"
1213
)
@@ -19,7 +20,7 @@ var (
1920
Long: `The Definitive TUI to manage docker objects with ease.`,
2021
Version: "1.4",
2122
RunE: func(cmd *cobra.Command, args []string) error {
22-
return tui.StartTUI(debug)
23+
return tui.StartTUI(debug, types.Docker)
2324
},
2425
}
2526
)
@@ -32,5 +33,5 @@ func Execute() {
3233
}
3334

3435
func init() {
35-
rootCmd.Flags().BoolVar(&debug, "debug", false, "Send logs to ./gmd_debug.log")
36+
rootCmd.PersistentFlags().BoolVar(&debug, "debug", false, "Send logs to ./gmd_debug.log")
3637
}

config/config_test.go

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,35 @@ func TestReadConfig(t *testing.T) {
1616
}{
1717
{
1818
UserConfig: "",
19-
Want: map[string]any{"config.Polling-Time": 500, "config.Tab-Order": []any{"images", "containers", "volumes"}, "config.Notification-Timeout": 2000},
19+
Want: map[string]any{
20+
"config.Polling-Time": 500,
21+
"config.Tab-Order.Docker": []any{"images", "containers", "volumes"},
22+
"config.Tab-Order.Podman": []any{"images", "containers", "volumes", "pods"},
23+
"config.Notification-Timeout": 2000,
24+
},
2025
},
2126
{
2227
UserConfig: `config:
2328
Polling-Time: 100`,
24-
Want: map[string]any{"config.Polling-Time": 100, "config.Tab-Order": []any{"images", "containers", "volumes"}, "config.Notification-Timeout": 2000},
29+
Want: map[string]any{
30+
"config.Polling-Time": 100,
31+
"config.Tab-Order.Docker": []any{"images", "containers", "volumes"},
32+
"config.Tab-Order.Podman": []any{"images", "containers", "volumes", "pods"},
33+
"config.Notification-Timeout": 2000,
34+
},
2535
},
2636
{
2737
UserConfig: `config:
2838
Polling-Time: 200
29-
Tab-Order: [containers, volumes]
39+
Tab-Order:
40+
Docker: [containers, volumes]
3041
Notification-Timeout: 10000`,
31-
Want: map[string]any{"config.Polling-Time": 200, "config.Tab-Order": []any{"containers", "volumes"}, "config.Notification-Timeout": 10000},
42+
Want: map[string]any{
43+
"config.Polling-Time": 200,
44+
"config.Tab-Order.Docker": []any{"containers", "volumes"},
45+
"config.Tab-Order.Podman": []any{"images", "containers", "volumes", "pods"},
46+
"config.Notification-Timeout": 10000,
47+
},
3248
},
3349
}
3450

config/defaultConfig.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
config:
22
Polling-Time: 500
3-
Tab-Order: [images, containers, volumes]
3+
Tab-Order:
4+
Docker: [images, containers, volumes]
5+
Podman: [images, containers, volumes, pods]
46
Notification-Timeout: 2000

dockercmd/container.go

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

dockercmd/util.go

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

0 commit comments

Comments
 (0)