|
|
@ -18,6 +18,7 @@ package installer // import "k8s.io/helm/cmd/helm/installer"
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"bytes"
|
|
|
|
|
|
|
|
"fmt"
|
|
|
|
"io/ioutil"
|
|
|
|
"io/ioutil"
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
"testing"
|
|
|
@ -104,28 +105,28 @@ func TestEnsureHome(t *testing.T) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
foundStable := false
|
|
|
|
foundStable := false
|
|
|
|
|
|
|
|
stableCachePath := fmt.Sprintf("%s-index.yaml", stableRepository)
|
|
|
|
|
|
|
|
foundLocal := false
|
|
|
|
|
|
|
|
localCachePath := fmt.Sprintf("%s-index.yaml", LocalRepository)
|
|
|
|
for _, rr := range rf.Repositories {
|
|
|
|
for _, rr := range rf.Repositories {
|
|
|
|
if rr.Name == stableRepository {
|
|
|
|
if rr.Name == stableRepository {
|
|
|
|
foundStable = true
|
|
|
|
if rr.Cache != stableCachePath {
|
|
|
|
if err != nil {
|
|
|
|
t.Errorf("stable repo cache path is %s, not %s", rr.Cache, stableCachePath)
|
|
|
|
t.Error(err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if filepath.IsAbs(rr.Cache) {
|
|
|
|
|
|
|
|
t.Errorf("%s stable repo cache path is an absolute path", rr.Cache)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
absCache, err := filepath.Abs(filepath.Join(hh.Cache(), rr.Cache))
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
t.Error(err)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if absCache != hh.CacheIndex(stableRepository) {
|
|
|
|
foundStable = true
|
|
|
|
t.Errorf("%s stable repo cache path doesn't resolve to absolute cache index path", rr.Cache)
|
|
|
|
} else if rr.Name == LocalRepository {
|
|
|
|
|
|
|
|
if rr.Cache != localCachePath {
|
|
|
|
|
|
|
|
t.Errorf("local repo cache path is %s, not %s", rr.Cache, localCachePath)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break
|
|
|
|
foundLocal = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if !foundStable {
|
|
|
|
if !foundStable {
|
|
|
|
t.Errorf("stable repo not found")
|
|
|
|
t.Errorf("stable repo not found")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if !foundLocal {
|
|
|
|
|
|
|
|
t.Errorf("local repo not found")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
expectedDirs := []string{hh.String(), hh.Repository(), hh.Cache(), hh.LocalRepository()}
|
|
|
|
expectedDirs := []string{hh.String(), hh.Repository(), hh.Cache(), hh.LocalRepository()}
|
|
|
|
for _, dir := range expectedDirs {
|
|
|
|
for _, dir := range expectedDirs {
|
|
|
|