-
Notifications
You must be signed in to change notification settings - Fork 5
ENI support #15
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
ENI support #15
Conversation
e0adeae to
0b67e83
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
873fa10 to
bb21ac6
Compare
9f83df3 to
570a9ff
Compare
Signed-off-by: Sameer Shaikh <[email protected]> ENI support Signed-off-by: Sameer Shaikh <[email protected]> ENI support Signed-off-by: Sameer Shaikh <[email protected]> ENI support Signed-off-by: Sameer Shaikh <[email protected]> ENI support Signed-off-by: Sameer Shaikh <[email protected]> ENI support Signed-off-by: Sameer Shaikh <[email protected]> ENI support Signed-off-by: Sameer Shaikh <[email protected]> ENI support Signed-off-by: Sameer Shaikh <[email protected]> ENI support Signed-off-by: Sameer Shaikh <[email protected]> ENI support Signed-off-by: Sameer Shaikh <[email protected]> ENI support Signed-off-by: Sameer Shaikh <[email protected]> ENI support Signed-off-by: Sameer Shaikh <[email protected]> PrimaryIP support Signed-off-by: Sameer Shaikh <[email protected]> Review comments Signed-off-by: Sameer Shaikh <[email protected]> Review comments Signed-off-by: Sameer Shaikh <[email protected]> Review comments Signed-off-by: Sameer Shaikh <[email protected]> Review comments Signed-off-by: Sameer Shaikh <[email protected]> Review comments Signed-off-by: Sameer Shaikh <[email protected]> Review comments Signed-off-by: Sameer Shaikh <[email protected]> Review comments Signed-off-by: Sameer Shaikh <[email protected]> Review comments Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Rebase master Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Review Comments Signed-off-by: Sameer Shaikh <[email protected]> Adding support for GetSecurityGroupByName Signed-off-by: Sameer Shaikh <[email protected]> Adding support for GetSecurityGroupByName Signed-off-by: Sameer Shaikh <[email protected]> Adding support for GetSecurityGroupByName Signed-off-by: Sameer Shaikh <[email protected]> Adding support for GetSecurityGroupByName Signed-off-by: Sameer Shaikh <[email protected]> Adding support for GetSecurityGroupByName Signed-off-by: Sameer Shaikh <[email protected]> Adding support for GetSecurityGroupByName
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check if you can fix these issues of taking to another PR
Signed-off-by: Sameer Shaikh <[email protected]>
file/provider/get_subnet.go
Outdated
| if err != nil { | ||
| // API call is failed | ||
| userErr := userError.GetUserError("ListSubnetsFailed", err) | ||
| return "", userErr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we return userError.GetUserError("ListSubnetsFailed", err) itself instead of creating another object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
file/provider/get_subnet.go
Outdated
| // Iterate over the subnet list for given volume | ||
| if subnets != nil { | ||
| subnetList := subnets.Subnets | ||
| for _, subnetItem := range subnetList { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can avoid creating subnetList object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: Sameer Shaikh <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check my comments
| APIGeneration = 1 | ||
|
|
||
| // UserAgent identifies IKS to the RIaaS API | ||
| UserAgent = "IBM-Kubernetes-Service" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what would be the impact when we remove MaturityBeta = "beta"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The impact would be that by default the ENI mode will be applied i.e When user uses dp2 profile PVC will be created with ENI mode. Earlier it was VPC mode(Non-ENI).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what would be the impact for existing PVCs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The existing PVCS there is no impact. If user deletes the PVCS the shares and mount_targets API will be able to delete file share and file share target.
| ) | ||
|
|
||
| // Subnet ... | ||
| type Subnet struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can these 3 variable replaced with SubnetRef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can try it out but we can take this up as improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
| var apiErr models.Error | ||
|
|
||
| request := vs.client.NewRequest(operation) | ||
| ctxLogger.Info("Equivalent curl command", zap.Reflect("URL", request.URL()), zap.Reflect("Operation", operation)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we write log once as I see we have same at line number 71 as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| } | ||
|
|
||
| if len(volumeAccessPointRequest.SubnetID) != 0 { | ||
| vpcs.Logger.Info("Using subnet...", zap.Reflect("subnetID", volumeAccessPointRequest.SubnetID)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the use of this log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| } | ||
|
|
||
| if volumeAccessPointRequest.PrimaryIP != nil { | ||
| vpcs.Logger.Info("Primary IP property provided using it for virtual network interface...") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
file/provider/get_security_group.go
Outdated
| "strings" | ||
| ) | ||
|
|
||
| // / GetSecurityGroup get the SecurityGroup based on the request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to update method name here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| if securityGroups != nil { | ||
| for _, securityGroupItem := range securityGroups.SecurityGroups { | ||
| // Check if securityGroup is matching with requested input securityGroup name | ||
| if strings.EqualFold(securityGroupRequest.Name, securityGroupItem.Name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI SG can't be in capital latter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we are not considering the case we need to just find the matching SG. Anyways we will be changing this code for IKS network API.
| return securityGroup, err | ||
| } | ||
|
|
||
| func (vpcs *VPCSession) getSecurityGroupByVPCAndSecurityGroupName(securityGroupRequest provider.SecurityGroupRequest) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have different implementation like to get SG ID by using SG name i.e ibmcloud is sg test-sg --vpc r006-412635d8-56cc-4f74-b6ce-804b7cbac4d7 and if its failed then SG not found, not sure why we need pagination here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have securityGroupID with us that is the whole reason we are invoking this API :) We just know the name of securityGroup and using that we are doing Get all SecurityGroups and filter it. With IKS network this wont require pagination as it will be very efficient
Signed-off-by: Sameer Shaikh <[email protected]>
Signed-off-by: Sameer Shaikh <[email protected]>
Signed-off-by: Sameer Shaikh <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sameshai added comments here #22 (review), please check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm,
we need to review code again before releasing CSI driver. Please track all the comments which are not incorporated into this PR
Signed-off-by: Sameer Shaikh [email protected]