From 890878b469174337268bf4013b18c69e2ac53daa Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Wed, 8 Jan 2020 17:08:11 -0800 Subject: [PATCH] Fix unit tests and go tempalte block --- go.sum | 1 - pkg/minikube/bootstrapper/bsutil/ktmpl/v1alpha1.go | 4 ++-- pkg/minikube/bootstrapper/bsutil/ktmpl/v1alpha3.go | 4 ++-- pkg/minikube/bootstrapper/bsutil/ktmpl/v1beta1.go | 4 ++-- .../bootstrapper/bsutil/testdata/v1.11/image-repository.yaml | 1 + pkg/minikube/driver/driver_test.go | 2 +- site/.gitignore | 1 + 7 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 site/.gitignore diff --git a/go.sum b/go.sum index 842ba4081c..18712c10d4 100644 --- a/go.sum +++ b/go.sum @@ -724,7 +724,6 @@ k8s.io/klog v0.3.1 h1:RVgyDHY/kFKtLqh67NvEWIgkMneNoIrdkN0CxDSQc68= k8s.io/klog v0.3.1/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.3 h1:niceAagH1tzskmaie/icWd7ci1wbG7Bf2c6YGcQv+3c= k8s.io/klog v0.3.3/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 h1:TRb4wNWoBVrH9plmkp2q86FIDppkbrEXdXlxU3a3BMI= k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= k8s.io/kubernetes v1.15.2 h1:RO9EuRw5vlN3oa/lnmPxmywOoJRtg9o40KcklHXNIAQ= diff --git a/pkg/minikube/bootstrapper/bsutil/ktmpl/v1alpha1.go b/pkg/minikube/bootstrapper/bsutil/ktmpl/v1alpha1.go index f0443c24e2..7582b8bce7 100644 --- a/pkg/minikube/bootstrapper/bsutil/ktmpl/v1alpha1.go +++ b/pkg/minikube/bootstrapper/bsutil/ktmpl/v1alpha1.go @@ -31,8 +31,8 @@ api: kubernetesVersion: {{.KubernetesVersion}} certificatesDir: {{.CertDir}} networking: - serviceSubnet: {{.ServiceCIDR}} - podSubnet: {{if .PodSubnet}}{{.PodSubnet}}{{else}}""{{end}} + serviceSubnet: {{.ServiceCIDR}}{{if ne .PodSubnet ""}} + podSubnet: {{.PodSubnet}}{{end}} etcd: dataDir: {{.EtcdDataDir}} nodeName: {{.NodeName}} diff --git a/pkg/minikube/bootstrapper/bsutil/ktmpl/v1alpha3.go b/pkg/minikube/bootstrapper/bsutil/ktmpl/v1alpha3.go index ca3e4b80a1..aafccb7b7e 100644 --- a/pkg/minikube/bootstrapper/bsutil/ktmpl/v1alpha3.go +++ b/pkg/minikube/bootstrapper/bsutil/ktmpl/v1alpha3.go @@ -56,8 +56,8 @@ etcd: dataDir: {{.EtcdDataDir}} kubernetesVersion: {{.KubernetesVersion}} networking: - dnsDomain: {{if .DNSDomain}}{{.DNSDomain}}{{else}}cluster.local{{end}} - podSubnet: {{if .PodSubnet}}{{.PodSubnet}}{{else}}""{{end}} + dnsDomain: {{if .DNSDomain}}{{.DNSDomain}}{{else}}cluster.local{{end}}{{if ne .PodSubnet ""}} + podSubnet: {{.PodSubnet}}{{end}} serviceSubnet: {{.ServiceCIDR}} --- apiVersion: kubelet.config.k8s.io/v1beta1 diff --git a/pkg/minikube/bootstrapper/bsutil/ktmpl/v1beta1.go b/pkg/minikube/bootstrapper/bsutil/ktmpl/v1beta1.go index 8e6f7b28b9..c8d638be42 100644 --- a/pkg/minikube/bootstrapper/bsutil/ktmpl/v1beta1.go +++ b/pkg/minikube/bootstrapper/bsutil/ktmpl/v1beta1.go @@ -60,8 +60,8 @@ etcd: dataDir: {{.EtcdDataDir}} kubernetesVersion: {{.KubernetesVersion}} networking: - dnsDomain: {{if .DNSDomain}}{{.DNSDomain}}{{else}}cluster.local{{end}} - podSubnet: {{if .PodSubnet}}{{.PodSubnet}}{{else}}""{{end}} + dnsDomain: {{if .DNSDomain}}{{.DNSDomain}}{{else}}cluster.local{{end}}{{if ne .PodSubnet ""}} + podSubnet: {{.PodSubnet}}{{end}} serviceSubnet: {{.ServiceCIDR}} --- apiVersion: kubelet.config.k8s.io/v1beta1 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.11/image-repository.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.11/image-repository.yaml index 5e121b085d..6e08604263 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.11/image-repository.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.11/image-repository.yaml @@ -12,6 +12,7 @@ networking: etcd: dataDir: /var/lib/minikube/etcd nodeName: mk +apiServerCertSANs: ["127.0.0.1", "localhost", "1.1.1.1"] imageRepository: test/repo apiServerExtraArgs: enable-admission-plugins: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota" diff --git a/pkg/minikube/driver/driver_test.go b/pkg/minikube/driver/driver_test.go index 7f07f9d62e..5aad1274b4 100644 --- a/pkg/minikube/driver/driver_test.go +++ b/pkg/minikube/driver/driver_test.go @@ -72,7 +72,7 @@ func TestFlagDefaults(t *testing.T) { expected = FlagHints{ CacheImages: false, - ExtraOptions: fmt.Sprintf("kubelet.resolv-conf=%s", tf.Name()), + ExtraOptions: []string{fmt.Sprintf("kubelet.resolv-conf=%s", tf.Name())}, } systemdResolvConf = tf.Name() if diff := cmp.Diff(FlagDefaults(None), expected); diff != "" { diff --git a/site/.gitignore b/site/.gitignore new file mode 100644 index 0000000000..b512c09d47 --- /dev/null +++ b/site/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file