-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DEVOPS-28230 remove version validation #306
DEVOPS-28230 remove version validation #306
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some unsafe use of slices that will panic. Otherwise looks good
By("Reconciling the created resource") | ||
|
||
_, err := controllerReconciler.Reconcile(ctx, reconcile.Request{NamespacedName: typeNamespacedName}) | ||
Expect(err).To(MatchError(".spec.dbVersion is a mandatory field and cannot be empty")) | ||
Expect(err).NotTo(HaveOccurred()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably better to still have some sort of error here. I believe the idea of this set of tests is to verify dbclaims update and can be fixed by changing their values. What can we do to continue to simulate that error MajorVersion 12
? Invalid database type?
return false | ||
} | ||
return activeVersion != p.EngineVersion | ||
return strings.Split(activeVersion, ".")[0] != strings.Split(p.DBVersion, ".")[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unsafe use of indexing a slice. Maybe make a type, there's a lot of comparisons going around here
type Version struct {
Major, Minor string
}
v := Version{Major:"15", "Minor: "3"}
return cmp.Equal(v.Major, "15")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this works if the string is "", "15" or "15.2"
looks ugly, but works
If NEW Claim and DBVersion="" version 15 is used instead
If EXISTING Claim and DBVersion= "" then version from Status.ActiveDB is used