diff --git a/cluster-autoscaler/cloudprovider/oci/common/oci_shape.go b/cluster-autoscaler/cloudprovider/oci/common/oci_shape.go index 23cdba749eae..b9bc5b0001be 100644 --- a/cluster-autoscaler/cloudprovider/oci/common/oci_shape.go +++ b/cluster-autoscaler/cloudprovider/oci/common/oci_shape.go @@ -83,7 +83,8 @@ func (osf *shapeGetterImpl) GetNodePoolShape(np *oke.NodePool, ephemeralStorage shapeName := *np.NodeShape if np.NodeShapeConfig != nil { return &Shape{ - CPU: *np.NodeShapeConfig.Ocpus * 2, + Name: shapeName, + CPU: *np.NodeShapeConfig.Ocpus * 2, // num_bytes * kilo * mega * giga MemoryInBytes: *np.NodeShapeConfig.MemoryInGBs * 1024 * 1024 * 1024, GPU: 0, @@ -115,6 +116,7 @@ func (osf *shapeGetterImpl) GetNodePoolShape(np *oke.NodePool, ephemeralStorage // Update the cache based on latest results for _, s := range resp.Items { osf.cache[*s.Shape] = &Shape{ + Name: shapeName, CPU: getFloat32(s.Ocpus) * 2, // convert ocpu to vcpu GPU: getInt(s.Gpus), MemoryInBytes: getFloat32(s.MemoryInGBs) * 1024 * 1024 * 1024, diff --git a/cluster-autoscaler/cloudprovider/oci/common/oci_shape_test.go b/cluster-autoscaler/cloudprovider/oci/common/oci_shape_test.go index 25c5ea753d28..f5ac079b26b2 100644 --- a/cluster-autoscaler/cloudprovider/oci/common/oci_shape_test.go +++ b/cluster-autoscaler/cloudprovider/oci/common/oci_shape_test.go @@ -95,6 +95,7 @@ func TestNodePoolGetShape(t *testing.T) { "basic shape": { shape: "VM.Standard1.2", expected: &Shape{ + Name: "VM.Standard1.2", CPU: 4, MemoryInBytes: 16 * 1024 * 1024 * 1024, GPU: 0, @@ -108,6 +109,7 @@ func TestNodePoolGetShape(t *testing.T) { MemoryInGBs: common.Float32(64), }, expected: &Shape{ + Name: "VM.Standard.E3.Flex", CPU: 8, MemoryInBytes: 4 * 16 * 1024 * 1024 * 1024, GPU: 0,