Skip to content
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

Do not use JSON for router configuration #72

Merged
merged 3 commits into from
Jan 5, 2016
Merged

Do not use JSON for router configuration #72

merged 3 commits into from
Jan 5, 2016

Conversation

krancour
Copy link
Contributor

Fixes #63

This is WIP. There are more commits to come as part of this PR.

@krancour
Copy link
Contributor Author

Still need to test this against deis/workflow#197

@krancour
Copy link
Contributor Author

Ok. Took some doing because of unrelated issues I ran into, but this works fine in conjunction with deis/workflow#197.

@krancour krancour changed the title [WIP] Do not use JSON for router configuration Do not use JSON for router configuration Dec 31, 2015
@krancour
Copy link
Contributor Author

Requesting one of the reviews to be from @helgi since he's well familiar with what I'm out to achieve with this PR.

Domain string `json:"domain"`
UseProxyProtocol bool `json:"useProxyProtocol"`
EnforceWhitelists bool `json:"enforceWhitelists"`
WorkerProcesses string `router:"workerProcesses"`
Copy link
Member

Choose a reason for hiding this comment

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

Can you make this tag deis-router instead of just router? My hope is that it'll reduce the probability for collisions later

Copy link
Member

Choose a reason for hiding this comment

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

same with the below tags

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not clear on what collisions you think might occur. Can you elaborate, please? From my point of view, concerns from other components aren't going to magically affect the router's own internal model and have conflicts with how it has chosen to annotate struct fields.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should be noted that router in the struct tags is in no way tied to the annotation keys in the manifests. And the latter are namespaced nicely like router.deis.io/whatever to avoid conflicts.

Copy link
Member

Choose a reason for hiding this comment

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

Just talking about the struct tags, and it's mostly a paranoid thing from me. If other code decides to use a router struct tag, there's the conflict. And since this is an exported type, it could be used elsewhere as well.

However, given this is a router project, you're right that it's probably unlikely that there'll be a collision, so I wouldn't say it's blocking for this PR.

@arschles
Copy link
Member

arschles commented Jan 4, 2016

@krancour code LGTM, I haven't tested in a cluster though. Let me know if you'd like me to

@arschles arschles added the LGTM1 label Jan 4, 2016
@krancour
Copy link
Contributor Author

krancour commented Jan 4, 2016

@arschles fyi... I am still working on exporting error types as you've suggested. Doing so actually is allowing me to make a number of optimizations to the tests as well. Stay tuned.

@arschles
Copy link
Member

arschles commented Jan 4, 2016

sounds good @krancour. let me know if you'd like more reviews after your changes!

@krancour
Copy link
Contributor Author

krancour commented Jan 4, 2016

@arschles error types are exported and docstring'ed now.

return &Modeler{prefix: prefix, tag: tag}
}

// MapToModel populates the provided model with values from the provided map.
Copy link
Member

Choose a reason for hiding this comment

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

would be nice to have some docs here on some of the errors to expect. not blocking for this PR, however

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will come back to that if/when we extract this "modeler" from the router.

Copy link
Member

Choose a reason for hiding this comment

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

sounds good

@arschles
Copy link
Member

arschles commented Jan 4, 2016

@krancour awesome, thanks. made a few more comments on the new code

krancour added a commit that referenced this pull request Jan 5, 2016
Do not use JSON for router configuration
@krancour krancour merged commit f6e45ed into deis:master Jan 5, 2016
@krancour krancour deleted the no-more-json branch February 3, 2016 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants