Skip to content

Commit

Permalink
update editable values api
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadhamzh committed Sep 3, 2024
1 parent 86324c8 commit 00c816f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions modules/api/pkg/provider/kubernetes/preset.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,16 +383,24 @@ func (m *PresetProvider) setOpenStackCredentials(preset *kubermaticv1.Preset, cl
cloud.Openstack.ApplicationCredentialID = credentials.ApplicationCredentialID
cloud.Openstack.ApplicationCredentialSecret = credentials.ApplicationCredentialSecret

cloud.Openstack.SubnetID = credentials.SubnetID
cloud.Openstack.Network = credentials.Network
cloud.Openstack.FloatingIPPool = credentials.FloatingIPPool

if cloud.Openstack.FloatingIPPool == "" && dc.Spec.Openstack != nil && dc.Spec.Openstack.EnforceFloatingIP {
return nil, fmt.Errorf("preset error, no floating ip pool specified for OpenStack")
}

cloud.Openstack.RouterID = credentials.RouterID
cloud.Openstack.SecurityGroups = credentials.SecurityGroups
if cloud.Openstack.SecurityGroups == "" {
cloud.Openstack.SecurityGroups = credentials.SecurityGroups
}

if cloud.Openstack.SubnetID == "" {
cloud.Openstack.SubnetID = credentials.SubnetID
}

if cloud.Openstack.Network == "" {
cloud.Openstack.Network = credentials.Network
}

return &cloud, nil
}
Expand Down

0 comments on commit 00c816f

Please sign in to comment.