Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Conversation

@crosbymichael
Copy link
Contributor

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 [email protected]

@crosbymichael
Copy link
Contributor Author

@LK4D4 please review this new UI

@crosbymichael
Copy link
Contributor Author

@LK4D4 @vmarmol do you think the Names for the namespaces should be consts to enforce types and values?

@LK4D4
Copy link
Contributor

LK4D4 commented Dec 17, 2014

I like consts.

config.go Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

How about SetPath just sets the path or updates it? Add could check for existence.

@vmarmol
Copy link
Contributor

vmarmol commented Dec 17, 2014

+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 <[email protected]>
Signed-off-by: Michael Crosby <[email protected]>
@crosbymichael
Copy link
Contributor Author

@LK4D4 @vmarmol I updated to use types for the ns consts

Copy link
Contributor

Choose a reason for hiding this comment

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

"Contains" as a wrapper to do this check?

@vmarmol
Copy link
Contributor

vmarmol commented Dec 17, 2014

LGTM, outside of the "Contains" wrapper which sounds like a good idea.

@vmarmol
Copy link
Contributor

vmarmol commented Dec 17, 2014

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.

@crosbymichael
Copy link
Contributor Author

@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?

@vmarmol
Copy link
Contributor

vmarmol commented Dec 18, 2014

It is definitely more extensible. As long as we can handle the change in Docker, we should be fine.

@LK4D4
Copy link
Contributor

LK4D4 commented Dec 23, 2014

@vmarmol @rjnagal can we merge this? Or maybe you want me to care this PR to add Contains?

@rjnagal
Copy link
Contributor

rjnagal commented Dec 23, 2014

LGTM. Let's get this in and we can add Contains as a separate PR.

@rjnagal
Copy link
Contributor

rjnagal commented Dec 23, 2014

Actually, there is no use of index other than to check Contains(). Can we do that in the same PR then :)

@LK4D4
Copy link
Contributor

LK4D4 commented Dec 23, 2014

@rjnagal I'll prepare PR little later, Michael now on vacation.

@mrunalp
Copy link
Contributor

mrunalp commented Dec 23, 2014

Yep, please add Contains if you can :)

@mrunalp mrunalp closed this in #312 Dec 23, 2014
mrunalp pushed a commit that referenced this pull request Dec 23, 2014
Add type for namespaces for better UI (replacement of #302)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants