-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KIM Integration - SAP Converged Cloud provider (#990)
* initial version - no failure handling failure tolerance handled on another level tests started but not finished tests added * go imports --------- Co-authored-by: Piotr Miśkiewicz <[email protected]>
- Loading branch information
1 parent
d4e1b3f
commit 7ab8588
Showing
7 changed files
with
231 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package provider | ||
|
||
import ( | ||
"github.com/kyma-project/kyma-environment-broker/internal" | ||
) | ||
|
||
const ( | ||
DefaultSapConvergedCloudRegion = "eu-de-1" | ||
DefaultSapConvergedCloudMachineType = "g_c2_m8" | ||
DefaultSapConvergedCloudMultiZoneCount = 3 | ||
) | ||
|
||
type ( | ||
SapConvergedCloudInputProvider struct { | ||
MultiZone bool | ||
ProvisioningParameters internal.ProvisioningParameters | ||
} | ||
) | ||
|
||
func (p *SapConvergedCloudInputProvider) Provide() Values { | ||
zonesCount := p.zonesCount() | ||
zones := p.zones() | ||
region := DefaultSapConvergedCloudRegion | ||
if p.ProvisioningParameters.Parameters.Region != nil { | ||
region = *p.ProvisioningParameters.Parameters.Region | ||
} | ||
return Values{ | ||
DefaultAutoScalerMax: 20, | ||
DefaultAutoScalerMin: 3, | ||
ZonesCount: zonesCount, | ||
Zones: zones, | ||
ProviderType: "openstack", | ||
DefaultMachineType: DefaultSapConvergedCloudMachineType, | ||
Region: region, | ||
Purpose: PurposeProduction, | ||
} | ||
} | ||
|
||
func (p *SapConvergedCloudInputProvider) zonesCount() int { | ||
zonesCount := 1 | ||
if p.MultiZone { | ||
zonesCount = DefaultSapConvergedCloudMultiZoneCount | ||
} | ||
return zonesCount | ||
} | ||
|
||
func (p *SapConvergedCloudInputProvider) zones() []string { | ||
region := DefaultSapConvergedCloudRegion | ||
if p.ProvisioningParameters.Parameters.Region != nil { | ||
region = *p.ProvisioningParameters.Parameters.Region | ||
} | ||
return ZonesForSapConvergedCloud(region, p.zonesCount()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.