commit
295c4362bc
|
@ -30,6 +30,7 @@ import (
|
|||
"k8s.io/minikube/pkg/minikube/out"
|
||||
)
|
||||
|
||||
// ErrorCodes generates error codes
|
||||
func ErrorCodes(docPath string, pathsToCheck []string) error {
|
||||
buf := bytes.NewBuffer([]byte{})
|
||||
date := time.Now().Format("2006-01-02")
|
||||
|
|
|
@ -33,6 +33,7 @@ import (
|
|||
"k8s.io/minikube/pkg/minikube/out"
|
||||
)
|
||||
|
||||
// TestDocs generates list of tests
|
||||
func TestDocs(docPath string, pathToCheck string) error {
|
||||
buf := bytes.NewBuffer([]byte{})
|
||||
date := time.Now().Format("2006-01-02")
|
||||
|
|
|
@ -24,6 +24,7 @@ import (
|
|||
"k8s.io/minikube/deploy/addons"
|
||||
)
|
||||
|
||||
// AliyunMirror list of images from Aliyun mirror
|
||||
var AliyunMirror = loadAliyunMirror()
|
||||
|
||||
func loadAliyunMirror() map[string]string {
|
||||
|
@ -39,6 +40,7 @@ func loadAliyunMirror() map[string]string {
|
|||
return mirror
|
||||
}
|
||||
|
||||
// FixAddonImagesAndRegistries fixes images & registries in addon
|
||||
func FixAddonImagesAndRegistries(addon *Addon, images map[string]string, registries map[string]string) (customImages, customRegistries map[string]string) {
|
||||
customImages = make(map[string]string)
|
||||
customRegistries = make(map[string]string)
|
||||
|
|
|
@ -60,6 +60,8 @@ type CopyableFile interface {
|
|||
}
|
||||
|
||||
type writeFn func(d []byte) (n int, err error)
|
||||
|
||||
// BaseCopyableFile is something that can be copied and written
|
||||
type BaseCopyableFile struct {
|
||||
ReadableFile
|
||||
|
||||
|
@ -69,26 +71,32 @@ type BaseCopyableFile struct {
|
|||
targetName string
|
||||
}
|
||||
|
||||
// Write is for write something into the file
|
||||
func (r *BaseCopyableFile) Write(d []byte) (n int, err error) {
|
||||
return r.writer(d)
|
||||
}
|
||||
|
||||
// SetLength is for setting the length
|
||||
func (r *BaseCopyableFile) SetLength(length int) {
|
||||
r.length = length
|
||||
}
|
||||
|
||||
// GetTargetPath returns target path
|
||||
func (r *BaseCopyableFile) GetTargetPath() string {
|
||||
return filepath.Join(r.GetTargetDir(), r.GetTargetName())
|
||||
}
|
||||
|
||||
// GetTargetDir returns target dir
|
||||
func (r *BaseCopyableFile) GetTargetDir() string {
|
||||
return r.targetDir
|
||||
}
|
||||
|
||||
// GetTargetName returns target name
|
||||
func (r *BaseCopyableFile) GetTargetName() string {
|
||||
return r.targetName
|
||||
}
|
||||
|
||||
// NewBaseCopyableFile creates a new instance of BaseCopyableFile
|
||||
func NewBaseCopyableFile(source ReadableFile, writer writeFn, targetDir, targetName string) *BaseCopyableFile {
|
||||
return &BaseCopyableFile{
|
||||
ReadableFile: source,
|
||||
|
|
|
@ -58,9 +58,9 @@ type mountRunner interface {
|
|||
const (
|
||||
// MountErrorUnknown failed with unknown error
|
||||
MountErrorUnknown = iota
|
||||
// MountErrorConnect
|
||||
// MountErrorConnect failed to connect
|
||||
MountErrorConnect
|
||||
// MountErrorChmod
|
||||
// MountErrorChmod failed to chmod
|
||||
MountErrorChmod
|
||||
)
|
||||
|
||||
|
|
|
@ -808,7 +808,7 @@ func (c Cilium) CIDR() string {
|
|||
return DefaultPodCIDR
|
||||
}
|
||||
|
||||
// GenerateKubeadmYAML generates the .yaml file
|
||||
// GenerateCiliumYAML generates the .yaml file
|
||||
func GenerateCiliumYAML() ([]byte, error) {
|
||||
|
||||
podCIDR := DefaultPodCIDR
|
||||
|
|
|
@ -142,6 +142,7 @@ func (f *FakeCommandRunner) Copy(file assets.CopyableFile) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// CopyFrom copy content from file to the stored map.
|
||||
func (f *FakeCommandRunner) CopyFrom(file assets.CopyableFile) error {
|
||||
v, ok := f.fileMap.Load(file.GetSourcePath())
|
||||
if !ok {
|
||||
|
@ -161,6 +162,7 @@ func (f *FakeCommandRunner) Remove(file assets.CopyableFile) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// ReadableFile implements interface (without implementation)
|
||||
func (f *FakeCommandRunner) ReadableFile(sourcePath string) (assets.ReadableFile, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ var (
|
|||
)
|
||||
|
||||
// SSHRunner runs commands through SSH.
|
||||
|
||||
//
|
||||
// It implements the CommandRunner interface.
|
||||
type SSHRunner struct {
|
||||
d drivers.Driver
|
||||
|
@ -499,6 +499,7 @@ func (s *SSHRunner) CopyFrom(f assets.CopyableFile) error {
|
|||
return g.Wait()
|
||||
}
|
||||
|
||||
// ReadableFile returns assets.ReadableFile for the sourcePath (via `stat` command)
|
||||
func (s *SSHRunner) ReadableFile(sourcePath string) (assets.ReadableFile, error) {
|
||||
klog.V(4).Infof("NewsshReadableFile: %s -> %s", sourcePath)
|
||||
|
||||
|
|
|
@ -172,6 +172,7 @@ func IsSSH(name string) bool {
|
|||
return name == SSH
|
||||
}
|
||||
|
||||
// AllowsPreload returns if preload is allowed for the driver
|
||||
func AllowsPreload(driverName string) bool {
|
||||
return !BareMetal(driverName) && !IsSSH(driverName)
|
||||
}
|
||||
|
|
|
@ -203,6 +203,7 @@ func imagePathInCache(img string) string {
|
|||
return f
|
||||
}
|
||||
|
||||
// UploadCachedImage uploads cached image
|
||||
func UploadCachedImage(imgName string) error {
|
||||
tag, err := name.NewTag(imgName, name.WeakValidation)
|
||||
if err != nil {
|
||||
|
|
|
@ -47,7 +47,7 @@ func MaybePrintUpdateTextFromGithub() {
|
|||
maybePrintUpdateText(GithubMinikubeReleasesURL, GithubMinikubeBetaReleasesURL, lastUpdateCheckFilePath)
|
||||
}
|
||||
|
||||
// MaybePrintUpdateTextFromGithub prints update text if needed, from Aliyun mirror
|
||||
// MaybePrintUpdateTextFromAliyunMirror prints update text if needed, from Aliyun mirror
|
||||
func MaybePrintUpdateTextFromAliyunMirror() {
|
||||
maybePrintUpdateText(GithubMinikubeReleasesAliyunURL, GithubMinikubeBetaReleasesAliyunURL, lastUpdateCheckFilePath)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue