diff --git a/controllers/openstackconfiggenerator_controller.go b/controllers/openstackconfiggenerator_controller.go index a91bf02f..d1c0a7ce 100644 --- a/controllers/openstackconfiggenerator_controller.go +++ b/controllers/openstackconfiggenerator_controller.go @@ -423,7 +423,7 @@ func (r *OpenStackConfigGeneratorReconciler) Reconcile(ctx context.Context, req } // check if osvmset and osbms is in status provisioned - msg, deployed, err := r.verifyNodeResourceStatus(ctx, instance) + msg, deployed, err := r.verifyNodeResourceStatus(ctx, instance, OSPVersion) if err != nil { return ctrl.Result{}, err } @@ -655,6 +655,7 @@ func (r *OpenStackConfigGeneratorReconciler) SetupWithManager(mgr ctrl.Manager) func (r *OpenStackConfigGeneratorReconciler) verifyNodeResourceStatus( ctx context.Context, instance *ospdirectorv1beta1.OpenStackConfigGenerator, + ospVersion shared.OSPVersion, ) (string, bool, error) { msg := "" @@ -669,7 +670,7 @@ func (r *OpenStackConfigGeneratorReconciler) verifyNodeResourceStatus( } for _, vmset := range vmsetList.Items { - if openstackconfiggenerator.IsRoleIncluded(vmset.Spec.RoleName, instance) { + if openstackconfiggenerator.IsRoleIncluded(vmset.Spec.RoleName, instance, ospVersion) { if vmset.Status.ProvisioningStatus.State != shared.ProvisioningState(shared.VMSetCondTypeProvisioned) { msg := fmt.Sprintf("Waiting on OpenStackVMset %s to be provisioned...", vmset.Name) return msg, false, nil @@ -690,7 +691,7 @@ func (r *OpenStackConfigGeneratorReconciler) verifyNodeResourceStatus( // // wait for all BMS be provisioned if baremetalhosts for the bms are requested // - if openstackconfiggenerator.IsRoleIncluded(bmset.Spec.RoleName, instance) { + if openstackconfiggenerator.IsRoleIncluded(bmset.Spec.RoleName, instance, ospVersion) { if bmset.Status.ProvisioningStatus.State != shared.ProvisioningState(shared.BaremetalSetCondTypeProvisioned) && bmset.Status.ProvisioningStatus.State != shared.ProvisioningState(shared.BaremetalSetCondTypeEmpty) { msg := fmt.Sprintf("Waiting on OpenStackBaremetalSet %s to be provisioned...", bmset.Name) diff --git a/pkg/openstackconfiggenerator/configmap.go b/pkg/openstackconfiggenerator/configmap.go index 5365de55..a086574f 100644 --- a/pkg/openstackconfiggenerator/configmap.go +++ b/pkg/openstackconfiggenerator/configmap.go @@ -357,9 +357,16 @@ func createNetworksMap( } // IsRoleIncluded - checks if the role exists in the ConfigGenerator Roles set -func IsRoleIncluded(roleName string, instance *ospdirectorv1beta1.OpenStackConfigGenerator) bool { - - if len(instance.Spec.Roles) == 0 || roleName == controlplane.Role { +func IsRoleIncluded(roleName string, instance *ospdirectorv1beta1.OpenStackConfigGenerator, ospVersion shared.OSPVersion) bool { + + // return for special conditions: + // - if there is no specific role specified in the spec + // - the roleName is one of the special roles for allocated VIPs in ipam for + // - ControlPlane + // - Redis (OSP17.1) + // - OVNDPs (OSP17.1) + if len(instance.Spec.Roles) == 0 || roleName == controlplane.Role || + (ospVersion == shared.OSPVersion(shared.TemplateVersion17_1) && (roleName == "Redis" || roleName == "OVNDBs")) { return true } for _, r := range instance.Spec.Roles { @@ -397,7 +404,7 @@ func createRolesMap( roleOveride, roleOverrideFound = instance.Spec.TripleoRoleOverride[roleName] } - if IsRoleIncluded(roleName, instance) || (roleOverrideFound && IsRoleIncluded(roleOveride.RoleName, instance)) { + if IsRoleIncluded(roleName, instance, ospVersion) || (roleOverrideFound && IsRoleIncluded(roleOveride.RoleName, instance, ospVersion)) { // // check if role is VM //