Skip to content

api: name attachment field according to surrounding style#2385

Merged
dperny merged 1 commit intomoby:masterfrom
stevvooe:remove-unnecessary-field-naming
Sep 26, 2017
Merged

api: name attachment field according to surrounding style#2385
dperny merged 1 commit intomoby:masterfrom
stevvooe:remove-unnecessary-field-naming

Conversation

@stevvooe
Copy link
Copy Markdown
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 [email protected]

@stevvooe
Copy link
Copy Markdown
Contributor Author

Addresses some missed areas from #2363.

@codecov
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 <[email protected]>
@stevvooe stevvooe force-pushed the remove-unnecessary-field-naming branch from 99c00a1 to a3eac73 Compare September 26, 2017 18:16
Copy link
Copy Markdown
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
Copy Markdown
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
andrewhsu pushed a commit to docker-archive/docker-ce that referenced this pull request Sep 28, 2017
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