openshift / machine-api-provider-ibmcloud Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
ISSUE:
Currently, the IBM Cloud VPC API sets a default to return only 50 subnets per page on an API call if an option is not set on the API call to return more. However, a single VPC can have up to a maximum of 100 subnets.
If a user configures their machine provider config to look for a subnet that is greater than 50 in the returned list, the MAPI will return an error since it's using the default value of 50 provided by the VPC API.
POSSIBLE SOLUTIONS:
When using the IBM Cloud VPC API to return a subnet list, set the default limit to 100 so that all possible subnets are returned for the VPC. Such as:
subnetOption.SetLimit=100
https://cloud.ibm.com/apidocs/vpc/latest#list-subnets
Support pagination if we choose to only return 50 results with the default setting
Additional Information:
Here is the code where I believe we could set subnetOption.SetLimit=100
to return the full result. This is also the code where the error is thrown if a subnet name provided in the machine provider config is over 50 in the returned list:
func (c *ibmCloudClient) GetSubnetIDbyName(subnetName string, resourceGroupID string) (string, error) {
// Initialize List Subnets Options
subnetOption := c.vpcService.NewListSubnetsOptions()
// Set Resource Group ID
subnetOption.SetResourceGroupID(resourceGroupID)
// Set Limit to 100, ibmcloud limits 100 subnets per vpc <======. add these 2 lines is my guess
subnetOption.SetLimit(100)
// Get a list of all subnets
subnetList, _, err := c.vpcService.ListSubnets(subnetOption)
if err != nil {
return "", err
}
if subnetList != nil {
for _, eachSubnet := range subnetList.Subnets {
if *eachSubnet.Name == subnetName {
// Return Subnet ID
return *eachSubnet.ID, nil
}
}
}
return "", fmt.Errorf("could not retrieve subnet id of name: %v", subnetName)
}
Link:
desired functionality
I would like to use Machine API Operator to auto-scale an IBM Cloud instance with multiple network interface attachments and with allow-ip-spoofing attribute.
why the current version does not support this
ProviderSpec does not contain attribute to refer to NetworkIntefaces attribute in vpcv1.instancePrototype when creating an instance.
solution
NetworkInterfaces []NetworkInterface
to IBMCloudMachineProviderSpec struct.AllowIfSpoofing bool
to NetworkInterface structNetworkInterfaces
from IBMCloudMachineProviderSpec to vpcv1.InstancePrototype at InstanceCreate function.machine.Status.Addresses
of NetworkInterfaces
at reconcileMachineWithCloudState function.The following branches are being fast-forwarded from the current development branch (main) as placeholders for future releases. No merging is allowed into these release branches until they are unfrozen for production release.
release-4.18
release-4.19
For more information, see the branching documentation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.