diff --git a/deploy/chart/Chart.yaml b/deploy/chart/Chart.yaml index 59f96aa99..98bf3d995 100644 --- a/deploy/chart/Chart.yaml +++ b/deploy/chart/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 description: Use HostPath for persistent local storage with Kubernetes name: local-path-provisioner -version: 0.0.18 -appVersion: "v0.0.18" +version: 0.0.19 +appVersion: "v0.0.19" keywords: - storage - hostpath diff --git a/deploy/chart/README.md b/deploy/chart/README.md index 03235f011..b5e110fbd 100644 --- a/deploy/chart/README.md +++ b/deploy/chart/README.md @@ -56,7 +56,7 @@ default values. | Parameter | Description | Default | | ----------------------------------- | ------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | | `image.repository` | Local Path Provisioner image name | `rancher/local-path-provisioner` | -| `image.tag` | Local Path Provisioner image tag | `v0.0.18` | +| `image.tag` | Local Path Provisioner image tag | `v0.0.19` | | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `storageClass.create` | If true, create a `StorageClass` | `true` | | `storageClass.provisionerName` | The provisioner name for the storage class | `nil` | diff --git a/deploy/chart/values.yaml b/deploy/chart/values.yaml index a19bcd220..5d3a8f10c 100644 --- a/deploy/chart/values.yaml +++ b/deploy/chart/values.yaml @@ -4,7 +4,7 @@ replicaCount: 1 image: repository: rancher/local-path-provisioner - tag: v0.0.18 + tag: v0.0.19 pullPolicy: IfNotPresent helperImage: diff --git a/deploy/local-path-storage.yaml b/deploy/local-path-storage.yaml index 18434c910..dc174ad07 100644 --- a/deploy/local-path-storage.yaml +++ b/deploy/local-path-storage.yaml @@ -58,7 +58,7 @@ spec: serviceAccountName: local-path-provisioner-service-account containers: - name: local-path-provisioner - image: rancher/local-path-provisioner:v0.0.18 + image: rancher/local-path-provisioner:v0.0.19 imagePullPolicy: IfNotPresent command: - local-path-provisioner diff --git a/deploy/provisioner.yaml b/deploy/provisioner.yaml index a6a1adf0d..1f6947835 100644 --- a/deploy/provisioner.yaml +++ b/deploy/provisioner.yaml @@ -16,7 +16,7 @@ spec: serviceAccountName: local-path-provisioner-service-account containers: - name: local-path-provisioner - image: rancher/local-path-provisioner:v0.0.18 + image: rancher/local-path-provisioner:v0.0.19 imagePullPolicy: Always command: - local-path-provisioner diff --git a/main.go b/main.go index 85683f680..700fdc00f 100644 --- a/main.go +++ b/main.go @@ -213,7 +213,7 @@ func startDaemon(c *cli.Context) error { if helperPodFile == "" { helperPodYaml, err = findConfigFileFromConfigMap(kubeClient, namespace, configMapName, DefaultHelperPodFile) if err != nil { - return fmt.Errorf("invalid empty flag %v and it also does not exist at ConfigMap %v/%v with err: %v", FlagConfigFile, namespace, configMapName, err) + return fmt.Errorf("invalid empty flag %v and it also does not exist at ConfigMap %v/%v with err: %v", FlagHelperPodFile, namespace, configMapName, err) } } else { helperPodYaml, err = loadFile(helperPodFile) diff --git a/provisioner.go b/provisioner.go index 4b08d9618..84f8f802f 100644 --- a/provisioner.go +++ b/provisioner.go @@ -37,6 +37,8 @@ var ( CmdTimeoutCounts = 120 ConfigFileCheckInterval = 30 * time.Second + + HelperPodNameMaxLength = 128 ) type LocalPathProvisioner struct { @@ -386,6 +388,12 @@ func (p *LocalPathProvisioner) createHelperPod(action ActionType, cmdsForPath [] } helperPod := p.helperPod.DeepCopy() + // use different name for helper pods + // /~https://github.com/rancher/local-path-provisioner/issues/154 + 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