提交 a358aff0 编写于 作者: M Medya Gh

fix ocibinary

上级 91af8032
......@@ -103,8 +103,8 @@ var addonsConfigureCmd = &cobra.Command{
"aws-assume-role": awsRole,
},
map[string]string{
"app": "registry-creds",
"cloud": "ecr",
"app": "registry-creds",
"cloud": "ecr",
"kubernetes.io/minikube-addons": "registry-creds",
})
......@@ -118,11 +118,11 @@ var addonsConfigureCmd = &cobra.Command{
"registry-creds-gcr",
map[string]string{
"application_default_credentials.json": gcrApplicationDefaultCredentials,
"gcrurl": gcrURL,
"gcrurl": gcrURL,
},
map[string]string{
"app": "registry-creds",
"cloud": "gcr",
"app": "registry-creds",
"cloud": "gcr",
"kubernetes.io/minikube-addons": "registry-creds",
})
......@@ -140,8 +140,8 @@ var addonsConfigureCmd = &cobra.Command{
"DOCKER_PRIVATE_REGISTRY_PASSWORD": dockerPass,
},
map[string]string{
"app": "registry-creds",
"cloud": "dpr",
"app": "registry-creds",
"cloud": "dpr",
"kubernetes.io/minikube-addons": "registry-creds",
})
......
......@@ -64,6 +64,7 @@ func NewDriver(c Config) *Driver {
},
exec: command.NewKICRunner(c.MachineName, c.OCIBinary),
NodeConfig: c,
OCIBinary: c.OCIBinary,
}
return d
}
......
......@@ -39,8 +39,8 @@ const (
// Node represents a handle to a kic node
// This struct must be created by one of: CreateControlPlane
type Node struct {
// must be one of docker container ID or name
name string
id string // container id
name string // container name
r command.Runner // Runner
ociBinary string
}
......@@ -123,13 +123,15 @@ func CreateNode(p CreateConfig) (*Node, error) {
// Find finds a node
func Find(ociBinary string, name string, cmder command.Runner) (*Node, error) {
_, err := oci.Inspect(ociBinary, name, "{{.Id}}")
n, err := oci.Inspect(ociBinary, name, "{{.Id}}")
if err != nil {
return nil, fmt.Errorf("can't find node %v", err)
}
return &Node{
name: name,
r: cmder,
ociBinary: ociBinary,
id: n[0],
name: name,
r: cmder,
}, nil
}
......
......@@ -121,6 +121,7 @@ func Inspect(ociBinary string, containerNameOrID, format string) ([]string, erro
for scanner.Scan() {
lines = append(lines, scanner.Text())
}
fmt.Printf("lines %+v err %v", lines, err)
return lines, err
}
......
......@@ -16,6 +16,11 @@ limitations under the License.
package oci
const (
Docker = "docker"
Podman = "podman"
)
/*
These types are from
https://github.com/kubernetes/kubernetes/blob/063e7ff358fdc8b0916e6f39beedc0d025734cb1/pkg/kubelet/apis/cri/runtime/v1alpha2/api.pb.go#L183
......
......@@ -49,10 +49,10 @@ var configTestCases = []configTestCase{
"vm-driver": "test-driver"
}`,
config: map[string]interface{}{
"vm-driver": "test-driver",
"cpus": 4,
"disk-size": "20g",
"v": 5,
"vm-driver": "test-driver",
"cpus": 4,
"disk-size": "20g",
"v": 5,
"show-libmachine-logs": true,
"log_dir": "/etc/hosts",
"ReminderWaitPeriodInHours": 99,
......
......@@ -23,6 +23,7 @@ import (
"github.com/docker/machine/libmachine/drivers"
"github.com/golang/glog"
"k8s.io/minikube/pkg/drivers/kic"
"k8s.io/minikube/pkg/drivers/kic/oci"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/driver"
"k8s.io/minikube/pkg/minikube/localpath"
......@@ -33,7 +34,7 @@ func init() {
if err := registry.Register(registry.DriverDef{
Name: driver.Docker,
Config: configure,
Init: func() drivers.Driver { return kic.NewDriver(kic.Config{}) },
Init: func() drivers.Driver { return kic.NewDriver(kic.Config{OCIBinary: oci.Docker}) },
Status: status,
Priority: registry.Discouraged, // experimental
}); err != nil {
......@@ -53,7 +54,7 @@ func configure(mc config.MachineConfig) interface{} {
CPU: mc.CPUs,
Memory: mc.Memory,
APIServerPort: mc.NodeBindPort,
OCIBinary: "docker",
OCIBinary: oci.Docker,
})
}
......
......@@ -364,30 +364,30 @@ func TestOptionallyHttpsFormattedUrlString(t *testing.T) {
expectedIsHTTPSchemedURL bool
}{
{
description: "no https for http schemed with no https option",
bareURLString: "http://192.168.99.100:30563",
https: false,
description: "no https for http schemed with no https option",
bareURLString: "http://192.168.99.100:30563",
https: false,
expectedHTTPSFormattedURLString: "http://192.168.99.100:30563",
expectedIsHTTPSchemedURL: true,
},
{
description: "no https for non-http schemed with no https option",
bareURLString: "xyz.http.myservice:30563",
https: false,
description: "no https for non-http schemed with no https option",
bareURLString: "xyz.http.myservice:30563",
https: false,
expectedHTTPSFormattedURLString: "xyz.http.myservice:30563",
expectedIsHTTPSchemedURL: false,
},
{
description: "https for http schemed with https option",
bareURLString: "http://192.168.99.100:30563",
https: true,
description: "https for http schemed with https option",
bareURLString: "http://192.168.99.100:30563",
https: true,
expectedHTTPSFormattedURLString: "https://192.168.99.100:30563",
expectedIsHTTPSchemedURL: true,
},
{
description: "no https for non-http schemed with https option and http substring",
bareURLString: "xyz.http.myservice:30563",
https: true,
description: "no https for non-http schemed with https option and http substring",
bareURLString: "xyz.http.myservice:30563",
https: true,
expectedHTTPSFormattedURLString: "xyz.http.myservice:30563",
expectedIsHTTPSchemedURL: false,
},
......
......@@ -53,7 +53,7 @@ func GenerateCACert(certPath, keyPath string, name string) error {
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign,
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth},
BasicConstraintsValid: true,
IsCA: true,
IsCA: true,
}
return writeCertsAndKeys(&template, certPath, priv, keyPath, &template, priv)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册