Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

run_on is a top level field, not part of config #38

Merged
merged 1 commit into from
Jan 16, 2019

Conversation

james-callahan
Copy link
Contributor

Fix #34

I'm trying to figure out if we need migrations for this and how to write them.

@james-callahan james-callahan added the bug Something isn't working label Jan 14, 2019
@@ -3,10 +3,10 @@ local typedefs = require "kong.db.schema.typedefs"
return {
name = "zipkin",
fields = {
{ run_on = typedefs.run_on { default = "all" } },

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original code included one_of = { "all" }, to force that only "all" would be valid for this plugin. Was this removed deliberately?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. There's no reason to disallow someone logging to zipkin from only one side.

Copy link

@hishamhm hishamhm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I think it's not worth it to write a migration here. The change here modifies a default, but this is very low-impact: if a user tried to use this on a mesh scenario the inappropriate default would probably have been evident from the get-go.

Plus, more generally speaking, writing a migration to modify values given a change of default is not even correct: there's no way to know the default value hasn't been set by the user on purpose.

Of course, in this case if we want the old default to be now invalid (with the one_of annotation) it would make sense to force the change via migration — I guess that's why the one_of annotation was removed?

Given all that, I think it's fine to make the change as-is.

@james-callahan james-callahan merged commit dd123b5 into master Jan 16, 2019
@james-callahan james-callahan deleted the top-level-run_on branch January 16, 2019 03:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants