@@ -114,6 +114,8 @@ type NodeTestContextType struct {
...
@@ -114,6 +114,8 @@ type NodeTestContextType struct {
PrepullImagesbool
PrepullImagesbool
// RuntimeIntegrationType indicates how runtime is integrated with Kubelet. This is mainly used for CRI validation test.
// RuntimeIntegrationType indicates how runtime is integrated with Kubelet. This is mainly used for CRI validation test.
RuntimeIntegrationTypestring
RuntimeIntegrationTypestring
// MounterPath is the path to the program to run to perform a mount
MounterPathstring
}
}
typeCloudConfigstruct{
typeCloudConfigstruct{
...
@@ -209,6 +211,7 @@ func RegisterNodeFlags() {
...
@@ -209,6 +211,7 @@ func RegisterNodeFlags() {
flag.StringVar(&TestContext.ManifestPath,"manifest-path","","The path to the static pod manifest file.")
flag.StringVar(&TestContext.ManifestPath,"manifest-path","","The path to the static pod manifest file.")
flag.BoolVar(&TestContext.PrepullImages,"prepull-images",true,"If true, prepull images so image pull failures do not cause test failures.")
flag.BoolVar(&TestContext.PrepullImages,"prepull-images",true,"If true, prepull images so image pull failures do not cause test failures.")
flag.StringVar(&TestContext.RuntimeIntegrationType,"runtime-integration-type","","Choose the integration path for the container runtime, mainly used for CRI validation.")
flag.StringVar(&TestContext.RuntimeIntegrationType,"runtime-integration-type","","Choose the integration path for the container runtime, mainly used for CRI validation.")
flag.StringVar(&TestContext.MounterPath,"mounter-path","","Path of mounter binary. Leave empty to use the default mount.")
}
}
// overwriteFlagsWithViperConfig finds and writes values to flags using viper as input.
// overwriteFlagsWithViperConfig finds and writes values to flags using viper as input.
// Include the GCI mounter in the deployed tarball
k8sDir,err:=build.GetK8sRootDir()
iferr!=nil{
return"",fmt.Errorf("Could not find K8s root dir! Err: %v",err)
}
localSource:="cluster/gce/gci/mounter/mounter"
source:=filepath.Join(k8sDir,localSource)
// Require the GCI mounter script, we want to make sure the remote test runner stays up to date if the mounter file moves
if_,err:=os.Stat(source);err!=nil{
return"",fmt.Errorf("Could not find GCI mounter script at %q! If this script has been (re)moved, please update the e2e node remote test runner accordingly! Err: %v",source,err)
// If we are testing on a GCI node, we chmod 544 the mounter and specify a different mounter path in the test args.
// 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.
k8sDir,err:=build.GetK8sRootDir()
iferr!=nil{
return"",false,fmt.Errorf("Could not find K8s root dir! Err: %v",err)
}
localSource:="cluster/gce/gci/mounter/mounter"
source:=filepath.Join(k8sDir,localSource)
// Require the GCI mounter script, we want to make sure the remote test runner stays up to date if the mounter file moves
if_,err=os.Stat(source);err!=nil{
return"",false,fmt.Errorf("Could not find GCI mounter script at %q! If this script has been (re)moved, please update the e2e node remote test runner accordingly! Err: %v",source,err)