mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 10:53:34 +00:00
vendor update for CSI 0.3.0
This commit is contained in:
1
vendor/k8s.io/kubernetes/test/e2e_node/remote/BUILD
generated
vendored
1
vendor/k8s.io/kubernetes/test/e2e_node/remote/BUILD
generated
vendored
@ -19,6 +19,7 @@ go_library(
|
||||
importpath = "k8s.io/kubernetes/test/e2e_node/remote",
|
||||
deps = [
|
||||
"//test/e2e_node/builder:go_default_library",
|
||||
"//test/utils:go_default_library",
|
||||
"//vendor/github.com/golang/glog:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/util/errors:go_default_library",
|
||||
],
|
||||
|
5
vendor/k8s.io/kubernetes/test/e2e_node/remote/cadvisor_e2e.go
generated
vendored
5
vendor/k8s.io/kubernetes/test/e2e_node/remote/cadvisor_e2e.go
generated
vendored
@ -23,8 +23,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/golang/glog"
|
||||
|
||||
"k8s.io/kubernetes/test/e2e_node/builder"
|
||||
"k8s.io/kubernetes/test/utils"
|
||||
)
|
||||
|
||||
// CAdvisorE2ERemote contains the specific functions in the cadvisor e2e test suite.
|
||||
@ -37,7 +36,7 @@ func InitCAdvisorE2ERemote() TestSuite {
|
||||
|
||||
// SetupTestPackage implements TestSuite.SetupTestPackage
|
||||
func (n *CAdvisorE2ERemote) SetupTestPackage(tardir, systemSpecName string) error {
|
||||
cadvisorRootDir, err := builder.GetCAdvisorRootDir()
|
||||
cadvisorRootDir, err := utils.GetCAdvisorRootDir()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
5
vendor/k8s.io/kubernetes/test/e2e_node/remote/node_conformance.go
generated
vendored
5
vendor/k8s.io/kubernetes/test/e2e_node/remote/node_conformance.go
generated
vendored
@ -28,6 +28,7 @@ import (
|
||||
"github.com/golang/glog"
|
||||
|
||||
"k8s.io/kubernetes/test/e2e_node/builder"
|
||||
"k8s.io/kubernetes/test/utils"
|
||||
)
|
||||
|
||||
// ConformanceRemote contains the specific functions in the node conformance test suite.
|
||||
@ -39,7 +40,7 @@ func InitConformanceRemote() TestSuite {
|
||||
|
||||
// getConformanceDirectory gets node conformance test build directory.
|
||||
func getConformanceDirectory() (string, error) {
|
||||
k8sRoot, err := builder.GetK8sRootDir()
|
||||
k8sRoot, err := utils.GetK8sRootDir()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@ -106,7 +107,7 @@ func (c *ConformanceRemote) SetupTestPackage(tardir, systemSpecName string) erro
|
||||
}
|
||||
|
||||
// Make sure we can find the newly built binaries
|
||||
buildOutputDir, err := builder.GetK8sBuildOutputDir()
|
||||
buildOutputDir, err := utils.GetK8sBuildOutputDir()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to locate kubernetes build output directory %v", err)
|
||||
}
|
||||
|
5
vendor/k8s.io/kubernetes/test/e2e_node/remote/node_e2e.go
generated
vendored
5
vendor/k8s.io/kubernetes/test/e2e_node/remote/node_e2e.go
generated
vendored
@ -27,6 +27,7 @@ import (
|
||||
"github.com/golang/glog"
|
||||
|
||||
"k8s.io/kubernetes/test/e2e_node/builder"
|
||||
"k8s.io/kubernetes/test/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -49,12 +50,12 @@ func (n *NodeE2ERemote) SetupTestPackage(tardir, systemSpecName string) error {
|
||||
}
|
||||
|
||||
// Make sure we can find the newly built binaries
|
||||
buildOutputDir, err := builder.GetK8sBuildOutputDir()
|
||||
buildOutputDir, err := utils.GetK8sBuildOutputDir()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to locate kubernetes build output directory: %v", err)
|
||||
}
|
||||
|
||||
rootDir, err := builder.GetK8sRootDir()
|
||||
rootDir, err := utils.GetK8sRootDir()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to locate kubernetes root directory: %v", err)
|
||||
}
|
||||
|
30
vendor/k8s.io/kubernetes/test/e2e_node/remote/remote.go
generated
vendored
30
vendor/k8s.io/kubernetes/test/e2e_node/remote/remote.go
generated
vendored
@ -23,6 +23,8 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/golang/glog"
|
||||
@ -66,7 +68,7 @@ func CreateTestArchive(suite TestSuite, systemSpecName string) (string, error) {
|
||||
func RunRemote(suite TestSuite, archive string, host string, cleanup bool, imageDesc, junitFilePrefix string, testArgs string, ginkgoArgs string, systemSpecName string) (string, bool, error) {
|
||||
// Create the temp staging directory
|
||||
glog.V(2).Infof("Staging test binaries on %q", host)
|
||||
workspace := fmt.Sprintf("/tmp/node-e2e-%s", getTimestamp())
|
||||
workspace := newWorkspaceDir()
|
||||
// Do not sudo here, so that we can use scp to copy test archive to the directdory.
|
||||
if output, err := SSHNoSudo(host, "mkdir", workspace); err != nil {
|
||||
// Exit failure with the error
|
||||
@ -126,13 +128,35 @@ func RunRemote(suite TestSuite, archive string, host string, cleanup bool, image
|
||||
return output, len(aggErrs) == 0, utilerrors.NewAggregate(aggErrs)
|
||||
}
|
||||
|
||||
// timestampFormat is the timestamp format used in the node e2e directory name.
|
||||
const timestampFormat = "20060102T150405"
|
||||
const (
|
||||
// workspaceDirPrefix is the string prefix used in the workspace directory name.
|
||||
workspaceDirPrefix = "node-e2e-"
|
||||
// timestampFormat is the timestamp format used in the node e2e directory name.
|
||||
timestampFormat = "20060102T150405"
|
||||
)
|
||||
|
||||
func getTimestamp() string {
|
||||
return fmt.Sprintf(time.Now().Format(timestampFormat))
|
||||
}
|
||||
|
||||
func newWorkspaceDir() string {
|
||||
return filepath.Join("/tmp", workspaceDirPrefix+getTimestamp())
|
||||
}
|
||||
|
||||
// Parses the workspace directory name and gets the timestamp part of it.
|
||||
// This can later be used to name other artifacts (such as the
|
||||
// kubelet-${instance}.service systemd transient service used to launch
|
||||
// Kubelet) so that they can be matched to each other.
|
||||
func GetTimestampFromWorkspaceDir(dir string) string {
|
||||
dirTimestamp := strings.TrimPrefix(filepath.Base(dir), workspaceDirPrefix)
|
||||
re := regexp.MustCompile("^\\d{8}T\\d{6}$")
|
||||
if re.MatchString(dirTimestamp) {
|
||||
return dirTimestamp
|
||||
}
|
||||
// Fallback: if we can't find that timestamp, default to using Now()
|
||||
return getTimestamp()
|
||||
}
|
||||
|
||||
func getTestArtifacts(host, testDir string) error {
|
||||
logPath := filepath.Join(*resultsDir, host)
|
||||
if err := os.MkdirAll(logPath, 0755); err != nil {
|
||||
|
2
vendor/k8s.io/kubernetes/test/e2e_node/remote/utils.go
generated
vendored
2
vendor/k8s.io/kubernetes/test/e2e_node/remote/utils.go
generated
vendored
@ -56,7 +56,7 @@ func setupCNI(host, workspace string) error {
|
||||
cniPath := filepath.Join(workspace, cniDirectory)
|
||||
cmd := getSSHCommand(" ; ",
|
||||
fmt.Sprintf("mkdir -p %s", cniPath),
|
||||
fmt.Sprintf("wget -O - %s | tar -xz -C %s", cniURL, cniPath),
|
||||
fmt.Sprintf("curl -s -L %s | tar -xz -C %s", cniURL, cniPath),
|
||||
)
|
||||
if output, err := SSH(host, "sh", "-c", cmd); err != nil {
|
||||
return fmt.Errorf("failed to install cni plugin on %q: %v output: %q", host, err, output)
|
||||
|
Reference in New Issue
Block a user