This repository has been archived by the owner on Sep 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 82
Consistent contructor #91
Comments
This was referenced Jan 10, 2018
If there's no desire to do more, at least all parameters need to be optional! Also, documentation should recommend the usage of named parameters instead of unreadable positional ones! There's a related PR by @bryanl: ksonnet/ksonnet#267 |
Adding |
@nikolay we're currently working through the proposal right now. We should have a course by the EOD tomorrow. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Rather than have multiple parameters in the constructors, prefer to have a single (or no param) constructor.
Currently the constructors take a variable number of parameters, and it's hard to know what's required. For example:
Deployment - new(name, replicas, containers, podLabels={app: name})
Service - new(name, selector, ports)
Some of these params are text, some are other objects. It's unclear from the definition. To make it more confusing, there's also builder methods like "withContainers", which presumably provide same functionality.
Suggestion:
Have a consistent constructor (single name param for named objects, else no param constructor):
local mydep = deployment.new("frontend")
.withReplicas(2)
.withContainers(...);
The text was updated successfully, but these errors were encountered: