Skip to content

Commit

Permalink
Use PV name as the suffix for the helper pod name
Browse files Browse the repository at this point in the history
Also adds the `action` part as we did in the previous releases.

Signed-off-by: Sheng Yang <[email protected]>
  • Loading branch information
yasker committed Nov 19, 2020
1 parent 248707e commit 0f16ca1
Show file tree
Hide file tree
Showing 11 changed files with 6 additions and 799 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ require (
github.com/miekg/dns v1.1.27 // indirect
github.com/pkg/errors v0.8.1
github.com/prometheus/client_golang v1.1.0 // indirect
github.com/satori/go.uuid v1.2.0
github.com/urfave/cli v1.19.1
golang.org/x/sys v0.0.0-20190926180325-855e68c8590b // indirect
golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,6 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.3 h1:CTwfnzjQ+8dS6MhHHu4YswVAD99sL2wjPqP+VkURmKE=
github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff h1:VARhShG49tiji6mdRNp7JTNDtJ0FhuprF93GBQ37xGU=
Expand Down
8 changes: 6 additions & 2 deletions provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (

"github.com/Sirupsen/logrus"
"github.com/pkg/errors"
uuid "github.com/satori/go.uuid"
v1 "k8s.io/api/core/v1"
k8serror "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -38,6 +37,8 @@ var (
CmdTimeoutCounts = 120

ConfigFileCheckInterval = 30 * time.Second

HelperPodNameMaxLength = 128
)

type LocalPathProvisioner struct {
Expand Down Expand Up @@ -389,7 +390,10 @@ func (p *LocalPathProvisioner) createHelperPod(action ActionType, cmdsForPath []

// use different name for helper pods
// https://github.com/rancher/local-path-provisioner/issues/154
helperPod.Name = helperPod.Name + "-" + uuid.NewV4().String()[:8]
helperPod.Name = (helperPod.Name + "-" + string(action) + "-" + name)
if len(helperPod.Name) > HelperPodNameMaxLength {
helperPod.Name = helperPod.Name[:HelperPodNameMaxLength]
}
helperPod.Namespace = p.namespace
helperPod.Spec.NodeName = node
helperPod.Spec.ServiceAccountName = p.serviceAccountName
Expand Down
23 changes: 0 additions & 23 deletions vendor/github.com/satori/go.uuid/.travis.yml

This file was deleted.

20 changes: 0 additions & 20 deletions vendor/github.com/satori/go.uuid/LICENSE

This file was deleted.

65 changes: 0 additions & 65 deletions vendor/github.com/satori/go.uuid/README.md

This file was deleted.

206 changes: 0 additions & 206 deletions vendor/github.com/satori/go.uuid/codec.go

This file was deleted.

Loading

0 comments on commit 0f16ca1

Please sign in to comment.