-
Notifications
You must be signed in to change notification settings - Fork 344
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
Change CRD to use lower camel case #87
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.
I'm surprised that there are only a few changes required for this! It's better than I thought :-) I have only one small minor request, LGTM otherwise.
Reviewed 10 of 10 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @objectiser)
pkg/controller/controller.go, line 26 at r1 (raw file):
logrus.Debugf("Jaeger strategy: %s", jaeger.Spec.Strategy) if jaeger.Spec.Strategy == "allInOne" {
Perhaps we could have another conditional here, setting the strategy to allInOne
if it's all-in-one
? This way, we don't break current CRs using strategy=all-on-one
. We could possibly log a WARN, stating that all-in-one
is deprecated in favor of allInOne
.
Codecov Report
@@ Coverage Diff @@
## master #87 +/- ##
==========================================
+ Coverage 99.35% 99.35% +<.01%
==========================================
Files 18 18
Lines 773 776 +3
==========================================
+ Hits 768 771 +3
Misses 5 5
Continue to review full report at Codecov.
|
Looks like the coverage went down. Would you mind checking what's missing? |
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.
Just a small typo on the new test, otherwise. One thing we could do to not break compatibility with older CRs is to duplicate the spec entries for CassandraCreateSchema
and AllInOne
.
I'm not sure it's worth at this point, but it's something else to consider in the future (apart from creating a new spec version, like v1alpha2
)
Reviewed 1 of 1 files at r2, 2 of 2 files at r3.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @objectiser)
pkg/controller/controller.go, line 26 at r1 (raw file):
Previously, jpkrohling (Juraci Paixão Kröhling) wrote…
Perhaps we could have another conditional here, setting the strategy to
allInOne
if it'sall-in-one
? This way, we don't break current CRs usingstrategy=all-on-one
. We could possibly log a WARN, stating thatall-in-one
is deprecated in favor ofallInOne
.
Done, thanks!
pkg/controller/controller_test.go, line 100 at r3 (raw file):
} func TestDreprecatedAllInOneStrategy(t *testing.T) {
s/Dreprecated/Deprecated
Signed-off-by: Gary Brown <[email protected]>
Signed-off-by: Gary Brown <[email protected]>
Signed-off-by: Gary Brown <[email protected]>
Signed-off-by: Gary Brown <[email protected]>
Signed-off-by: Gary Brown <[email protected]>
Signed-off-by: Gary Brown <[email protected]>
@jpkrohling Agree. We need to decide when the operator is stable enough to start maintaining backward compatibility and using spec version to make significant changes. We should also do a release soon and document the breaking changes. |
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.
Sorry for the last minute change, but I think I found a possible bug that would be introduced by this change involving ToLower
.
Reviewed 4 of 4 files at r4.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @objectiser)
pkg/controller/controller.go, line 23 at r4 (raw file):
// NewController build a new controller object for the given spec func NewController(ctx context.Context, jaeger *v1alpha1.Jaeger) Controller { if jaeger.Spec.Strategy == "all-in-one" {
nit: strings.ToLower(jaeger.Spec.Strategy)
pkg/controller/controller.go, line 70 at r4 (raw file):
// check for incompatible options // if the storage is `memory`, then the only possible strategy is `all-in-one` if strings.ToLower(jaeger.Spec.Storage.Type) == "memory" && strings.ToLower(jaeger.Spec.Strategy) != "allInOne" {
I missed this before: the second part will never match, as the right-hand side comparison is lowering the case for the strategy but uses upper case in the constant. In other words, ToLower("allInOne")
will never be equal to "allInOne".
I guess we need a new test :)
pkg/controller/controller_test.go, line 100 at r3 (raw file):
Previously, jpkrohling (Juraci Paixão Kröhling) wrote…
s/Dreprecated/Deprecated
Thanks!
Signed-off-by: Gary Brown <[email protected]>
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.
Reviewed 2 of 2 files at r5.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @objectiser)
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.
Reviewable status: complete! all files reviewed, all discussions resolved
Changed
all-in-one
key (and strategy value) to useallInOne
.Changed
cassandra-create-schema
to becassandraCreateSchema
.Signed-off-by: Gary Brown [email protected]