Skip to content

Commit

Permalink
fix linting after merge
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Alvarez <[email protected]>
  • Loading branch information
pendo324 committed Jan 4, 2024
1 parent 74f0ebb commit a40c5b5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
19 changes: 14 additions & 5 deletions cmd/finch/nerdctl_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/runfinch/finch/pkg/config"
"github.com/runfinch/finch/pkg/flog"
"github.com/runfinch/finch/pkg/mocks"
)
Expand Down Expand Up @@ -77,7 +78,7 @@ func TestNerdctlCommand_runAdaptor(t *testing.T) {
logger := mocks.NewLogger(ctrl)
tc.mockSvc(ecc, lcc, logger, ctrl, ncsd)

assert.NoError(t, newNerdctlCommand(ecc, lcc, ncsd, logger, nil).runAdapter(tc.cmd, tc.args))
assert.NoError(t, newNerdctlCommand(lcc, ecc, ncsd, logger, nil, &config.Finch{}).runAdapter(tc.cmd, tc.args))
})
}
}
Expand All @@ -88,6 +89,7 @@ func TestNerdctlCommand_run(t *testing.T) {
testCases := []struct {
name string
cmdName string
fc *config.Finch
args []string
wantErr error
mockSvc func(*testing.T, *mocks.CommandCreator, *mocks.LimaCmdCreator, *mocks.Command, *mocks.NerdctlCommandSystemDeps,
Expand Down Expand Up @@ -476,6 +478,7 @@ func TestNerdctlCommand_run(t *testing.T) {
{
name: "with --add-host flag but without using special IP by equal",
cmdName: "run",
fc: &config.Finch{},
args: []string{"--rm", "--add-host=name:0.0.0.0", "alpine:latest"},
wantErr: nil,
mockSvc: func(
Expand Down Expand Up @@ -509,6 +512,7 @@ func TestNerdctlCommand_run(t *testing.T) {
{
name: "with multiple nested volumes",
cmdName: "run",
fc: &config.Finch{},
args: []string{
"--rm", "-v", "C:\\workdir:/tmp1/tmp2:rro", "-v=C:\\workdir:/tmp1/tmp2/tmp3/tmp4:rro",
"-v", "volume", "alpine:latest",
Expand Down Expand Up @@ -546,6 +550,7 @@ func TestNerdctlCommand_run(t *testing.T) {
{
name: "with --help flag",
cmdName: "pull",
fc: &config.Finch{},
args: []string{"test:tag", "--help"},
wantErr: nil,
mockSvc: func(
Expand Down Expand Up @@ -578,6 +583,7 @@ func TestNerdctlCommand_run(t *testing.T) {
{
name: "with --help flag but replacing returns error",
cmdName: "pull",
fc: &config.Finch{},
args: []string{"test:tag", "--help"},
wantErr: fmt.Errorf("failed to replace"),
mockSvc: func(
Expand Down Expand Up @@ -610,6 +616,7 @@ func TestNerdctlCommand_run(t *testing.T) {
{
name: "with COSIGN_PASSWORD env var and --sign=cosign",
cmdName: "push",
fc: &config.Finch{},
args: []string{"--sign=cosign", "test:tag"},
wantErr: nil,
mockSvc: func(
Expand Down Expand Up @@ -643,6 +650,7 @@ func TestNerdctlCommand_run(t *testing.T) {
{
name: "with COSIGN_PASSWORD env var and --verify=cosign",
cmdName: "pull",
fc: &config.Finch{},
args: []string{"--verify=cosign", "test:tag"},
wantErr: nil,
mockSvc: func(
Expand Down Expand Up @@ -676,6 +684,7 @@ func TestNerdctlCommand_run(t *testing.T) {
{
name: "with COSIGN_PASSWORD env var without cosign arg",
cmdName: "pull",
fc: &config.Finch{},
args: []string{"test:tag"},
wantErr: nil,
mockSvc: func(
Expand Down Expand Up @@ -721,7 +730,7 @@ func TestNerdctlCommand_run(t *testing.T) {
logger := mocks.NewLogger(ctrl)
fs := afero.NewMemMapFs()
tc.mockSvc(t, ecc, lcc, cmd, ncsd, logger, ctrl, fs)
assert.Equal(t, tc.wantErr, newNerdctlCommand(ecc, lcc, ncsd, logger, fs).run(tc.cmdName, tc.args))
assert.Equal(t, tc.wantErr, newNerdctlCommand(lcc, ecc, ncsd, logger, fs, tc.fc).run(tc.cmdName, tc.args))
})
}
}
Expand Down Expand Up @@ -943,7 +952,7 @@ func TestNerdctlCommand_Run_withBindMounts(t *testing.T) {
logger := mocks.NewLogger(ctrl)
fs := afero.NewMemMapFs()
tc.mockSvc(t, ecc, lcc, ncsd, logger, ctrl, fs)
assert.Equal(t, tc.wantErr, newNerdctlCommand(ecc, lcc, ncsd, logger, fs).run(tc.cmdName, tc.args))
assert.Equal(t, tc.wantErr, newNerdctlCommand(lcc, ecc, ncsd, logger, fs, &config.Finch{}).run(tc.cmdName, tc.args))
})
}
}
Expand Down Expand Up @@ -1062,7 +1071,7 @@ func TestNerdctlCommand_run_CpCommand(t *testing.T) {
logger := mocks.NewLogger(ctrl)
tc.mockSvc(ecc, lcc, logger, ctrl, ncsd)

assert.NoError(t, newNerdctlCommand(ecc, lcc, ncsd, logger, nil).run(tc.cmdName, tc.args))
assert.NoError(t, newNerdctlCommand(lcc, ecc, ncsd, logger, nil, &config.Finch{}).run(tc.cmdName, tc.args))
})
}
}
Expand Down Expand Up @@ -1188,7 +1197,7 @@ func TestNerdctlCommand_run_BuildCommand(t *testing.T) {
logger := mocks.NewLogger(ctrl)
tc.mockSvc(ecc, lcc, logger, ctrl, ncsd)

assert.NoError(t, newNerdctlCommand(ecc, lcc, ncsd, logger, nil).run(tc.cmdName, tc.args))
assert.NoError(t, newNerdctlCommand(lcc, ecc, ncsd, logger, nil, &config.Finch{}).run(tc.cmdName, tc.args))
})
}
}
2 changes: 0 additions & 2 deletions pkg/disk/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import (
fpath "github.com/runfinch/finch/pkg/path"
)

const diskSizeStr = "50GB"

// UserDataDiskManager is used to check the user data disk configuration and create it if needed.
type UserDataDiskManager interface {
EnsureUserDataDisk() error
Expand Down
3 changes: 2 additions & 1 deletion pkg/disk/disk_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import (

const (
// diskName must always be consistent with the value set for AdditionalDisks in lima_config_applier.go.
diskName = "finch"
diskName = "finch"
diskSizeStr = "50GB"
)

type qemuDiskInfo struct {
Expand Down

0 comments on commit a40c5b5

Please sign in to comment.