Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Added case for lowercase protocol #564

Merged
merged 1 commit into from
Jan 8, 2018

Conversation

piyush-garg
Copy link
Collaborator

This will accept if someone specifies protocol as
tcp or Tcp or tCp. Likewise UDP also
Always return the protocol as Uppercase
Added test for two cases
#560

@pradeepto
Copy link
Member

Thank you @piyush1594 for fixing issues in the Open Source spirit.

Copy link
Member

@kadel kadel left a comment

Choose a reason for hiding this comment

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

Small one small nitpick.

But otherwise, this looks good.

Big 👍 for @piyush1594 for adding tests.

@@ -669,9 +669,10 @@ func parsePortMapping(pm string) (*api_v1.ServicePort, error) {
// Case 3 - port/protocol
// Case 4 - port:targetPort/protocol
case 2:
switch api_v1.Protocol(protocolSplit[1]) {
protocol_uppercase := strings.ToUpper(protocolSplit[1])
Copy link
Member

Choose a reason for hiding this comment

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

just one small nitpick 😇

protocolUpperCase

Go formatting style prefers camelCase names.
Yes, I know we have other variables with an underscore like api_v1 😄 , but that is a special case.
Normal variables should be camelCase

@cdrage
Copy link
Collaborator

cdrage commented Jan 8, 2018

Code LGTM. Same as @kadel just change to camelCase and let's merge 👍

@surajnarwade
Copy link
Collaborator

LGTM (after camelCase)

This will accept if someone specifies protocol as
tcp or Tcp or tCp. Likewise UDP also
Always return the protocol as Uppercase
Added test for two cases

changed variable name to CamelCase
@piyush-garg
Copy link
Collaborator Author

Changes requested by you are done. Please take a look.

Thanks, @pradeepto @kadel @cdrage @surajnarwade

@cdrage
Copy link
Collaborator

cdrage commented Jan 8, 2018

LGTM! Thank you 👍

@cdrage cdrage merged commit 09080f0 into kedgeproject:master Jan 8, 2018
kadel pushed a commit to kadel/kedge that referenced this pull request Jan 15, 2018
This will accept if someone specifies protocol as
tcp or Tcp or tCp. Likewise UDP also
Always return the protocol as Uppercase
Added test for two cases

changed variable name to CamelCase
kadel pushed a commit to kadel/kedge that referenced this pull request Jan 17, 2018
This will accept if someone specifies protocol as
tcp or Tcp or tCp. Likewise UDP also
Always return the protocol as Uppercase
Added test for two cases

changed variable name to CamelCase
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.

None yet

5 participants