Skip to content

Commit

Permalink
localkube changes
Browse files Browse the repository at this point in the history
  • Loading branch information
r2d4 committed Oct 13, 2017
1 parent e5002af commit 901c844
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/service_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/olekukonko/tablewriter"
"github.com/spf13/cobra"
"k8s.io/kubernetes/pkg/api/v1"
"k8s.io/api/core/v1"

"k8s.io/minikube/pkg/minikube/machine"
"k8s.io/minikube/pkg/minikube/service"
Expand Down
5 changes: 4 additions & 1 deletion pkg/localkube/kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ func (lk LocalkubeServer) NewKubeletServer() Server {
}

func StartKubeletServer(lk LocalkubeServer) func() error {
config := options.NewKubeletServer()
config, err := options.NewKubeletServer()
if err != nil {
return func() error { return err }
}

// Master details
config.KubeConfig = flag.NewStringFlag(util.DefaultKubeConfigPath)
Expand Down
15 changes: 2 additions & 13 deletions pkg/localkube/storage_provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ import (
"fmt"
"os"
"path"
"time"

"github.com/golang/glog"
"github.com/pkg/errors"
"github.com/r2d4/external-storage/lib/controller"
"github.com/r2d4/external-storage/lib/leaderelection"
"k8s.io/api/core/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
Expand All @@ -36,16 +34,7 @@ import (
"k8s.io/minikube/pkg/util"
)

const (
resyncPeriod = 15 * time.Second
provisionerName = "k8s.io/minikube-hostpath"
exponentialBackOffOnError = false
failedRetryThreshold = 5
leasePeriod = leaderelection.DefaultLeaseDuration
retryPeriod = leaderelection.DefaultRetryPeriod
renewDeadline = leaderelection.DefaultRenewDeadline
termLimit = leaderelection.DefaultTermLimit
)
const provisionerName = "k8s.io/minikube-hostpath"

type hostPathProvisioner struct {
// The directory to create PV-backing directories in
Expand Down Expand Up @@ -150,7 +139,7 @@ func StartStorageProvisioner(lk LocalkubeServer) func() error {

// Start the provision controller which will dynamically provision hostPath
// PVs
pc := controller.NewProvisionController(clientset, resyncPeriod, provisionerName, hostPathProvisioner, serverVersion.GitVersion, exponentialBackOffOnError, failedRetryThreshold, leasePeriod, renewDeadline, retryPeriod, termLimit)
pc := controller.NewProvisionController(clientset, provisionerName, hostPathProvisioner, serverVersion.GitVersion)

pc.Run(wait.NeverStop)
return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func NewPodStore(c kubernetes.Interface, namespace string, label labels.Selector
store := cache.NewStore(cache.MetaNamespaceKeyFunc)
stopCh := make(chan struct{})
reflector := cache.NewReflector(lw, &v1.Pod{}, store, 0)
reflector.RunUntil(stopCh)
go reflector.Run(stopCh)
return &PodStore{Store: store, stopCh: stopCh, Reflector: reflector}
}

Expand Down

0 comments on commit 901c844

Please sign in to comment.