You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix priority between network and DHCP server (#2269)
Do not allow to set both network and DHCP server details which will create conflict while creating new DHCP server on whether to use network name or DHCP server name
Copy file name to clipboardExpand all lines: api/v1beta2/ibmpowervscluster_types.go
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ type IBMPowerVSClusterSpec struct {
42
42
// 1. in the case of DHCPServer.Name is not set the name will be DHCPSERVER<CLUSTER_NAME>_Private.
43
43
// 2. if DHCPServer.Name is set the name will be DHCPSERVER<DHCPServer.Name>_Private.
44
44
// when Network.ID is set, its expected that there exist a network in PowerVS workspace with id or else system will give error.
45
-
// when Network.Name is set, system will first check for network with Name in PowerVS workspace, if not exist network will be created by DHCP service.
45
+
// when Network.Name is set, system will first check for network with Name in PowerVS workspace, if not exist system will check DHCP network with given Network.name, if that also not exist, it will create a new DHCP service and name will be DHCPSERVER<Network.Name>_Private.
46
46
// Network.RegEx is not yet supported and system will ignore the value.
Copy file name to clipboardExpand all lines: cloud/scope/powervs_cluster.go
+12-18Lines changed: 12 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -872,10 +872,11 @@ func (s *PowerVSClusterScope) createServiceInstance(ctx context.Context) (*resou
872
872
}
873
873
874
874
// ReconcileNetwork reconciles network
875
-
// If only IBMPowerVSCluster.Spec.Network is set, network would be validated and if exists already will get used as cluster’s network or a new network will be created via DHCP service.
875
+
// If only IBMPowerVSCluster.Spec.Network is set, network would be validated and if exists already will get used as cluster’s network or DHCP network would be validated with this name if not exits then a new network will be created via DHCP service.
876
876
// If only IBMPowerVSCluster.Spec.DHCPServer is set, DHCP server would be validated and if exists already, will use DHCP server’s network as cluster network. If not a new DHCP service will be created and it’s network will be used.
877
-
// If both IBMPowerVSCluster.Spec.Network & IBMPowerVSCluster.Spec.DHCPServer is set, network and DHCP server would be validated and if both exists already then network is belongs to given DHCP server or not would be validated.
878
-
// If both IBMPowerVSCluster.Spec.Network & IBMPowerVSCluster.Spec.DHCPServer is not set, by default DHCP service will be created to setup cluster's network.
877
+
// Cannot set both IBMPowerVSCluster.Spec.Network & IBMPowerVSCluster.Spec.DHCPServer since it will cause collision during network creation if both are provided.
878
+
// If both IBMPowerVSCluster.Spec.Network & IBMPowerVSCluster.Spec.DHCPServer is not set, by default DHCP service will be created with the cluster name to setup cluster's network.
879
+
// Note: DHCP network name would be in `DHCPSERVER<Network.name or DHCPServer.name>_Private` this format.
Copy file name to clipboardExpand all lines: config/crd/bases/infrastructure.cluster.x-k8s.io_ibmpowervsclusters.yaml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -462,7 +462,7 @@ spec:
462
462
1. in the case of DHCPServer.Name is not set the name will be DHCPSERVER<CLUSTER_NAME>_Private.
463
463
2. if DHCPServer.Name is set the name will be DHCPSERVER<DHCPServer.Name>_Private.
464
464
when Network.ID is set, its expected that there exist a network in PowerVS workspace with id or else system will give error.
465
-
when Network.Name is set, system will first check for network with Name in PowerVS workspace, if not exist network will be created by DHCP service.
465
+
when Network.Name is set, system will first check for network with Name in PowerVS workspace, if not exist system will check DHCP network with given Network.name, if that also not exist, it will create a new DHCP service and name will be DHCPSERVER<Network.Name>_Private.
466
466
Network.RegEx is not yet supported and system will ignore the value.
Copy file name to clipboardExpand all lines: config/crd/bases/infrastructure.cluster.x-k8s.io_ibmpowervsclustertemplates.yaml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -499,7 +499,7 @@ spec:
499
499
1. in the case of DHCPServer.Name is not set the name will be DHCPSERVER<CLUSTER_NAME>_Private.
500
500
2. if DHCPServer.Name is set the name will be DHCPSERVER<DHCPServer.Name>_Private.
501
501
when Network.ID is set, its expected that there exist a network in PowerVS workspace with id or else system will give error.
502
-
when Network.Name is set, system will first check for network with Name in PowerVS workspace, if not exist network will be created by DHCP service.
502
+
when Network.Name is set, system will first check for network with Name in PowerVS workspace, if not exist system will check DHCP network with given Network.name, if that also not exist, it will create a new DHCP service and name will be DHCPSERVER<Network.Name>_Private.
503
503
Network.RegEx is not yet supported and system will ignore the value.
if (cluster.Spec.Network.Name!=nil||cluster.Spec.Network.ID!=nil) && (cluster.Spec.DHCPServer!=nil&&cluster.Spec.DHCPServer.Name!=nil) {
108
+
returnfield.Invalid(field.NewPath("spec.dhcpServer.name"), cluster.Spec.DHCPServer.Name, "either one of network or dhcpServer details can be provided")
109
+
}
110
+
if (cluster.Spec.Network.Name!=nil||cluster.Spec.Network.ID!=nil) && (cluster.Spec.DHCPServer!=nil&&cluster.Spec.DHCPServer.ID!=nil) {
111
+
returnfield.Invalid(field.NewPath("spec.dhcpServer.id"), cluster.Spec.DHCPServer.ID, "either one of network or dhcpServer details can be provided")
0 commit comments