提交 62e3bc4b 编写于 作者: M Medya Gh

add addons for kic

上级 0a9e8b03
......@@ -56,22 +56,10 @@ const (
// GetCachedBinaryList returns the list of binaries
func GetCachedBinaryList(bootstrapper string) []string {
switch bootstrapper {
case Kubeadm:
return constants.KubeadmBinaries
default:
return []string{}
}
return constants.KubeadmBinaries
}
// GetCachedImageList returns the list of images for a version
func GetCachedImageList(imageRepository string, version string, bootstrapper string) ([]string, error) {
switch bootstrapper {
case Kubeadm:
return images.Kubeadm(imageRepository, version)
case KIC:
return images.KIC(imageRepository, version)
default:
return []string{}, nil
}
return images.Kubeadm(imageRepository, version)
}
/*
Copyright 2019 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package images
import (
"strings"
"github.com/blang/semver"
"github.com/pkg/errors"
)
// KIC returns a list of images necessary to bootstrap kic
// it is same as vm-kubeadm minus auxulary
func KIC(mirror string, version string) ([]string, error) {
v, err := semver.Make(strings.TrimPrefix(version, "v"))
if err != nil {
return nil, errors.Wrap(err, "semver")
}
imgs := essentials(mirror, v)
return imgs, nil
}
......@@ -33,6 +33,7 @@ import (
kconst "k8s.io/kubernetes/cmd/kubeadm/app/constants"
"k8s.io/minikube/pkg/drivers/kic"
"k8s.io/minikube/pkg/kapi"
"k8s.io/minikube/pkg/minikube/assets"
"k8s.io/minikube/pkg/minikube/bootstrapper"
"k8s.io/minikube/pkg/minikube/bootstrapper/bsutil"
"k8s.io/minikube/pkg/minikube/bootstrapper/bsutil/kverify"
......@@ -69,7 +70,7 @@ func NewBootstrapper(api libmachine.API) (*Bootstrapper, error) {
// UpdateCluster updates the cluster
func (k *Bootstrapper) UpdateCluster(cfg config.MachineConfig) error {
images, err := images.KIC(cfg.KubernetesConfig.ImageRepository, cfg.KubernetesConfig.KubernetesVersion)
images, err := images.Kubeadm(cfg.KubernetesConfig.ImageRepository, cfg.KubernetesConfig.KubernetesVersion)
if err != nil {
return errors.Wrap(err, "kic images")
}
......@@ -114,10 +115,9 @@ func (k *Bootstrapper) UpdateCluster(cfg config.MachineConfig) error {
files := bsutil.ConfigFileAssets(cfg.KubernetesConfig, kubeadmCfg, kubeletCfg, kubeletService, cniFile)
// TODO: add addons for kic later
// if err := bsutil.AddAddons(&files, assets.GenerateTemplateData(cfg.KubernetesConfig)); err != nil {
// return errors.Wrap(err, "adding addons")
// }
if err := bsutil.AddAddons(&files, assets.GenerateTemplateData(cfg.KubernetesConfig)); err != nil {
return errors.Wrap(err, "adding addons")
}
for _, f := range files {
if err := k.c.Copy(f); err != nil {
......
......@@ -29,7 +29,6 @@ import (
func TestGuestEnvironment(t *testing.T) {
MaybeParallel(t)
profile := UniqueProfileName("guest")
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute)
defer CleanupWithLogs(t, profile, cancel)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册