From dc0c59238650e74e256519caf380b7d96261f932 Mon Sep 17 00:00:00 2001 From: Michelle Au Date: Mon, 22 May 2017 15:30:27 -0700 Subject: [PATCH] Fix storage node affinity helpers Kubernetes-commit: 5fcb82dde93429e443c77c8936e4412b9a936744 --- pkg/api/helper/helpers.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/api/helper/helpers.go b/pkg/api/helper/helpers.go index 3bce0e54b..068877d5e 100644 --- a/pkg/api/helper/helpers.go +++ b/pkg/api/helper/helpers.go @@ -590,6 +590,10 @@ func GetStorageNodeAffinityFromAnnotation(annotations map[string]string) (*api.N // Converts NodeAffinity type to Alpha annotation for use in PersistentVolumes // TODO: update when storage node affinity graduates to beta func StorageNodeAffinityToAlphaAnnotation(annotations map[string]string, affinity *api.NodeAffinity) error { + if affinity == nil { + return nil + } + json, err := json.Marshal(*affinity) if err != nil { return err