mirror of https://github.com/k3s-io/k3s
rename test/e2e_node/build/ to builder/
parent
27116c6818
commit
0ea5904c23
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package build
|
package builder
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
|
@ -31,7 +31,7 @@ import (
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
utilerrors "k8s.io/kubernetes/pkg/util/errors"
|
utilerrors "k8s.io/kubernetes/pkg/util/errors"
|
||||||
"k8s.io/kubernetes/test/e2e_node/build"
|
"k8s.io/kubernetes/test/e2e_node/builder"
|
||||||
)
|
)
|
||||||
|
|
||||||
var sshOptions = flag.String("ssh-options", "", "Commandline options passed to ssh.")
|
var sshOptions = flag.String("ssh-options", "", "Commandline options passed to ssh.")
|
||||||
|
@ -83,12 +83,12 @@ func GetHostnameOrIp(hostname string) string {
|
||||||
// the binaries k8s required for node e2e tests
|
// the binaries k8s required for node e2e tests
|
||||||
func CreateTestArchive() (string, error) {
|
func CreateTestArchive() (string, error) {
|
||||||
// Build the executables
|
// Build the executables
|
||||||
if err := build.BuildGo(); err != nil {
|
if err := builder.BuildGo(); err != nil {
|
||||||
return "", fmt.Errorf("failed to build the depedencies: %v", err)
|
return "", fmt.Errorf("failed to build the depedencies: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure we can find the newly built binaries
|
// Make sure we can find the newly built binaries
|
||||||
buildOutputDir, err := build.GetK8sBuildOutputDir()
|
buildOutputDir, err := builder.GetK8sBuildOutputDir()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("failed to locate kubernetes build output directory %v", err)
|
return "", fmt.Errorf("failed to locate kubernetes build output directory %v", err)
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ func CreateTestArchive() (string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Include the GCI mounter in the deployed tarball
|
// Include the GCI mounter in the deployed tarball
|
||||||
k8sDir, err := build.GetK8sRootDir()
|
k8sDir, err := builder.GetK8sRootDir()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("Could not find K8s root dir! Err: %v", err)
|
return "", fmt.Errorf("Could not find K8s root dir! Err: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -244,7 +244,7 @@ func RunRemote(archive string, host string, cleanup bool, junitFilePrefix string
|
||||||
// We do this here because the local var `tmp` tells us which /tmp/gcloud-e2e-%d is relevant to the current test run.
|
// We do this here because the local var `tmp` tells us which /tmp/gcloud-e2e-%d is relevant to the current test run.
|
||||||
|
|
||||||
// Determine if the GCI mounter script exists locally.
|
// Determine if the GCI mounter script exists locally.
|
||||||
k8sDir, err := build.GetK8sRootDir()
|
k8sDir, err := builder.GetK8sRootDir()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", false, fmt.Errorf("Could not find K8s root dir! Err: %v", err)
|
return "", false, fmt.Errorf("Could not find K8s root dir! Err: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"k8s.io/kubernetes/test/e2e_node/build"
|
"k8s.io/kubernetes/test/e2e_node/builder"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
)
|
)
|
||||||
|
@ -37,13 +37,13 @@ func main() {
|
||||||
|
|
||||||
// Build dependencies - ginkgo, kubelet and apiserver.
|
// Build dependencies - ginkgo, kubelet and apiserver.
|
||||||
if *buildDependencies {
|
if *buildDependencies {
|
||||||
if err := build.BuildGo(); err != nil {
|
if err := builder.BuildGo(); err != nil {
|
||||||
glog.Fatalf("Failed to build the dependencies: %v", err)
|
glog.Fatalf("Failed to build the dependencies: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run node e2e test
|
// Run node e2e test
|
||||||
outputDir, err := build.GetK8sBuildOutputDir()
|
outputDir, err := builder.GetK8sBuildOutputDir()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Fatalf("Failed to get build output directory: %v", err)
|
glog.Fatalf("Failed to get build output directory: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ import (
|
||||||
|
|
||||||
utilconfig "k8s.io/kubernetes/pkg/util/config"
|
utilconfig "k8s.io/kubernetes/pkg/util/config"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
"k8s.io/kubernetes/test/e2e_node/build"
|
"k8s.io/kubernetes/test/e2e_node/builder"
|
||||||
)
|
)
|
||||||
|
|
||||||
// E2EServices starts and stops e2e services in a separate process. The test
|
// E2EServices starts and stops e2e services in a separate process. The test
|
||||||
|
@ -179,7 +179,7 @@ func (e *E2EServices) startKubelet() (*server, error) {
|
||||||
// Since kubelet will typically be run as a service it also makes more
|
// Since kubelet will typically be run as a service it also makes more
|
||||||
// sense to test it that way
|
// sense to test it that way
|
||||||
unitName := fmt.Sprintf("kubelet-%d.service", rand.Int31())
|
unitName := fmt.Sprintf("kubelet-%d.service", rand.Int31())
|
||||||
cmdArgs = append(cmdArgs, systemdRun, "--unit="+unitName, "--remain-after-exit", build.GetKubeletServerBin())
|
cmdArgs = append(cmdArgs, systemdRun, "--unit="+unitName, "--remain-after-exit", builder.GetKubeletServerBin())
|
||||||
killCommand = exec.Command("sudo", "systemctl", "kill", unitName)
|
killCommand = exec.Command("sudo", "systemctl", "kill", unitName)
|
||||||
restartCommand = exec.Command("sudo", "systemctl", "restart", unitName)
|
restartCommand = exec.Command("sudo", "systemctl", "restart", unitName)
|
||||||
e.logFiles["kubelet.log"] = logFileData{
|
e.logFiles["kubelet.log"] = logFileData{
|
||||||
|
@ -187,7 +187,7 @@ func (e *E2EServices) startKubelet() (*server, error) {
|
||||||
}
|
}
|
||||||
framework.TestContext.EvictionHard = adjustConfigForSystemd(framework.TestContext.EvictionHard)
|
framework.TestContext.EvictionHard = adjustConfigForSystemd(framework.TestContext.EvictionHard)
|
||||||
} else {
|
} else {
|
||||||
cmdArgs = append(cmdArgs, build.GetKubeletServerBin())
|
cmdArgs = append(cmdArgs, builder.GetKubeletServerBin())
|
||||||
cmdArgs = append(cmdArgs,
|
cmdArgs = append(cmdArgs,
|
||||||
"--runtime-cgroups=/docker-daemon",
|
"--runtime-cgroups=/docker-daemon",
|
||||||
"--kubelet-cgroups=/kubelet",
|
"--kubelet-cgroups=/kubelet",
|
||||||
|
|
Loading…
Reference in New Issue