kubernetes-sigs / cluster-api-provider-ibmcloud

Cluster API Provider for IBM Cloud
https://cluster-api-ibmcloud.sigs.k8s.io
Apache License 2.0
62 stars 79 forks source link

Support fetching Power VS network with regular expression #1994

Open Karthik-K-N opened 1 day ago

Karthik-K-N commented 1 day ago

/kind feature /area provider/ibmcloud

Describe the solution you'd like [A clear and concise description of what you want to happen.]

A Power VS network can be identified by id, name or regular expression, Currently we support both id and name. I would like to have support for fetching network by regular expression.

Anything else you would like to add: [Miscellaneous information that will assist in solving the issue.]

Karthik-K-N commented 1 day ago

In openshift we mainly use regular expression for identifying a network for reference in machine spec

      network:
        regex: ^DHCPSERVER.*ipi-sa04-418nig-jqw97.*_Private$
        type: RegEx
      processorType: Shared
      processors: "0.5"

for feature parity I would like to have same support in CAPIBM as well.

Karthik-K-N commented 1 day ago

When only spec.network.regex is set and no other network resources are set the controller will create the DHCP server and corresponding network of format DHCPSERVER<dhcp_server_name>_Private,

so we may need to webhook validation to let user know that when setting regular expression make sure it matches either DHCP server name when set or cluster_name when dhcp server details are not set.

Karthik-K-N commented 1 day ago

/cc @Amulyam24

Karthik-K-N commented 1 day ago

For reference we already support regex matching for machines

Amulyam24 commented 4 hours ago

/assign