Skip to content

Commit b51b048

Browse files
committed
Check for map to not be nil
1 parent a8fc366 commit b51b048

File tree

1 file changed

+3
-0
lines changed
  • pkg/controller/mysqlcluster/internal/upgrades

1 file changed

+3
-0
lines changed

pkg/controller/mysqlcluster/internal/upgrades/upgrades.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ func (u *upgrader) ShouldUpdate() bool {
142142
}
143143

144144
func (u *upgrader) markUpgradeComplete() error {
145+
if u.cluster.Annotations == nil {
146+
u.cluster.Annotations = make(map[string]string)
147+
}
145148
u.cluster.Annotations[VersionAnnotation] = strconv.Itoa(u.version)
146149
err := u.client.Update(context.TODO(), u.cluster.Unwrap())
147150
if err != nil {

0 commit comments

Comments
 (0)