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

api: name attachment field according to surrounding style #2385

Merged
merged 1 commit into from
Sep 26, 2017

Conversation

stevvooe
Copy link
Contributor

Rather than invent style conventions, we should follow what has been
done before. This removes the unnecessary "lb" from the attachments
field. Network attachements are a general concept, not for specific use
cases. If we need to identify different attachments, we should tag the
attachement itself, rather than label fields. This will ensure that we
can grow without introducing xxx_attachements fields for each new use
case.

This was requested in review but seems to have been dropped.

Signed-off-by: Stephen J Day stephen.day@docker.com

@stevvooe
Copy link
Contributor Author

Addresses some missed areas from #2363.

@codecov
Copy link

codecov bot commented Sep 22, 2017

Codecov Report

Merging #2385 into master will decrease coverage by 5.5%.
The diff coverage is 61.11%.

@@            Coverage Diff             @@
##           master    #2385      +/-   ##
==========================================
- Coverage   66.04%   60.53%   -5.51%     
==========================================
  Files          80      128      +48     
  Lines       14583    26260   +11677     
==========================================
+ Hits         9631    15897    +6266     
- Misses       4163     8959    +4796     
- Partials      789     1404     +615

@@ -87,8 +87,8 @@ type NetworkAllocator interface {
// DeallocateLBAttachment Deallocates a load balancer endpoint for the node
DeallocateLBAttachment(node *api.Node, networkAttachment *api.NetworkAttachment) error
Copy link
Contributor

Choose a reason for hiding this comment

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

Is leaving this and the AllocateLB just above deliberate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope. I'll hunt these down.

@pradipd
Copy link
Contributor

pradipd commented Sep 22, 2017

Sorry for missing this feedback in the original review.
Will make the changes requested in moby/moby#34674

@stevvooe
Copy link
Contributor Author

@pradipd No worries. I blame github's review feature.

@stevvooe stevvooe force-pushed the remove-unnecessary-field-naming branch from 65d486d to 99c00a1 Compare September 22, 2017 17:23

//IsLBAttachmentAllocated If lb endpoint is allocated on the node
IsLBAttachmentAllocated(node *api.Node, networkAttachment *api.NetworkAttachment) bool
//IsAttachmentAllocated If lb endpoint is allocated on the node
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a space between // and the comment?

Rather than invent style conventions, we should follow what has been
done before. This removes the unnecessary "lb" from the `attachments`
field. Network attachements are a general concept, not for specific use
cases. If we need to identify different attachments, we should tag the
attachement itself, rather than label fields. This will ensure that we
can grow without introducing `xxx_attachements` fields for each new use
case.

This was requested in review but seems to have been dropped.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
@stevvooe stevvooe force-pushed the remove-unnecessary-field-naming branch from 99c00a1 to a3eac73 Compare September 26, 2017 18:16
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM (not a maintainer here)

@dperny
Copy link
Collaborator

dperny commented Sep 26, 2017

LGTM

@dperny dperny merged commit 941a018 into moby:master Sep 26, 2017
@stevvooe stevvooe deleted the remove-unnecessary-field-naming branch September 26, 2017 19:02
pradipd added a commit to pradipd/moby that referenced this pull request Sep 26, 2017
…t#2385

Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
andrewhsu pushed a commit to docker-archive/docker-ce that referenced this pull request Sep 28, 2017
…t#2385

Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
Upstream-commit: d00a07b
Component: engine
salah-khan pushed a commit to salah-khan/moby that referenced this pull request Nov 15, 2017
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.

7 participants