Skip to content

Update vpc-go-sdk module and introduce the new SecurityGroupRule types#2603

Open
Pacho20 wants to merge 6 commits intokubernetes-sigs:mainfrom
Pacho20:new-vpc-sgr
Open

Update vpc-go-sdk module and introduce the new SecurityGroupRule types#2603
Pacho20 wants to merge 6 commits intokubernetes-sigs:mainfrom
Pacho20:new-vpc-sgr

Conversation

@Pacho20
Copy link

@Pacho20 Pacho20 commented Jan 21, 2026

What this PR does / why we need it:
This PR updates the vpc-go-sdk version

The latest release of vpc-go-sdk contains some breaking changes for SecurityGroupRuleProtocol, Its changed from all to icmp_tcp_udp and we are no more able to use 'all' protocol. Besides that it introduced two new protocol types Any and Individual.

This PR changes the protocol usage from 'all' to 'icmp_tcp_udp' and add support for the new protocol types 'any' and 'individual'.

The release notes: https://cloud.ibm.com/docs/vpc?topic=vpc-api-change-log#9-december-2025

Which issue(s) this PR fixes:
Fixes #2579

Special notes for your reviewer:

/area provider/ibmcloud

  1. Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:

The VPC Security Group Rule protocol value 'all' has been replaced with 'icmp_tcp_udp', action required. Added support for the 'any' protocol and all individual protocols currently supported by IBM Cloud VPC Security Group Rules.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. area/provider/ibmcloud Issues or PRs related to ibmcloud provider labels Jan 21, 2026
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 21, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@netlify
Copy link

netlify bot commented Jan 21, 2026

Deploy Preview for kubernetes-sigs-cluster-api-ibmcloud ready!

Name Link
🔨 Latest commit 1d85fbd
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-cluster-api-ibmcloud/deploys/697cc87fa046cb0008af70d9
😎 Deploy Preview https://deploy-preview-2603.cluster-api-ibmcloud.sigs.k8s.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot
Copy link
Contributor

Welcome @Pacho20!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-ibmcloud 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-ibmcloud has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 21, 2026
@k8s-ci-robot
Copy link
Contributor

Hi @Pacho20. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jan 21, 2026
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Pacho20
Once this PR has been reviewed and has the lgtm label, please assign prajyot-parab for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jan 21, 2026
@mkumatag
Copy link
Member

/cc @Karthik-K-N

@mkumatag
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 23, 2026
@Pacho20 Pacho20 force-pushed the new-vpc-sgr branch 2 times, most recently from b072c8b to 4ae0b24 Compare January 27, 2026 11:54
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 27, 2026
@Pacho20 Pacho20 marked this pull request as ready for review January 27, 2026 11:55
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 27, 2026
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 29, 2026
Karthik-K-N and others added 3 commits January 29, 2026 16:06
The latest vpc-go-sdk release introduced a breaking change to
SecurityGroupRuleProtocol: the value 'all' was removed and replaced
by 'icmp_tcp_udp'. This commit updates the security group rule
creation and validation to use 'icmp_tcp_udp' instead of 'all'.
The latest vpc-go-sdk introduces two new security group rule protocol
types: any and individual. This commit adds full compatibility for
these new protocols in the VPC implementation.
The latest vpc-go-sdk introduces two new security group rule protocol
types: 'any' and 'individual'. This commit adds full compatibility for
these new protocols in the PowerVS implementation.
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 29, 2026
Copy link
Contributor

@Karthik-K-N Karthik-K-N left a comment

Choose a reason for hiding this comment

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

Overall LGTM, Couple of changes required in error statements or logs.

Thanks for working on it

ogRule := ogRuleIntf.(*vpcv1.SecurityGroupRuleProtocolAny)
ruleID = ogRule.ID

if *ogRule.Direction == string(direction) && *ogRule.Protocol == protocol {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it safe to directly deref the pointer? is it non nil always?

Copy link
Author

@Pacho20 Pacho20 Jan 30, 2026

Choose a reason for hiding this comment

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

Yes, it should be safe. If you check the API docs, these values are marked as always included. Without the direction and protocol fields, the rule would not make sense at all. Besides that the same pattern is used for all the other SGR types.
https://cloud.ibm.com/apidocs/vpc/latest#get-security-group

IBMVPCCluster *infrav1.IBMVPCCluster
ServiceEndpoint []endpoints.ServiceEndpoint

individualSgrRegexp *regexp.Regexp
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it required to be part of ClusterScope, as its a constant and can't we keep it as variable?

Copy link
Author

Choose a reason for hiding this comment

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

You are right it can be a variable. I will move it from ClusterScope.

if exists, err := s.checkSecurityGroupRulePrototypeRemote(ctx, securityGroupRuleRemote, existingRule.Remote); err != nil {
return false, fmt.Errorf("error failed checking security group rule all remote: %w", err)
} else if exists {
log.V(3).Info("security group rule all protocols match")
Copy link
Contributor

Choose a reason for hiding this comment

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

security group rule all or security group rule any?

Copy link
Author

Choose a reason for hiding this comment

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

Yeah...
Will change those.

}

if exists, err := s.checkSecurityGroupRulePrototypeRemote(ctx, securityGroupRuleRemote, existingRule.Remote); err != nil {
return false, fmt.Errorf("error failed checking security group rule all remote: %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

same here?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 5, 2026
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@Karthik-K-N
Copy link
Contributor

Most of the things LGTM, Have you tested this change by creating a cluster?
Also whats the scenario when a user upgrades from previous version to this version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/provider/ibmcloud Issues or PRs related to ibmcloud provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API changes required to bump github.com/IBM/vpc-go-sdk to 0.78.1

4 participants