Skip to content

Commit

Permalink
fix mysqldatabase validator webhook (#870)
Browse files Browse the repository at this point in the history
Signed-off-by: TasdidurRahman tasdid@appscode.com
  • Loading branch information
TasdidurRahman committed Feb 18, 2022
1 parent 6be2000 commit 8c9cb4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apis/schema/v1alpha1/mysqldatabase_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func ValidateMySQLDatabaseUpdate(newobj *MySQLDatabase, oldobj *MySQLDatabase) e
}
}
if newobj.Spec.Init != nil && oldobj.Spec.Init != nil {
if !gocmp.Equal(newobj.Spec.Init, oldobj.Spec.Init) {
if !gocmp.Equal(newobj.Spec.Init.Script, oldobj.Spec.Init.Script) || !gocmp.Equal(newobj.Spec.Init.Snapshot, oldobj.Spec.Init.Snapshot) {
allErrs = append(allErrs, field.Invalid(field.NewPath("spec.init"), newobj.Name, "cannot change init"))
}
}
Expand Down

0 comments on commit 8c9cb4b

Please sign in to comment.