This commit is contained in:
admju 2024-09-06 07:39:46 +00:00
parent dddd5d1831
commit 052e6f1368
6 changed files with 9 additions and 20 deletions

View File

@ -22,15 +22,6 @@ func TestHelmRepoAdd(t *testing.T) {
res, err := repo.AddRepository()
fmt.Println("TestHelmRepoAdd.24", res, err)
// bin := filepath.Join(TEST_BIN_DIR, "helm")
// os.Chmod(bin, 0700)
// assert.FileExists(t, bin, "TestHelmVersion error")
// version, err := Version(bin)
// assert.Nilf(t, err, "error message %s", bin)
// assert.Equal(t, version, "v3.15.4+gfa9efb0", "TestHelmVersion error")
}
// helm : not found

View File

@ -9,6 +9,7 @@ type toolsData struct {
Tools []ToolData `yaml:"tools"`
}
// Lecture de la liste des outils
func FromConfigFile(filename string) ([]ToolData, error) {
yamlFile, _ := os.ReadFile(filename)
var data toolsData

View File

@ -2,6 +2,7 @@ package tool
import (
"fmt"
// "os"
"path/filepath"
"testing"
@ -15,13 +16,6 @@ func TestToolConf(t *testing.T) {
data, err := FromConfigFile(src)
fmt.Println("data", src, data, err)
bin := filepath.Join(TEST_BIN_DIR, "kubectl")
os.Chmod(bin, 0700)
assert.FileExists(t, bin, "TestKubectlVersion error")
version, err := Version(bin)
assert.Nilf(t, err, "error message %s", bin)
assert.Equal(t, "v1.30.3", version, "TestKubectlVersion error")
assert.Equal(t, "kubectl", data[0].Name, "TestToolConf error")
assert.Nilf(t, err, "error message %s", src)
}

View File

@ -0,0 +1 @@
package tool

View File

@ -15,7 +15,6 @@ import (
func GetFromOnline(version string) (string, string, error) {
fmt.Println(" ONLINE 18")
version2 := version
if version == "latest" {
versionLatest, err := readLatestFromOnline()

View File

@ -1,4 +1,7 @@
---
tools:
- name: kubectl
url: https://dl.k8s.io/release/%s/bin/linux/amd64/kubectl
version: v1.30.3