test
This commit is contained in:
parent
dddd5d1831
commit
052e6f1368
@ -22,15 +22,6 @@ func TestHelmRepoAdd(t *testing.T) {
|
|||||||
|
|
||||||
res, err := repo.AddRepository()
|
res, err := repo.AddRepository()
|
||||||
fmt.Println("TestHelmRepoAdd.24", res, err)
|
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
|
// helm : not found
|
||||||
|
@ -9,6 +9,7 @@ type toolsData struct {
|
|||||||
Tools []ToolData `yaml:"tools"`
|
Tools []ToolData `yaml:"tools"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Lecture de la liste des outils
|
||||||
func FromConfigFile(filename string) ([]ToolData, error) {
|
func FromConfigFile(filename string) ([]ToolData, error) {
|
||||||
yamlFile, _ := os.ReadFile(filename)
|
yamlFile, _ := os.ReadFile(filename)
|
||||||
var data toolsData
|
var data toolsData
|
||||||
|
@ -2,6 +2,7 @@ package tool
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
// "os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"testing"
|
"testing"
|
||||||
@ -15,13 +16,6 @@ func TestToolConf(t *testing.T) {
|
|||||||
|
|
||||||
data, err := FromConfigFile(src)
|
data, err := FromConfigFile(src)
|
||||||
fmt.Println("data", src, data, err)
|
fmt.Println("data", src, data, err)
|
||||||
|
assert.Equal(t, "kubectl", data[0].Name, "TestToolConf error")
|
||||||
bin := filepath.Join(TEST_BIN_DIR, "kubectl")
|
assert.Nilf(t, err, "error message %s", src)
|
||||||
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")
|
|
||||||
}
|
}
|
@ -0,0 +1 @@
|
|||||||
|
package tool
|
@ -15,7 +15,6 @@ import (
|
|||||||
|
|
||||||
func GetFromOnline(version string) (string, string, error) {
|
func GetFromOnline(version string) (string, string, error) {
|
||||||
|
|
||||||
fmt.Println(" ONLINE 18")
|
|
||||||
version2 := version
|
version2 := version
|
||||||
if version == "latest" {
|
if version == "latest" {
|
||||||
versionLatest, err := readLatestFromOnline()
|
versionLatest, err := readLatestFromOnline()
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
tools:
|
tools:
|
||||||
|
- name: kubectl
|
||||||
|
url: https://dl.k8s.io/release/%s/bin/linux/amd64/kubectl
|
||||||
|
version: v1.30.3
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user