Skip to content

Conversation

@sameshai
Copy link
Member

Signed-off-by: Sameer Shaikh [email protected]

Copy link
Member

@prankulmahajan prankulmahajan left a comment

Choose a reason for hiding this comment

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

lgtm

@sameshai sameshai force-pushed the eni branch 2 times, most recently from 873fa10 to bb21ac6 Compare July 24, 2023 09:13
@sameshai sameshai force-pushed the eni branch 5 times, most recently from 9f83df3 to 570a9ff Compare September 11, 2023 18:40
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
Copy link
Collaborator

@arahamad arahamad left a 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

@sameshai sameshai requested a review from arahamad October 5, 2023 10:18
if err != nil {
// API call is failed
userErr := userError.GetUserError("ListSubnetsFailed", err)
return "", userErr
Copy link
Collaborator

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

// Iterate over the subnet list for given volume
if subnets != nil {
subnetList := subnets.Subnets
for _, subnetItem := range subnetList {
Copy link
Collaborator

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator

@arahamad arahamad left a 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"
Copy link
Collaborator

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"

Copy link
Member Author

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).

Copy link
Collaborator

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?

Copy link
Member Author

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 {
Copy link
Collaborator

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

Copy link
Member Author

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.

Copy link
Collaborator

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))
Copy link
Collaborator

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

Copy link
Member Author

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))
Copy link
Collaborator

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

Copy link
Member Author

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...")
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

"strings"
)

// / GetSecurityGroup get the SecurityGroup based on the request
Copy link
Collaborator

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

Copy link
Member Author

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) {
Copy link
Collaborator

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

Copy link
Member Author

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) {
Copy link
Collaborator

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

Copy link
Member Author

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]>
Copy link

@skorati skorati left a 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.

Copy link
Collaborator

@arahamad arahamad left a 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

@arahamad arahamad merged commit 085b5bb into master Oct 12, 2023
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.

5 participants