Skip to content

Commit

Permalink
Merge pull request #25874 from simonswine/fix-flocker-restart-1.2
Browse files Browse the repository at this point in the history
Fix problems with container restarts and flocker (backport 1.2)
  • Loading branch information
roberthbailey committed Jul 13, 2016
2 parents bdbae4b + 121299e commit a58ef32
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions pkg/volume/flocker/plugin.go
Expand Up @@ -18,18 +18,16 @@ package flocker

import (
"fmt"
"path"
"time"

flockerclient "github.com/ClusterHQ/flocker-go"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/exec"
"k8s.io/kubernetes/pkg/util/mount"
"k8s.io/kubernetes/pkg/util/strings"
"k8s.io/kubernetes/pkg/volume"
volumeutil "k8s.io/kubernetes/pkg/volume/util"

flockerclient "github.com/ClusterHQ/flocker-go"
)

const (
Expand Down Expand Up @@ -147,15 +145,6 @@ func (b flockerBuilder) newFlockerClient() (*flockerclient.Client, error) {
return c, err
}

func (b *flockerBuilder) getMetaDir() string {
return path.Join(
b.plugin.host.GetPodPluginDir(
b.flocker.pod.UID, strings.EscapeQualifiedNameForDisk(flockerPluginName),
),
b.datasetName,
)
}

/*
SetUpAt will setup a Flocker volume following this flow of calls to the Flocker
control service:
Expand All @@ -168,10 +157,6 @@ control service:
5. Wait until the Primary UUID was updated or timeout.
*/
func (b flockerBuilder) SetUpAt(dir string, fsGroup *int64) error {
if volumeutil.IsReady(b.getMetaDir()) {
return nil
}

if b.client == nil {
c, err := b.newFlockerClient()
if err != nil {
Expand Down Expand Up @@ -208,7 +193,6 @@ func (b flockerBuilder) SetUpAt(dir string, fsGroup *int64) error {
b.flocker.path = s.Path
}

volumeutil.SetReady(b.getMetaDir())
return nil
}

Expand Down

0 comments on commit a58ef32

Please sign in to comment.