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

Begin systemizing files in pkg/registry #730

Merged
merged 1 commit into from Aug 1, 2014

Conversation

lavalamp
Copy link
Member

@lavalamp lavalamp commented Aug 1, 2014

Files that have RESTStorage implementations now end in "storage", and
files that have registries now end in "registry". I removed some
underscores in file names, since it seems to be go style not to have
them. I split minion_registry.go into two files.

We should consider splitting this package into two, to make more clear
the separation between the layers.

I added two comments but otherwise did not change any code.

Files that have RESTStorage implementations now end in "storage", and
files that have registries now end in "registry". I removed some
underscores in file names, since it seems to be go style not to have
them. I split minion_registry.go into two files.

We should consider splitting this package into two, to make more clear
the separation between the layers.
type ServiceRegistryStorage struct {
registry ServiceRegistry
cloud cloudprovider.Interface
machines MinionRegistry
}

// MakeServiceRegistryStorage makes a new ServiceRegistryStorage.
func MakeServiceRegistryStorage(registry ServiceRegistry, cloud cloudprovider.Interface, machines MinionRegistry) apiserver.RESTStorage {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a Go convention for New vs Make? I wasn't aware of Make being that common in the stdlib.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think there is a convention, and it is New. Make is reserved for maps and channels, everything else is new, and every package with a constructor that I'm aware of also uses New. We should change this. Not in this PR though.

@smarterclayton
Copy link
Contributor

As a follow on (here, or in a later change), it might be worth it to move each of the resources to their own package (storage and registry impls). Not much benefit to them being collocated. Ie pkg/registry/minion or just pkg/minion. There's really very little overlap in registry between the types. Then you could shorten to say minion.NewStorage(...)

@smarterclayton
Copy link
Contributor

LGTM besides incidental comments

@lavalamp
Copy link
Member Author

lavalamp commented Aug 1, 2014

I agree with that follow up.

smarterclayton added a commit that referenced this pull request Aug 1, 2014
Begin systemizing files in pkg/registry
@smarterclayton smarterclayton merged commit 8b2b325 into kubernetes:master Aug 1, 2014
@thockin
Copy link
Member

thockin commented Aug 2, 2014

is it really go style to have runtogetherfilenames that nobody can read ?

Can we please pretty please buck that trend?

On Fri, Aug 1, 2014 at 7:57 AM, Clayton Coleman notifications@github.com
wrote:

Merged #730 #730.

Reply to this email directly or view it on GitHub
#730 (comment)
.

@lavalamp
Copy link
Member Author

lavalamp commented Aug 2, 2014

I think the idea is that if you need multiple words, it's a clue that it's time to split your package. Indeed, this package should be split...

I couldn't bring myself to stick more than two words together. :) I actually don't care much about the underscores, the thing that was bothering me were the inaccurate suffixes (registry instead of storage).

@thockin
Copy link
Member

thockin commented Aug 2, 2014

I am fine with somewhat terse names, but the idea that every file can be a
single word is just ludicrous, and just leads to either stupid made up
names or jamming too much crap into single files.

I think we already suffer from the latter.
On Aug 1, 2014 9:38 PM, "Daniel Smith" notifications@github.com wrote:

I think the idea is that if you need multiple words, it's a clue that it's
time to split your package. Indeed, this package should be split...

I couldn't bring myself to stick more than two words together. :) I
actually don't care much about the underscores, the thing that was
bothering me were the inaccurate suffixes (registry instead of storage).

Reply to this email directly or view it on GitHub
#730 (comment)
.

vishh pushed a commit to vishh/kubernetes that referenced this pull request Apr 6, 2016
Add support for parsing CPU speed from /proc/cpuinfo on Power (ppc64) systems
@lavalamp lavalamp deleted the rename branch September 1, 2020 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants