Skip to content

Commit

Permalink
fix: tests and linting
Browse files Browse the repository at this point in the history
  • Loading branch information
nutellinoit committed May 8, 2024
1 parent 1bccd19 commit 9635b09
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/cluster/phase.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ func (op *OperationPhase) CopyPathsToConfig(cfg *template.Config) {
"terraform": op.TerraformPath,
"vendorPath": path.Join(op.Path, "..", "vendor"),
"yq": op.YqPath,
"kapp": op.KappPath,
"kapp": op.KappPath,
}
}

Expand Down
1 change: 0 additions & 1 deletion internal/dependencies/tools/kapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ func (k *Kapp) Rename(basePath string) error {
return nil
}


func (k *Kapp) CheckBinVersion() error {
if err := k.checker.version(k.version); err != nil {
return fmt.Errorf("kapp: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion internal/dependencies/tools/tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ import (
"github.com/sighupio/furyctl/internal/tool/git"
"github.com/sighupio/furyctl/internal/tool/helm"
"github.com/sighupio/furyctl/internal/tool/helmfile"
"github.com/sighupio/furyctl/internal/tool/kapp"
"github.com/sighupio/furyctl/internal/tool/kubectl"
"github.com/sighupio/furyctl/internal/tool/kustomize"
"github.com/sighupio/furyctl/internal/tool/openvpn"
"github.com/sighupio/furyctl/internal/tool/shell"
"github.com/sighupio/furyctl/internal/tool/terraform"
"github.com/sighupio/furyctl/internal/tool/yq"
"github.com/sighupio/furyctl/internal/tool/kapp"
execx "github.com/sighupio/furyctl/internal/x/exec"
)

Expand Down
6 changes: 6 additions & 0 deletions internal/dependencies/tools/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func Test_Validator_Validate(t *testing.T) {
Yq: config.KFDTool{Version: "4.34.1"},
Helm: config.KFDTool{Version: "3.12.3"},
Helmfile: config.KFDTool{Version: "0.156.0"},
Kapp: config.KFDTool{Version: "0.62.0"},
},
},
},
Expand All @@ -52,6 +53,7 @@ func Test_Validator_Validate(t *testing.T) {
"yq",
"helm",
"helmfile",
"kapp",
},
},
{
Expand All @@ -67,6 +69,7 @@ func Test_Validator_Validate(t *testing.T) {
Yq: config.KFDTool{Version: "4.33.0"},
Helm: config.KFDTool{Version: "3.11.3"},
Helmfile: config.KFDTool{Version: "0.155.0"},
Kapp: config.KFDTool{Version: "0.61.0"},
},
},
},
Expand All @@ -81,6 +84,7 @@ func Test_Validator_Validate(t *testing.T) {
errors.New("yq: wrong tool version - installed = 4.34.1, expected = 4.33.0"),
errors.New("helm: wrong tool version - installed = 3.12.3, expected = 3.11.3"),
errors.New("helmfile: wrong tool version - installed = 0.156.0, expected = 0.155.0"),
errors.New("kapp: wrong tool version - installed = 0.61.0, expected = 0.62.0"),
},
},
{
Expand All @@ -96,6 +100,7 @@ func Test_Validator_Validate(t *testing.T) {
Yq: config.KFDTool{Version: "4.34.1"},
Helm: config.KFDTool{Version: "3.12.3"},
Helmfile: config.KFDTool{Version: "0.156.0"},
Kapp: config.KFDTool{Version: "0.62.0"},
},
Eks: config.KFDToolsEks{
Awscli: config.KFDTool{Version: "2.8.12"},
Expand All @@ -117,6 +122,7 @@ func Test_Validator_Validate(t *testing.T) {
"helmfile",
"awscli",
"openvpn",
"kapp",
},
},
}
Expand Down
6 changes: 3 additions & 3 deletions internal/tool/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import (
"github.com/sighupio/furyctl/internal/tool/git"
"github.com/sighupio/furyctl/internal/tool/helm"
"github.com/sighupio/furyctl/internal/tool/helmfile"
"github.com/sighupio/furyctl/internal/tool/kapp"
"github.com/sighupio/furyctl/internal/tool/kubectl"
"github.com/sighupio/furyctl/internal/tool/kustomize"
"github.com/sighupio/furyctl/internal/tool/openvpn"
"github.com/sighupio/furyctl/internal/tool/shell"
"github.com/sighupio/furyctl/internal/tool/terraform"
"github.com/sighupio/furyctl/internal/tool/yq"
"github.com/sighupio/furyctl/internal/tool/kapp"
execx "github.com/sighupio/furyctl/internal/x/exec"
)

Expand Down Expand Up @@ -141,12 +141,12 @@ func (rf *RunnerFactory) Create(name Name, version, workDir string) Runner {
Helmfile: filepath.Join(rf.paths.Bin, string(name), version, string(name)),
WorkDir: workDir,
})

case Kapp:
return kapp.NewRunner(
rf.executor,
kapp.Paths{
Kapp: filepath.Join(rf.paths.Bin, string(name), version, string(name)),
Kapp: filepath.Join(rf.paths.Bin, string(name), version, string(name)),
WorkDir: workDir,
},
false,
Expand Down

0 comments on commit 9635b09

Please sign in to comment.