pull/12252/head
Medya Gh 2021-08-12 17:11:31 -07:00
parent 8b9cddb7e0
commit 5206f7fb39
5 changed files with 8 additions and 11 deletions

View File

@ -134,9 +134,9 @@ func pauseCRIContainers(cr CommandRunner, root string, ids []string) error {
args = append(args, "--root", root)
}
args = append(args, "pause")
cargs := args
for _, id := range ids {
cargs := append(args, id)
cargs = append(cargs, id)
if _, err := cr.RunCmd(exec.Command("sudo", cargs...)); err != nil {
return errors.Wrap(err, "runc")
}
@ -161,9 +161,9 @@ func unpauseCRIContainers(cr CommandRunner, root string, ids []string) error {
args = append(args, "--root", root)
}
args = append(args, "resume")
cargs := args
for _, id := range ids {
cargs := append(args, id)
cargs := append(cargs, id)
if _, err := cr.RunCmd(exec.Command("sudo", cargs...)); err != nil {
return errors.Wrap(err, "runc")
}

View File

@ -225,10 +225,6 @@ func TestUpdateTransport(t *testing.T) {
c := UpdateTransport(&rc)
tr := &http.Transport{}
tr.RegisterProtocol("file", http.NewFileTransport(http.Dir("/tmp")))
rt := c.WrapTransport(tr)
if _, ok := rt.(http.RoundTripper); !ok {
t.Fatalf("Cannot cast rt(%v) to http.RoundTripper", rt)
}
})
t.Run("existing", func(t *testing.T) {
// rest config initialized with WrapTransport function

View File

@ -50,7 +50,7 @@ func (router *osRouter) EnsureRouteIsAdded(route *Route) error {
command := exec.Command("sudo", "route", "-n", "add", serviceCIDR, gatewayIP)
klog.Infof("About to run command: %s", command.Args)
stdInAndOut, err := command.CombinedOutput()
message := fmt.Sprintf("%s", stdInAndOut)
message := string(stdInAndOut)
re := regexp.MustCompile(fmt.Sprintf("add net (.*): gateway %s\n", gatewayIP))
if !re.MatchString(message) {
return fmt.Errorf("error adding Route: %s, %d", message, len(strings.Split(message, "\n")))

View File

@ -129,7 +129,7 @@ func (router *osRouter) Cleanup(route *Route) error {
klog.Infof("Cleaning up route for CIDR %s to gateway %s\n", serviceCIDR, gatewayIP)
command := exec.Command("sudo", "ip", "route", "delete", serviceCIDR)
stdInAndOut, err := command.CombinedOutput()
message := fmt.Sprintf("%s", stdInAndOut)
message := string(stdInAndOut)
klog.Infof("%s", message)
if err != nil {
return fmt.Errorf("error deleting Route: %s, %s", message, err)

View File

@ -106,8 +106,9 @@ func configureAuth(p miniProvisioner) error {
return err
}
hosts := authOptions.ServerCertSANs
// The Host IP is always added to the certificate's SANs list
hosts := append(authOptions.ServerCertSANs, ip, hostIP, "localhost", "127.0.0.1", "minikube", machineName)
hosts = append(hosts, ip, hostIP, "localhost", "127.0.0.1", "minikube", machineName)
klog.Infof("generating server cert: %s ca-key=%s private-key=%s org=%s san=%s",
authOptions.ServerCertPath,
authOptions.CaCertPath,