Add type for namespaces for better UI#302
Add type for namespaces for better UI#302crosbymichael wants to merge 2 commits intodocker-archive:masterfrom
Conversation
|
@LK4D4 please review this new UI |
|
I like consts. |
config.go
Outdated
There was a problem hiding this comment.
I think this probably should be Add and current Add should be private or removed. I don't see case when I don't want to check for existing namespace on Add.
There was a problem hiding this comment.
How about SetPath just sets the path or updates it? Add could check for existence.
|
+1 to names being consts. |
This adds `type Namespaces []Namespace` so that methods can be added to this slice so that it is easier for consumers to work with the values. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
8d6d674 to
2329014
Compare
There was a problem hiding this comment.
"Contains" as a wrapper to do this check?
|
LGTM, outside of the "Contains" wrapper which sounds like a good idea. |
|
btw, the change of the type of Namespace broke backwards compatibility (newer libcontainers being able to understand the config of older libcontainers). We've worked around it in cAdvisor, but Docker may be affected too when we update the version of libcontainer. |
|
@vmarmol yes, that is true. Hopefully we will not have to make the change again and this will be a more robust structure that will allow for changes without breaking compat. Do you still think it's the right thing to do? |
|
It is definitely more extensible. As long as we can handle the change in Docker, we should be fine. |
|
LGTM. Let's get this in and we can add Contains as a separate PR. |
|
Actually, there is no use of index other than to check Contains(). Can we do that in the same PR then :) |
|
@rjnagal I'll prepare PR little later, Michael now on vacation. |
|
Yep, please add Contains if you can :) |
Add type for namespaces for better UI (replacement of #302)
This adds
type Namespaces []Namespaceso that methods can be added tothis slice so that it is easier for consumers to work with the values.
Signed-off-by: Michael Crosby crosbymichael@gmail.com