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