Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cluster-api/providers/ibmcloud/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ require (
github.com/onsi/gomega v1.38.0 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/ppc64le-cloud/powervs-utils v0.0.0-20250403153021-219b161805db // indirect
github.com/ppc64le-cloud/powervs-utils v0.0.0-20260320143638-bc9d769bbbfc // indirect
github.com/prometheus/client_golang v1.22.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.62.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions cluster-api/providers/ibmcloud/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/ppc64le-cloud/powervs-utils v0.0.0-20250403153021-219b161805db h1:Fy2pmDLfLq2H0N77KD2LpNoCWbDGP0BknZU/odPx2+c=
github.com/ppc64le-cloud/powervs-utils v0.0.0-20250403153021-219b161805db/go.mod h1:yfr6HHPYyJzVgnivMsobLMbHQqUHrzcIqWM4Nav4kc8=
github.com/ppc64le-cloud/powervs-utils v0.0.0-20260320143638-bc9d769bbbfc h1:SWIY4l7NmQMrNuEwL01R5dHcSowtVu9oVV/HKO1pALI=
github.com/ppc64le-cloud/powervs-utils v0.0.0-20260320143638-bc9d769bbbfc/go.mod h1:APQVGiVIdJ3HuzYdQS0319Xsk08Y8S/bbbJYLoDwYvw=
github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q=
github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0=
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cluster-api/providers/ibmcloud/vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,8 @@ github.com/opentracing/opentracing-go/log
# github.com/pkg/errors v0.9.1
## explicit
github.com/pkg/errors
# github.com/ppc64le-cloud/powervs-utils v0.0.0-20250403153021-219b161805db
## explicit; go 1.21
# github.com/ppc64le-cloud/powervs-utils v0.0.0-20260320143638-bc9d769bbbfc
## explicit; go 1.25.8
github.com/ppc64le-cloud/powervs-utils
# github.com/prometheus/client_golang v1.22.0
## explicit; go 1.22
Expand Down
9 changes: 6 additions & 3 deletions pkg/asset/installconfig/powervs/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1122,12 +1122,15 @@ func (c *Client) GetDatacenterSupportedSystems(ctx context.Context, region strin
return nil, fmt.Errorf("failed to initialize PISession in GetDatacenterSupportedSystems: %w", err)
}
}
params := datacenters.NewV1DatacentersGetParamsWithContext(ctx).WithDatacenterRegion(region)
getOk, err := c.BXCli.PISession.Power.Datacenters.V1DatacentersGet(params)

// Use the global datacenter endpoint for accurate, non-cached data (other code uses a bulk endpoint)
datacenterClient := instance.NewIBMPIDatacenterClient(ctx, c.BXCli.PISession, "")
datacenter, err := datacenterClient.Get(region)
if err != nil {
return nil, fmt.Errorf("failed to get datacenter supported systems: %w", err)
}
return getOk.Payload.CapabilitiesDetails.SupportedSystems.General, nil

return datacenter.CapabilitiesDetails.SupportedSystems.General, nil
}

// TransitGatewayNameToID checks to see if the name is an existing transit gateway name.
Expand Down
3 changes: 3 additions & 0 deletions pkg/types/powervs/powervs_regions.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ var Regions = map[string]Region{
"dal12": {
SysTypes: []string{"s922", "e980"},
},
"dal14": {
SysTypes: []string{"s1022", "e1080", "s1122"},
},
},
VPCZones: []string{"us-south-1", "us-south-2", "us-south-3"},
},
Expand Down
10 changes: 9 additions & 1 deletion pkg/types/powervs/validation/machinepool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func TestValidateMachinePool(t *testing.T) {
cases := []struct {
name string
pool *powervs.MachinePool
platform *powervs.Platform
expected string
}{
{
Expand Down Expand Up @@ -73,6 +74,7 @@ func TestValidateMachinePool(t *testing.T) {
SysType: "s922",
MemoryGiB: 943,
},
platform: &powervs.Platform{Zone: "dal10"}, // Use a zone that supports s922
expected: `^test-path\.memory: Invalid value: 943: maximum memory limit for the s922 SysType is 942GiB$`,
},
{
Expand Down Expand Up @@ -101,6 +103,7 @@ func TestValidateMachinePool(t *testing.T) {
SysType: "s922",
Processors: intstr.FromInt(33),
},
platform: &powervs.Platform{Zone: "dal10"}, // Use a zone that supports s922
expected: `^test-path\.processors: Invalid value: 33: maximum processors limit for s922 SysType is 15 cores$`,
},
{
Expand Down Expand Up @@ -136,6 +139,7 @@ func TestValidateMachinePool(t *testing.T) {
pool: &powervs.MachinePool{
SysType: "s922",
},
platform: &powervs.Platform{Zone: "dal10"}, // Use a zone that supports s922
},
{
name: "invalid sysType",
Expand All @@ -147,7 +151,11 @@ func TestValidateMachinePool(t *testing.T) {
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
err := ValidateMachinePool(validMinimalPlatform(), tc.pool, field.NewPath("test-path")).ToAggregate()
platform := tc.platform
if platform == nil {
platform = validMinimalPlatform()
}
err := ValidateMachinePool(platform, tc.pool, field.NewPath("test-path")).ToAggregate()
if tc.expected == "" {
assert.NoError(t, err)
} else {
Expand Down