Skip to content

Commit

Permalink
add nil check for spec.DataStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
pb82 committed Dec 14, 2021
1 parent 84396f3 commit e1837f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/model/grafanaDataPvc.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func getPVCAnnotations(cr *v1alpha1.Grafana, existing map[string]string) map[str
}

func getStorageClass(cr *v1alpha1.Grafana) *string {
if cr.Spec.DataStorage.Class == "" {
if cr.Spec.DataStorage == nil || cr.Spec.DataStorage.Class == "" {
return nil
}

Expand Down

0 comments on commit e1837f7

Please sign in to comment.