From 6428e2edb978637bb9d110dafab700488b08c25e Mon Sep 17 00:00:00 2001 From: Jan Sykora Date: Fri, 1 Dec 2023 14:14:54 +0100 Subject: [PATCH] feat: add custom instance with extended memory field to node template --- castai/resource_node_template.go | 88 ++++++++++++++++----------- castai/resource_node_template_test.go | 18 ++++-- castai/sdk/api.gen.go | 57 +++++++---------- castai/sdk/client.gen.go | 34 +++-------- castai/sdk/mock/client.go | 16 ++--- docs/resources/node_template.md | 1 + 6 files changed, 102 insertions(+), 112 deletions(-) diff --git a/castai/resource_node_template.go b/castai/resource_node_template.go index f5d23630..7695ac4b 100644 --- a/castai/resource_node_template.go +++ b/castai/resource_node_template.go @@ -16,42 +16,43 @@ import ( ) const ( - FieldNodeTemplateArchitectures = "architectures" - FieldNodeTemplateComputeOptimized = "compute_optimized" - FieldNodeTemplateConfigurationId = "configuration_id" - FieldNodeTemplateConstraints = "constraints" - FieldNodeTemplateCustomInstancesEnabled = "custom_instances_enabled" - FieldNodeTemplateCustomLabels = "custom_labels" - FieldNodeTemplateCustomTaints = "custom_taints" - FieldNodeTemplateEnableSpotDiversity = "enable_spot_diversity" - FieldNodeTemplateExclude = "exclude" - FieldNodeTemplateExcludeNames = "exclude_names" - FieldNodeTemplateFallbackRestoreRateSeconds = "fallback_restore_rate_seconds" - FieldNodeTemplateGpu = "gpu" - FieldNodeTemplateInclude = "include" - FieldNodeTemplateIncludeNames = "include_names" - FieldNodeTemplateInstanceFamilies = "instance_families" - FieldNodeTemplateIsDefault = "is_default" - FieldNodeTemplateIsEnabled = "is_enabled" - FieldNodeTemplateIsGpuOnly = "is_gpu_only" - FieldNodeTemplateManufacturers = "manufacturers" - FieldNodeTemplateMaxCount = "max_count" - FieldNodeTemplateMaxCpu = "max_cpu" - FieldNodeTemplateMaxMemory = "max_memory" - FieldNodeTemplateMinCount = "min_count" - FieldNodeTemplateMinCpu = "min_cpu" - FieldNodeTemplateMinMemory = "min_memory" - FieldNodeTemplateName = "name" - FieldNodeTemplateOnDemand = "on_demand" - FieldNodeTemplateOs = "os" - FieldNodeTemplateRebalancingConfigMinNodes = "rebalancing_config_min_nodes" - FieldNodeTemplateShouldTaint = "should_taint" - FieldNodeTemplateSpot = "spot" - FieldNodeTemplateSpotDiversityPriceIncreaseLimitPercent = "spot_diversity_price_increase_limit_percent" - FieldNodeTemplateSpotInterruptionPredictionsEnabled = "spot_interruption_predictions_enabled" - FieldNodeTemplateSpotInterruptionPredictionsType = "spot_interruption_predictions_type" - FieldNodeTemplateStorageOptimized = "storage_optimized" - FieldNodeTemplateUseSpotFallbacks = "use_spot_fallbacks" + FieldNodeTemplateArchitectures = "architectures" + FieldNodeTemplateComputeOptimized = "compute_optimized" + FieldNodeTemplateConfigurationId = "configuration_id" + FieldNodeTemplateConstraints = "constraints" + FieldNodeTemplateCustomInstancesEnabled = "custom_instances_enabled" + FieldNodeTemplateCustomInstancesWithExtendedMemoryEnabled = "custom_instances_with_extended_memory_enabled" + FieldNodeTemplateCustomLabels = "custom_labels" + FieldNodeTemplateCustomTaints = "custom_taints" + FieldNodeTemplateEnableSpotDiversity = "enable_spot_diversity" + FieldNodeTemplateExclude = "exclude" + FieldNodeTemplateExcludeNames = "exclude_names" + FieldNodeTemplateFallbackRestoreRateSeconds = "fallback_restore_rate_seconds" + FieldNodeTemplateGpu = "gpu" + FieldNodeTemplateInclude = "include" + FieldNodeTemplateIncludeNames = "include_names" + FieldNodeTemplateInstanceFamilies = "instance_families" + FieldNodeTemplateIsDefault = "is_default" + FieldNodeTemplateIsEnabled = "is_enabled" + FieldNodeTemplateIsGpuOnly = "is_gpu_only" + FieldNodeTemplateManufacturers = "manufacturers" + FieldNodeTemplateMaxCount = "max_count" + FieldNodeTemplateMaxCpu = "max_cpu" + FieldNodeTemplateMaxMemory = "max_memory" + FieldNodeTemplateMinCount = "min_count" + FieldNodeTemplateMinCpu = "min_cpu" + FieldNodeTemplateMinMemory = "min_memory" + FieldNodeTemplateName = "name" + FieldNodeTemplateOnDemand = "on_demand" + FieldNodeTemplateOs = "os" + FieldNodeTemplateRebalancingConfigMinNodes = "rebalancing_config_min_nodes" + FieldNodeTemplateShouldTaint = "should_taint" + FieldNodeTemplateSpot = "spot" + FieldNodeTemplateSpotDiversityPriceIncreaseLimitPercent = "spot_diversity_price_increase_limit_percent" + FieldNodeTemplateSpotInterruptionPredictionsEnabled = "spot_interruption_predictions_enabled" + FieldNodeTemplateSpotInterruptionPredictionsType = "spot_interruption_predictions_type" + FieldNodeTemplateStorageOptimized = "storage_optimized" + FieldNodeTemplateUseSpotFallbacks = "use_spot_fallbacks" ) const ( @@ -369,6 +370,13 @@ func resourceNodeTemplate() *schema.Resource { Description: "Marks whether custom instances should be used when deciding which parts of inventory are available. " + "Custom instances are only supported in GCP.", }, + FieldNodeTemplateCustomInstancesWithExtendedMemoryEnabled: { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Marks whether custom instances with extended memory should be used when deciding which parts of inventory are available. " + + "Custom instances are only supported in GCP.", + }, }, } } @@ -431,6 +439,9 @@ func resourceNodeTemplateRead(ctx context.Context, d *schema.ResourceData, meta if err := d.Set(FieldNodeTemplateCustomInstancesEnabled, lo.FromPtrOr(nodeTemplate.CustomInstancesEnabled, false)); err != nil { return diag.FromErr(fmt.Errorf("setting custom instances enabled: %w", err)) } + if err := d.Set(FieldNodeTemplateCustomInstancesWithExtendedMemoryEnabled, lo.FromPtrOr(nodeTemplate.CustomInstancesWithExtendedMemoryEnabled, false)); err != nil { + return diag.FromErr(fmt.Errorf("setting custom instances with extended memory enabled: %w", err)) + } return nil } @@ -576,6 +587,7 @@ func updateNodeTemplate(ctx context.Context, d *schema.ResourceData, meta any, s FieldNodeTemplateCustomLabels, FieldNodeTemplateCustomTaints, FieldNodeTemplateCustomInstancesEnabled, + FieldNodeTemplateCustomInstancesWithExtendedMemoryEnabled, FieldNodeTemplateConstraints, FieldNodeTemplateIsEnabled, ) { @@ -643,6 +655,10 @@ func updateNodeTemplate(ctx context.Context, d *schema.ResourceData, meta any, s req.CustomInstancesEnabled = lo.ToPtr(v.(bool)) } + if v, _ := d.GetOk(FieldNodeTemplateCustomInstancesWithExtendedMemoryEnabled); v != nil { + req.CustomInstancesWithExtendedMemoryEnabled = lo.ToPtr(v.(bool)) + } + resp, err := client.NodeTemplatesAPIUpdateNodeTemplateWithResponse(ctx, clusterID, name, req) if checkErr := sdk.CheckOKResponse(resp, err); checkErr != nil { return diag.FromErr(checkErr) diff --git a/castai/resource_node_template_test.go b/castai/resource_node_template_test.go index 550f7c63..66871127 100644 --- a/castai/resource_node_template_test.go +++ b/castai/resource_node_template_test.go @@ -100,7 +100,8 @@ func TestNodeTemplateResourceReadContext(t *testing.T) { "rebalancingConfig": { "minNodes": 0 }, - "customInstancesEnabled": true + "customInstancesEnabled": true, + "customInstancesWithExtendedMemoryEnabled": true } } ] @@ -164,6 +165,7 @@ constraints.0.spot_interruption_predictions_type = aws-rebalance-recommendations constraints.0.storage_optimized = false constraints.0.use_spot_fallbacks = false custom_instances_enabled = true +custom_instances_with_extended_memory_enabled = true custom_labels.% = 2 custom_labels.key-1 = value-1 custom_labels.key-2 = value-2 @@ -253,7 +255,8 @@ func TestNodeTemplateResourceCreate_defaultNodeTemplate(t *testing.T) { "rebalancingConfig": { "minNodes": 0 }, - "customInstancesEnabled": true + "customInstancesEnabled": true, + "customInstancesWithExtendedMemoryEnabled": true } } ] @@ -269,10 +272,11 @@ func TestNodeTemplateResourceCreate_defaultNodeTemplate(t *testing.T) { resource := resourceNodeTemplate() val := cty.ObjectVal(map[string]cty.Value{ - FieldClusterId: cty.StringVal(clusterId), - FieldNodeTemplateName: cty.StringVal("default-by-castai"), - FieldNodeTemplateIsDefault: cty.BoolVal(true), - FieldNodeTemplateCustomInstancesEnabled: cty.BoolVal(true), + FieldClusterId: cty.StringVal(clusterId), + FieldNodeTemplateName: cty.StringVal("default-by-castai"), + FieldNodeTemplateIsDefault: cty.BoolVal(true), + FieldNodeTemplateCustomInstancesEnabled: cty.BoolVal(true), + FieldNodeTemplateCustomInstancesWithExtendedMemoryEnabled: cty.BoolVal(true), }) state := terraform.NewInstanceStateShimmedFromValue(val, 0) state.ID = "default-by-castai" @@ -371,6 +375,7 @@ func TestAccResourceNodeTemplate_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "is_enabled", "true"), resource.TestCheckResourceAttr(resourceName, "should_taint", "true"), resource.TestCheckResourceAttr(resourceName, "custom_instances_enabled", "false"), + resource.TestCheckResourceAttr(resourceName, "custom_instances_with_extended_memory_enabled", "false"), resource.TestCheckResourceAttr(resourceName, "custom_labels.%", "2"), resource.TestCheckResourceAttr(resourceName, "custom_labels."+rName+"-label-key-1", rName+"-label-value-1"), resource.TestCheckResourceAttr(resourceName, "custom_labels."+rName+"-label-key-2", rName+"-label-value-2"), @@ -423,6 +428,7 @@ func TestAccResourceNodeTemplate_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "is_enabled", "true"), resource.TestCheckResourceAttr(resourceName, "should_taint", "true"), resource.TestCheckResourceAttr(resourceName, "custom_instances_enabled", "false"), + resource.TestCheckResourceAttr(resourceName, "custom_instances_with_extended_memory_enabled", "false"), resource.TestCheckResourceAttr(resourceName, "custom_labels.%", "2"), resource.TestCheckResourceAttr(resourceName, "custom_labels."+rName+"-label-key-1", rName+"-label-value-1"), resource.TestCheckResourceAttr(resourceName, "custom_labels."+rName+"-label-key-2", rName+"-label-value-2"), diff --git a/castai/sdk/api.gen.go b/castai/sdk/api.gen.go index f9080d74..b89402a8 100644 --- a/castai/sdk/api.gen.go +++ b/castai/sdk/api.gen.go @@ -398,6 +398,7 @@ type CastaiInventoryV1beta1InstanceType struct { // CastaiInventoryV1beta1InstanceZone defines model for castai.inventory.v1beta1.InstanceZone. type CastaiInventoryV1beta1InstanceZone struct { AttachableGpuDevices *[]CastaiInventoryV1beta1AttachableGPUDevice `json:"attachableGpuDevices,omitempty"` + AttachedGpuDevices *[]CastaiInventoryV1beta1GPUDevice `json:"attachedGpuDevices,omitempty"` AzId *string `json:"azId,omitempty"` CpuPrice *string `json:"cpuPrice,omitempty"` LastUnavailableAt *time.Time `json:"lastUnavailableAt,omitempty"` @@ -490,17 +491,6 @@ type CastaiInventoryV1beta1StorageInfoDevice struct { // - hdd: HDD. type CastaiInventoryV1beta1StorageInfoDeviceType string -// CastaiMetricsV1beta1ClusterMetrics defines model for castai.metrics.v1beta1.ClusterMetrics. -type CastaiMetricsV1beta1ClusterMetrics struct { - CpuAllocatableCores *float32 `json:"cpuAllocatableCores,omitempty"` - CpuRequestedCores *float32 `json:"cpuRequestedCores,omitempty"` - MemoryAllocatableGib *float32 `json:"memoryAllocatableGib,omitempty"` - MemoryRequestedGib *float32 `json:"memoryRequestedGib,omitempty"` - OnDemandNodesCount *int32 `json:"onDemandNodesCount,omitempty"` - SpotFallbackNodesCount *int32 `json:"spotFallbackNodesCount,omitempty"` - SpotNodesCount *int32 `json:"spotNodesCount,omitempty"` -} - // Operation object. type CastaiOperationsV1beta1Operation struct { // Operation creation timestamp in RFC3339Nano format. @@ -923,8 +913,7 @@ type ExternalclusterV1Cluster struct { KubernetesVersion *string `json:"kubernetesVersion"` // Method used to onboard the cluster, eg.: console, terraform. - ManagedBy *string `json:"managedBy,omitempty"` - Metrics *CastaiMetricsV1beta1ClusterMetrics `json:"metrics,omitempty"` + ManagedBy *string `json:"managedBy,omitempty"` // The name of the external cluster. Name *string `json:"name,omitempty"` @@ -1472,8 +1461,8 @@ type NodeconfigV1GKEConfig struct { DiskType *string `json:"diskType"` // Maximum number of pods that can be run on a node, which affects how many IP addresses you will need for each node. Defaults to 110. - // For Standard GKE clusters, you can run a maximum of 256 Pods on a node with a /23 range, not 512 as you might expect. This provides a buffer so that Pods don't become unschedulable due to a transient lack of IP addresses in the Pod IP range for a given node. - // For all ranges, at most half as many Pods can be scheduled as IP addresses in the range. + // For Standard GKE clusters, you can run a maximum of 256 Pods on a node with a /23 range, not 512 as you might expect. This provides a buffer so that Pods don't become unschedulable due to a + // transient lack of IP addresses in the Pod IP range for a given node. For all ranges, at most half as many Pods can be scheduled as IP addresses in the range. MaxPodsPerNode *int32 `json:"maxPodsPerNode,omitempty"` // Network tags to be added on a VM. Each tag must be 1-63 characters long, start with a lowercase letter and end with either a number or a lowercase letter. @@ -1739,10 +1728,11 @@ type NodetemplatesV1ListNodeTemplatesResponse struct { // NodetemplatesV1NewNodeTemplate defines model for nodetemplates.v1.NewNodeTemplate. type NodetemplatesV1NewNodeTemplate struct { - ConfigurationId *string `json:"configurationId,omitempty"` - Constraints *NodetemplatesV1TemplateConstraints `json:"constraints,omitempty"` - CustomInstancesEnabled *bool `json:"customInstancesEnabled"` - CustomLabel *NodetemplatesV1Label `json:"customLabel,omitempty"` + ConfigurationId *string `json:"configurationId,omitempty"` + Constraints *NodetemplatesV1TemplateConstraints `json:"constraints,omitempty"` + CustomInstancesEnabled *bool `json:"customInstancesEnabled"` + CustomInstancesWithExtendedMemoryEnabled *bool `json:"customInstancesWithExtendedMemoryEnabled"` + CustomLabel *NodetemplatesV1Label `json:"customLabel,omitempty"` // Custom labels for the template. // The passed values will be ignored if the field custom_label is present. @@ -1773,11 +1763,12 @@ type NodetemplatesV1NewNodeTemplate_CustomLabels struct { // NodetemplatesV1NodeTemplate defines model for nodetemplates.v1.NodeTemplate. type NodetemplatesV1NodeTemplate struct { - ConfigurationId *string `json:"configurationId,omitempty"` - ConfigurationName *string `json:"configurationName,omitempty"` - Constraints *NodetemplatesV1TemplateConstraints `json:"constraints,omitempty"` - CustomInstancesEnabled *bool `json:"customInstancesEnabled,omitempty"` - CustomLabel *NodetemplatesV1Label `json:"customLabel,omitempty"` + ConfigurationId *string `json:"configurationId,omitempty"` + ConfigurationName *string `json:"configurationName,omitempty"` + Constraints *NodetemplatesV1TemplateConstraints `json:"constraints,omitempty"` + CustomInstancesEnabled *bool `json:"customInstancesEnabled,omitempty"` + CustomInstancesWithExtendedMemoryEnabled *bool `json:"customInstancesWithExtendedMemoryEnabled,omitempty"` + CustomLabel *NodetemplatesV1Label `json:"customLabel,omitempty"` // Custom labels for the template. CustomLabels *NodetemplatesV1NodeTemplate_CustomLabels `json:"customLabels,omitempty"` @@ -1881,7 +1872,8 @@ type NodetemplatesV1TemplateConstraints struct { // toleration. Spot *bool `json:"spot"` - // Allowed node configuration price increase when diversifying instance types. E.g. if the value is 10%, then the overall price of diversified instance types can be 10% higher than the price of the optimal configuration. + // Allowed node configuration price increase when diversifying instance types. E.g. if the value is 10%, then the overall price of diversified instance types can be 10% higher than the price of the + // optimal configuration. SpotDiversityPriceIncreaseLimitPercent *int32 `json:"spotDiversityPriceIncreaseLimitPercent"` // Enable/disable spot interruption predictions. @@ -1912,10 +1904,11 @@ type NodetemplatesV1TemplateConstraintsInstanceFamilyConstraints struct { // NodetemplatesV1UpdateNodeTemplate defines model for nodetemplates.v1.UpdateNodeTemplate. type NodetemplatesV1UpdateNodeTemplate struct { - ConfigurationId *string `json:"configurationId,omitempty"` - Constraints *NodetemplatesV1TemplateConstraints `json:"constraints,omitempty"` - CustomInstancesEnabled *bool `json:"customInstancesEnabled"` - CustomLabel *NodetemplatesV1Label `json:"customLabel,omitempty"` + ConfigurationId *string `json:"configurationId,omitempty"` + Constraints *NodetemplatesV1TemplateConstraints `json:"constraints,omitempty"` + CustomInstancesEnabled *bool `json:"customInstancesEnabled"` + CustomInstancesWithExtendedMemoryEnabled *bool `json:"customInstancesWithExtendedMemoryEnabled"` + CustomLabel *NodetemplatesV1Label `json:"customLabel,omitempty"` // Custom labels for the template. // The passed values will be ignored if the field custom_label is present. @@ -2372,12 +2365,6 @@ type ScheduledRebalancingAPIUpdateRebalancingJobJSONBody = ScheduledrebalancingV // ScheduledRebalancingAPIPreviewRebalancingScheduleJSONBody defines parameters for ScheduledRebalancingAPIPreviewRebalancingSchedule. type ScheduledRebalancingAPIPreviewRebalancingScheduleJSONBody = ScheduledrebalancingV1RebalancingScheduleUpdate -// ExternalClusterAPIListClustersParams defines parameters for ExternalClusterAPIListClusters. -type ExternalClusterAPIListClustersParams struct { - // Include metrics with cluster response. - IncludeMetrics *bool `form:"includeMetrics,omitempty" json:"includeMetrics,omitempty"` -} - // ExternalClusterAPIRegisterClusterJSONBody defines parameters for ExternalClusterAPIRegisterCluster. type ExternalClusterAPIRegisterClusterJSONBody = ExternalclusterV1RegisterClusterRequest diff --git a/castai/sdk/client.gen.go b/castai/sdk/client.gen.go index 85a90ac5..b2ffd674 100644 --- a/castai/sdk/client.gen.go +++ b/castai/sdk/client.gen.go @@ -215,7 +215,7 @@ type ClientInterface interface { ScheduledRebalancingAPIPreviewRebalancingSchedule(ctx context.Context, clusterId string, body ScheduledRebalancingAPIPreviewRebalancingScheduleJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ExternalClusterAPIListClusters request - ExternalClusterAPIListClusters(ctx context.Context, params *ExternalClusterAPIListClustersParams, reqEditors ...RequestEditorFn) (*http.Response, error) + ExternalClusterAPIListClusters(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) // ExternalClusterAPIRegisterCluster request with any body ExternalClusterAPIRegisterClusterWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -957,8 +957,8 @@ func (c *Client) ScheduledRebalancingAPIPreviewRebalancingSchedule(ctx context.C return c.Client.Do(req) } -func (c *Client) ExternalClusterAPIListClusters(ctx context.Context, params *ExternalClusterAPIListClustersParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewExternalClusterAPIListClustersRequest(c.Server, params) +func (c *Client) ExternalClusterAPIListClusters(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewExternalClusterAPIListClustersRequest(c.Server) if err != nil { return nil, err } @@ -3167,7 +3167,7 @@ func NewScheduledRebalancingAPIPreviewRebalancingScheduleRequestWithBody(server } // NewExternalClusterAPIListClustersRequest generates requests for ExternalClusterAPIListClusters -func NewExternalClusterAPIListClustersRequest(server string, params *ExternalClusterAPIListClustersParams) (*http.Request, error) { +func NewExternalClusterAPIListClustersRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -3185,26 +3185,6 @@ func NewExternalClusterAPIListClustersRequest(server string, params *ExternalClu return nil, err } - queryValues := queryURL.Query() - - if params.IncludeMetrics != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "includeMetrics", runtime.ParamLocationQuery, *params.IncludeMetrics); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -5508,7 +5488,7 @@ type ClientWithResponsesInterface interface { ScheduledRebalancingAPIPreviewRebalancingScheduleWithResponse(ctx context.Context, clusterId string, body ScheduledRebalancingAPIPreviewRebalancingScheduleJSONRequestBody) (*ScheduledRebalancingAPIPreviewRebalancingScheduleResponse, error) // ExternalClusterAPIListClusters request - ExternalClusterAPIListClustersWithResponse(ctx context.Context, params *ExternalClusterAPIListClustersParams) (*ExternalClusterAPIListClustersResponse, error) + ExternalClusterAPIListClustersWithResponse(ctx context.Context) (*ExternalClusterAPIListClustersResponse, error) // ExternalClusterAPIRegisterCluster request with any body ExternalClusterAPIRegisterClusterWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*ExternalClusterAPIRegisterClusterResponse, error) @@ -8625,8 +8605,8 @@ func (c *ClientWithResponses) ScheduledRebalancingAPIPreviewRebalancingScheduleW } // ExternalClusterAPIListClustersWithResponse request returning *ExternalClusterAPIListClustersResponse -func (c *ClientWithResponses) ExternalClusterAPIListClustersWithResponse(ctx context.Context, params *ExternalClusterAPIListClustersParams) (*ExternalClusterAPIListClustersResponse, error) { - rsp, err := c.ExternalClusterAPIListClusters(ctx, params) +func (c *ClientWithResponses) ExternalClusterAPIListClustersWithResponse(ctx context.Context) (*ExternalClusterAPIListClustersResponse, error) { + rsp, err := c.ExternalClusterAPIListClusters(ctx) if err != nil { return nil, err } diff --git a/castai/sdk/mock/client.go b/castai/sdk/mock/client.go index 3cbf15b7..efd57f72 100644 --- a/castai/sdk/mock/client.go +++ b/castai/sdk/mock/client.go @@ -696,9 +696,9 @@ func (mr *MockClientInterfaceMockRecorder) ExternalClusterAPIHandleCloudEventWit } // ExternalClusterAPIListClusters mocks base method. -func (m *MockClientInterface) ExternalClusterAPIListClusters(ctx context.Context, params *sdk.ExternalClusterAPIListClustersParams, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { +func (m *MockClientInterface) ExternalClusterAPIListClusters(ctx context.Context, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() - varargs := []interface{}{ctx, params} + varargs := []interface{}{ctx} for _, a := range reqEditors { varargs = append(varargs, a) } @@ -709,9 +709,9 @@ func (m *MockClientInterface) ExternalClusterAPIListClusters(ctx context.Context } // ExternalClusterAPIListClusters indicates an expected call of ExternalClusterAPIListClusters. -func (mr *MockClientInterfaceMockRecorder) ExternalClusterAPIListClusters(ctx, params interface{}, reqEditors ...interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) ExternalClusterAPIListClusters(ctx interface{}, reqEditors ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, params}, reqEditors...) + varargs := append([]interface{}{ctx}, reqEditors...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExternalClusterAPIListClusters", reflect.TypeOf((*MockClientInterface)(nil).ExternalClusterAPIListClusters), varargs...) } @@ -2864,18 +2864,18 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) ExternalClusterAPIHandle } // ExternalClusterAPIListClustersWithResponse mocks base method. -func (m *MockClientWithResponsesInterface) ExternalClusterAPIListClustersWithResponse(ctx context.Context, params *sdk.ExternalClusterAPIListClustersParams) (*sdk.ExternalClusterAPIListClustersResponse, error) { +func (m *MockClientWithResponsesInterface) ExternalClusterAPIListClustersWithResponse(ctx context.Context) (*sdk.ExternalClusterAPIListClustersResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ExternalClusterAPIListClustersWithResponse", ctx, params) + ret := m.ctrl.Call(m, "ExternalClusterAPIListClustersWithResponse", ctx) ret0, _ := ret[0].(*sdk.ExternalClusterAPIListClustersResponse) ret1, _ := ret[1].(error) return ret0, ret1 } // ExternalClusterAPIListClustersWithResponse indicates an expected call of ExternalClusterAPIListClustersWithResponse. -func (mr *MockClientWithResponsesInterfaceMockRecorder) ExternalClusterAPIListClustersWithResponse(ctx, params interface{}) *gomock.Call { +func (mr *MockClientWithResponsesInterfaceMockRecorder) ExternalClusterAPIListClustersWithResponse(ctx interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExternalClusterAPIListClustersWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ExternalClusterAPIListClustersWithResponse), ctx, params) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExternalClusterAPIListClustersWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ExternalClusterAPIListClustersWithResponse), ctx) } // ExternalClusterAPIListNodesWithResponse mocks base method. diff --git a/docs/resources/node_template.md b/docs/resources/node_template.md index 30dbf73a..e91ce337 100644 --- a/docs/resources/node_template.md +++ b/docs/resources/node_template.md @@ -25,6 +25,7 @@ CAST AI node template resource to manage node templates - `configuration_id` (String) CAST AI node configuration id to be used for node template. - `constraints` (Block List, Max: 1) (see [below for nested schema](#nestedblock--constraints)) - `custom_instances_enabled` (Boolean) Marks whether custom instances should be used when deciding which parts of inventory are available. Custom instances are only supported in GCP. +- `custom_instances_with_extended_memory_enabled` (Boolean) Marks whether custom instances with extended memory should be used when deciding which parts of inventory are available. Custom instances are only supported in GCP. - `custom_labels` (Map of String) Custom labels to be added to nodes created from this template. - `custom_taints` (Block List) Custom taints to be added to the nodes created from this template. `shouldTaint` has to be `true` in order to create/update the node template with custom taints. If `shouldTaint` is `true`, but no custom taints are provided, the nodes will be tainted with the default node template taint. (see [below for nested schema](#nestedblock--custom_taints)) - `is_default` (Boolean) Flag whether the node template is default.