Skip to content

Commit

Permalink
Fix problems with container restarts and flocker
Browse files Browse the repository at this point in the history
* Removes meta dir, which prevents to detection of the correct mount
  path

* Fixes #22436
  • Loading branch information
simonswine committed Jul 8, 2016
1 parent 4add74f commit 121299e
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 121299e

Please sign in to comment.