From 278ab0dfbd60406ec8db4838b2177704d5d6edd9 Mon Sep 17 00:00:00 2001 From: "osher.elmakaies" <osher.elmakaies@appsflyer.com> Date: Tue, 30 May 2023 19:30:47 +0300 Subject: [PATCH] fix: fixing annotation key to be const (cherry picked from commit 3a342254bbe29129ab81dc72d9cc850ad087aae4) --- provisioner.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/provisioner.go b/provisioner.go index da60891a..58af1556 100644 --- a/provisioner.go +++ b/provisioner.go @@ -48,6 +48,10 @@ const ( defaultVolumeType = "hostPath" ) +const ( + nodeNameAnnotationKey = "local.path.provisioner/selected-node" +) + var ( ConfigFileCheckInterval = 30 * time.Second @@ -343,7 +347,7 @@ func (p *LocalPathProvisioner) Provision(ctx context.Context, opts pvController. return &v1.PersistentVolume{ ObjectMeta: metav1.ObjectMeta{ Name: name, - Annotations: map[string]string{"local.path.provisioner/selected-node": nodeName}, + Annotations: map[string]string{nodeNameAnnotationKey: nodeName}, }, Spec: v1.PersistentVolumeSpec{ PersistentVolumeReclaimPolicy: *opts.StorageClass.ReclaimPolicy, -- GitLab