diff --git a/castai/resource_node_configuration.go b/castai/resource_node_configuration.go index d339add8c..2ec895ee4 100644 --- a/castai/resource_node_configuration.go +++ b/castai/resource_node_configuration.go @@ -39,6 +39,7 @@ const ( FieldNodeConfigurationGKE = "gke" FieldNodeConfigurationEKSTargetGroup = "target_group" FieldNodeConfigurationAKSImageFamily = "aks_image_family" + FieldNodeConfigurationAKSEphemeralOSDisk = "ephemeral_os_disk" FieldNodeConfigurationEKSImageFamily = "eks_image_family" FieldNodeConfigurationLoadbalancers = "loadbalancers" FieldNodeConfigurationAKSLoadbalancerIPPools = "ip_based_backend_pools" @@ -52,8 +53,12 @@ const ( ) const ( - aksImageFamilyUbuntu = "ubuntu" - aksImageFamilyAzureLinux = "azure-linux" + aksImageFamilyUbuntu = "ubuntu" + aksImageFamilyAzureLinux = "azure-linux" + aksEphemeralDiskPlacementCacheDisk = "cacheDisk" + aksEphemeralDiskPlacementResourceDisk = "resourceDisk" + aksDiskCacheReadOnly = "ReadOnly" + aksDiskCacheReadWrite = "ReadWrite" ) func resourceNodeConfiguration() *schema.Resource { @@ -332,6 +337,34 @@ func resourceNodeConfiguration() *schema.Resource { return strings.EqualFold(oldValue, newValue) }, }, + FieldNodeConfigurationAKSEphemeralOSDisk: { + Type: schema.TypeList, + Optional: true, + Description: "Ephemeral OS disk configuration for CAST provisioned nodes", + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "placement": { + Type: schema.TypeString, + Required: true, + Description: "Placement of the ephemeral OS disk. One of: cacheDisk, resourceDisk", + ValidateDiagFunc: validation.ToDiagFunc(validation.StringInSlice([]string{aksEphemeralDiskPlacementCacheDisk, aksEphemeralDiskPlacementResourceDisk}, true)), + DiffSuppressFunc: func(k, oldValue, newValue string, d *schema.ResourceData) bool { + return strings.EqualFold(oldValue, newValue) + }, + }, + "cache": { + Type: schema.TypeString, + Optional: true, + Description: "Cache type for the ephemeral OS disk. One of: ReadOnly, ReadWrite", + ValidateDiagFunc: validation.ToDiagFunc(validation.StringInSlice([]string{aksDiskCacheReadOnly, aksDiskCacheReadWrite}, true)), + DiffSuppressFunc: func(k, oldValue, newValue string, d *schema.ResourceData) bool { + return strings.EqualFold(oldValue, newValue) + }, + }, + }, + }, + }, FieldNodeConfigurationLoadbalancers: { Type: schema.TypeList, Optional: true, @@ -983,6 +1016,10 @@ func toAKSSConfig(obj map[string]interface{}) *sdk.NodeconfigV1AKSConfig { out.OsDiskType = toAKSOSDiskType(v) } + if v, ok := obj[FieldNodeConfigurationAKSEphemeralOSDisk].([]any); ok && len(v) > 0 { + out.OsDiskEphemeral = toAKSEphemeralOSDisk(v[0]) + } + if v, ok := obj[FieldNodeConfigurationAKSImageFamily].(string); ok { out.ImageFamily = toAKSImageFamily(v) } @@ -994,6 +1031,34 @@ func toAKSSConfig(obj map[string]interface{}) *sdk.NodeconfigV1AKSConfig { return out } +func toAKSEphemeralOSDisk(obj any) *sdk.NodeconfigV1AKSConfigOsDiskEphemeral { + if obj == nil { + return nil + } + + osDisk := &sdk.NodeconfigV1AKSConfigOsDiskEphemeral{} + + if v, ok := obj.(map[string]any)["placement"].(string); ok && v != "" { + switch v { + case aksEphemeralDiskPlacementResourceDisk: + osDisk.Placement = lo.ToPtr(sdk.PLACEMENTRESOURCEDISK) + case aksEphemeralDiskPlacementCacheDisk: + osDisk.Placement = lo.ToPtr(sdk.PLACEMENTCACHEDISK) + } + } + + if v, ok := obj.(map[string]any)["cache"].(string); ok && v != "" { + switch v { + case aksDiskCacheReadWrite: + osDisk.CacheType = lo.ToPtr(sdk.NodeconfigV1AKSConfigOsDiskEphemeralCacheTypeREADWRITE) + case aksDiskCacheReadOnly: + osDisk.CacheType = lo.ToPtr(sdk.NodeconfigV1AKSConfigOsDiskEphemeralCacheTypeREADONLY) + } + } + + return osDisk +} + func toAksLoadBalancers(obj []interface{}) *[]sdk.NodeconfigV1AKSConfigLoadBalancers { if obj == nil { return nil @@ -1110,6 +1175,37 @@ func flattenAKSConfig(config *sdk.NodeconfigV1AKSConfig) []map[string]interface{ m[FieldNodeConfigurationLoadbalancers] = fromAksLoadBalancers(*v) } + if v := config.OsDiskEphemeral; v != nil { + m[FieldNodeConfigurationAKSEphemeralOSDisk] = fromAKSEphemeralOSDisk(v) + } + + return []map[string]interface{}{m} +} + +func fromAKSEphemeralOSDisk(sdkEph *sdk.NodeconfigV1AKSConfigOsDiskEphemeral) []map[string]interface{} { + if sdkEph == nil { + return nil + } + + m := map[string]interface{}{} + if sdkEph.Placement != nil { + switch *sdkEph.Placement { + case sdk.PLACEMENTRESOURCEDISK: + m["placement"] = aksEphemeralDiskPlacementResourceDisk + case sdk.PLACEMENTCACHEDISK: + m["placement"] = aksEphemeralDiskPlacementCacheDisk + } + } + + if sdkEph.CacheType != nil { + switch *sdkEph.CacheType { + case sdk.NodeconfigV1AKSConfigOsDiskEphemeralCacheTypeREADWRITE: + m["cache"] = aksDiskCacheReadWrite + case sdk.NodeconfigV1AKSConfigOsDiskEphemeralCacheTypeREADONLY: + m["cache"] = aksDiskCacheReadOnly + } + } + return []map[string]interface{}{m} } diff --git a/castai/resource_node_configuration_aks_test.go b/castai/resource_node_configuration_aks_test.go index 09cf47fbd..b45e937de 100644 --- a/castai/resource_node_configuration_aks_test.go +++ b/castai/resource_node_configuration_aks_test.go @@ -43,6 +43,8 @@ func TestAccResourceNodeConfiguration_aks(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "min_disk_size", "121"), resource.TestCheckResourceAttr(resourceName, "aks.0.max_pods_per_node", "32"), resource.TestCheckResourceAttr(resourceName, "aks.0.aks_image_family", "azure-linux"), + resource.TestCheckResourceAttr(resourceName, "aks.0.ephemeral_os_disk.0.placement", "cacheDisk"), + resource.TestCheckResourceAttr(resourceName, "aks.0.ephemeral_os_disk.0.cache", "ReadOnly"), resource.TestCheckResourceAttr(resourceName, "aks.0.loadbalancers.0.name", "test-lb"), resource.TestCheckResourceAttr(resourceName, "aks.0.loadbalancers.0.ip_based_backend_pools.0.name", "test"), resource.TestCheckResourceAttr(resourceName, "eks.#", "0"), @@ -102,6 +104,10 @@ resource "castai_node_configuration" "test" { aks { max_pods_per_node = 32 aks_image_family = "azure-linux" + ephemeral_os_disk { + placement = "cacheDisk" + cache = "ReadOnly" + } loadbalancers { name = "test-lb" ip_based_backend_pools { diff --git a/castai/resource_sso_connection_test.go b/castai/resource_sso_connection_test.go index 739a6977f..7d73c2744 100644 --- a/castai/resource_sso_connection_test.go +++ b/castai/resource_sso_connection_test.go @@ -136,6 +136,7 @@ func TestSSOConnection_CreateADDConnector(t *testing.T) { "clientSecret": "test_secret" }, "emailDomain": "test_email", + "defaultRoleId": null, "name": "test_sso" } `) @@ -213,6 +214,7 @@ func TestSSOConnection_CreateADDConnector(t *testing.T) { "clientSecret": "test_secret" }, "emailDomain": "test_email", + "defaultRoleId": null, "additionalEmailDomains": ["test_domain1.com", "test_domain2.com"], "name": "test_sso" } @@ -294,6 +296,7 @@ func TestSSOConnection_CreateOktaConnector(t *testing.T) { "clientSecret": "test_secret" }, "emailDomain": "test_email", + "defaultRoleId": null, "name": "test_sso" }`) @@ -391,6 +394,7 @@ func TestSSOConnection_UpdateADDConnector(t *testing.T) { "clientId": "updated_client_id", "clientSecret": "updated_client_secret" }, + "defaultRoleId": null, "name": "updated_name" }`) @@ -452,7 +456,6 @@ func TestSSOConnection_UpdateADDConnector(t *testing.T) { } connectionID := "b6bfc074-a267-400f-b8f1-db0850c369b1" - raw := make(map[string]interface{}) raw[FieldSSOConnectionName] = "updated_name" @@ -480,6 +483,7 @@ func TestSSOConnection_UpdateADDConnector(t *testing.T) { "clientSecret": "updated_client_secret" }, "name": "updated_name", + "defaultRoleId": null, "additionalEmailDomains": ["updated_domain_one", "updated_domain_two"] }`) @@ -570,6 +574,7 @@ func TestSSOConnection_UpdateOktaConnector(t *testing.T) { "clientId": "updated_client_id", "clientSecret": "updated_client_secret" }, + "defaultRoleId": null, "name": "updated_name" }`) diff --git a/castai/sdk/api.gen.go b/castai/sdk/api.gen.go index 60fb6f565..0219aa11c 100644 --- a/castai/sdk/api.gen.go +++ b/castai/sdk/api.gen.go @@ -1774,6 +1774,9 @@ type CastaiServiceaccountsV1beta1DeleteServiceAccountKeyResponse = map[string]in // DeleteServiceAccountResponse is the response for deleting a service account. type CastaiServiceaccountsV1beta1DeleteServiceAccountResponse = map[string]interface{} +// DeleteServiceAccountsResponse is the response for batch deleting service accounts. +type CastaiServiceaccountsV1beta1DeleteServiceAccountsResponse = map[string]interface{} + // GetServiceAccountKeyResponse is the response for getting a service account key. type CastaiServiceaccountsV1beta1GetServiceAccountKeyResponse struct { // Key is the key for the service account. @@ -1911,6 +1914,9 @@ type CastaiSsoV1beta1CreateSSOConnection struct { // Additional list of email domains assigned to SSO connection. AdditionalEmailDomains *[]string `json:"additionalEmailDomains,omitempty"` + // ID of default role for new users signing up with SSO. + DefaultRoleId *string `json:"defaultRoleId"` + // EmailDomain is the email domain of the connection. EmailDomain string `json:"emailDomain"` @@ -1979,6 +1985,9 @@ type CastaiSsoV1beta1SSOConnection struct { // CreatedAt is the time when the connection was created. CreatedAt *time.Time `json:"createdAt,omitempty"` + // ID of default role for new users signing up with SSO. + DefaultRoleId *string `json:"defaultRoleId,omitempty"` + // EmailDomain is the email domain of the connection. EmailDomain string `json:"emailDomain"` @@ -2025,6 +2034,9 @@ type CastaiSsoV1beta1UpdateSSOConnection struct { // Additional list of email domains assigned to SSO connection. AdditionalEmailDomains *[]string `json:"additionalEmailDomains,omitempty"` + // ID of default role for new users signing up with SSO. + DefaultRoleId *string `json:"defaultRoleId"` + // EmailDomain is the email domain of the connection. EmailDomain *string `json:"emailDomain,omitempty"` @@ -5197,6 +5209,12 @@ type RbacServiceAPICreateRoleBindingsJSONBody = []CastaiRbacV1beta1CreateRoleBin // RbacServiceAPIUpdateRoleBindingJSONBody defines parameters for RbacServiceAPIUpdateRoleBinding. type RbacServiceAPIUpdateRoleBindingJSONBody = RoleBindingIsTheRoleBindingToBeUpdated +// ServiceAccountsAPIDeleteServiceAccountsParams defines parameters for ServiceAccountsAPIDeleteServiceAccounts. +type ServiceAccountsAPIDeleteServiceAccountsParams struct { + // ServiceAccountIDs is the list of service account ids to be deleted. + ServiceAccountIds []string `form:"serviceAccountIds" json:"serviceAccountIds"` +} + // ServiceAccountsAPIListServiceAccountsParams defines parameters for ServiceAccountsAPIListServiceAccounts. type ServiceAccountsAPIListServiceAccountsParams struct { PageLimit *string `form:"page.limit,omitempty" json:"page.limit,omitempty"` diff --git a/castai/sdk/client.gen.go b/castai/sdk/client.gen.go index 19890dfb8..b0d092cf1 100644 --- a/castai/sdk/client.gen.go +++ b/castai/sdk/client.gen.go @@ -433,6 +433,9 @@ type ClientInterface interface { RbacServiceAPIUpdateRoleBinding(ctx context.Context, organizationId string, roleBindingId string, body RbacServiceAPIUpdateRoleBindingJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // ServiceAccountsAPIDeleteServiceAccounts request + ServiceAccountsAPIDeleteServiceAccounts(ctx context.Context, organizationId string, params *ServiceAccountsAPIDeleteServiceAccountsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // ServiceAccountsAPIListServiceAccounts request ServiceAccountsAPIListServiceAccounts(ctx context.Context, organizationId string, params *ServiceAccountsAPIListServiceAccountsParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -2156,6 +2159,18 @@ func (c *Client) RbacServiceAPIUpdateRoleBinding(ctx context.Context, organizati return c.Client.Do(req) } +func (c *Client) ServiceAccountsAPIDeleteServiceAccounts(ctx context.Context, organizationId string, params *ServiceAccountsAPIDeleteServiceAccountsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewServiceAccountsAPIDeleteServiceAccountsRequest(c.Server, organizationId, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) ServiceAccountsAPIListServiceAccounts(ctx context.Context, organizationId string, params *ServiceAccountsAPIListServiceAccountsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewServiceAccountsAPIListServiceAccountsRequest(c.Server, organizationId, params) if err != nil { @@ -7335,6 +7350,56 @@ func NewRbacServiceAPIUpdateRoleBindingRequestWithBody(server string, organizati return req, nil } +// NewServiceAccountsAPIDeleteServiceAccountsRequest generates requests for ServiceAccountsAPIDeleteServiceAccounts +func NewServiceAccountsAPIDeleteServiceAccountsRequest(server string, organizationId string, params *ServiceAccountsAPIDeleteServiceAccountsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "organizationId", runtime.ParamLocationPath, organizationId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/organizations/%s/service-accounts", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "serviceAccountIds", runtime.ParamLocationQuery, params.ServiceAccountIds); 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("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewServiceAccountsAPIListServiceAccountsRequest generates requests for ServiceAccountsAPIListServiceAccounts func NewServiceAccountsAPIListServiceAccountsRequest(server string, organizationId string, params *ServiceAccountsAPIListServiceAccountsParams) (*http.Request, error) { var err error @@ -10493,6 +10558,9 @@ type ClientWithResponsesInterface interface { RbacServiceAPIUpdateRoleBindingWithResponse(ctx context.Context, organizationId string, roleBindingId string, body RbacServiceAPIUpdateRoleBindingJSONRequestBody) (*RbacServiceAPIUpdateRoleBindingResponse, error) + // ServiceAccountsAPIDeleteServiceAccounts request + ServiceAccountsAPIDeleteServiceAccountsWithResponse(ctx context.Context, organizationId string, params *ServiceAccountsAPIDeleteServiceAccountsParams) (*ServiceAccountsAPIDeleteServiceAccountsResponse, error) + // ServiceAccountsAPIListServiceAccounts request ServiceAccountsAPIListServiceAccountsWithResponse(ctx context.Context, organizationId string, params *ServiceAccountsAPIListServiceAccountsParams) (*ServiceAccountsAPIListServiceAccountsResponse, error) @@ -13441,6 +13509,37 @@ func (r RbacServiceAPIUpdateRoleBindingResponse) GetBody() []byte { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +type ServiceAccountsAPIDeleteServiceAccountsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *CastaiServiceaccountsV1beta1DeleteServiceAccountsResponse + JSON204 *map[string]interface{} +} + +// Status returns HTTPResponse.Status +func (r ServiceAccountsAPIDeleteServiceAccountsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ServiceAccountsAPIDeleteServiceAccountsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r ServiceAccountsAPIDeleteServiceAccountsResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + type ServiceAccountsAPIListServiceAccountsResponse struct { Body []byte HTTPResponse *http.Response @@ -16278,6 +16377,15 @@ func (c *ClientWithResponses) RbacServiceAPIUpdateRoleBindingWithResponse(ctx co return ParseRbacServiceAPIUpdateRoleBindingResponse(rsp) } +// ServiceAccountsAPIDeleteServiceAccountsWithResponse request returning *ServiceAccountsAPIDeleteServiceAccountsResponse +func (c *ClientWithResponses) ServiceAccountsAPIDeleteServiceAccountsWithResponse(ctx context.Context, organizationId string, params *ServiceAccountsAPIDeleteServiceAccountsParams) (*ServiceAccountsAPIDeleteServiceAccountsResponse, error) { + rsp, err := c.ServiceAccountsAPIDeleteServiceAccounts(ctx, organizationId, params) + if err != nil { + return nil, err + } + return ParseServiceAccountsAPIDeleteServiceAccountsResponse(rsp) +} + // ServiceAccountsAPIListServiceAccountsWithResponse request returning *ServiceAccountsAPIListServiceAccountsResponse func (c *ClientWithResponses) ServiceAccountsAPIListServiceAccountsWithResponse(ctx context.Context, organizationId string, params *ServiceAccountsAPIListServiceAccountsParams) (*ServiceAccountsAPIListServiceAccountsResponse, error) { rsp, err := c.ServiceAccountsAPIListServiceAccounts(ctx, organizationId, params) @@ -19290,6 +19398,39 @@ func ParseRbacServiceAPIUpdateRoleBindingResponse(rsp *http.Response) (*RbacServ return response, nil } +// ParseServiceAccountsAPIDeleteServiceAccountsResponse parses an HTTP response from a ServiceAccountsAPIDeleteServiceAccountsWithResponse call +func ParseServiceAccountsAPIDeleteServiceAccountsResponse(rsp *http.Response) (*ServiceAccountsAPIDeleteServiceAccountsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &ServiceAccountsAPIDeleteServiceAccountsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest CastaiServiceaccountsV1beta1DeleteServiceAccountsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 204: + var dest map[string]interface{} + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON204 = &dest + + } + + return response, nil +} + // ParseServiceAccountsAPIListServiceAccountsResponse parses an HTTP response from a ServiceAccountsAPIListServiceAccountsWithResponse call func ParseServiceAccountsAPIListServiceAccountsResponse(rsp *http.Response) (*ServiceAccountsAPIListServiceAccountsResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) diff --git a/castai/sdk/mock/client.go b/castai/sdk/mock/client.go index 9e50b928d..295ac62be 100644 --- a/castai/sdk/mock/client.go +++ b/castai/sdk/mock/client.go @@ -3115,6 +3115,26 @@ func (mr *MockClientInterfaceMockRecorder) ServiceAccountsAPIDeleteServiceAccoun return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ServiceAccountsAPIDeleteServiceAccountKey", reflect.TypeOf((*MockClientInterface)(nil).ServiceAccountsAPIDeleteServiceAccountKey), varargs...) } +// ServiceAccountsAPIDeleteServiceAccounts mocks base method. +func (m *MockClientInterface) ServiceAccountsAPIDeleteServiceAccounts(ctx context.Context, organizationId string, params *sdk.ServiceAccountsAPIDeleteServiceAccountsParams, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, organizationId, params} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ServiceAccountsAPIDeleteServiceAccounts", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ServiceAccountsAPIDeleteServiceAccounts indicates an expected call of ServiceAccountsAPIDeleteServiceAccounts. +func (mr *MockClientInterfaceMockRecorder) ServiceAccountsAPIDeleteServiceAccounts(ctx, organizationId, params interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, organizationId, params}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ServiceAccountsAPIDeleteServiceAccounts", reflect.TypeOf((*MockClientInterface)(nil).ServiceAccountsAPIDeleteServiceAccounts), varargs...) +} + // ServiceAccountsAPIGetServiceAccount mocks base method. func (m *MockClientInterface) ServiceAccountsAPIGetServiceAccount(ctx context.Context, organizationId, serviceAccountId string, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -9458,6 +9478,41 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) ServiceAccountsAPIDelete return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ServiceAccountsAPIDeleteServiceAccountWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ServiceAccountsAPIDeleteServiceAccountWithResponse), ctx, organizationId, serviceAccountId) } +// ServiceAccountsAPIDeleteServiceAccounts mocks base method. +func (m *MockClientWithResponsesInterface) ServiceAccountsAPIDeleteServiceAccounts(ctx context.Context, organizationId string, params *sdk.ServiceAccountsAPIDeleteServiceAccountsParams, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, organizationId, params} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ServiceAccountsAPIDeleteServiceAccounts", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ServiceAccountsAPIDeleteServiceAccounts indicates an expected call of ServiceAccountsAPIDeleteServiceAccounts. +func (mr *MockClientWithResponsesInterfaceMockRecorder) ServiceAccountsAPIDeleteServiceAccounts(ctx, organizationId, params interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, organizationId, params}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ServiceAccountsAPIDeleteServiceAccounts", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ServiceAccountsAPIDeleteServiceAccounts), varargs...) +} + +// ServiceAccountsAPIDeleteServiceAccountsWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) ServiceAccountsAPIDeleteServiceAccountsWithResponse(ctx context.Context, organizationId string, params *sdk.ServiceAccountsAPIDeleteServiceAccountsParams) (*sdk.ServiceAccountsAPIDeleteServiceAccountsResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ServiceAccountsAPIDeleteServiceAccountsWithResponse", ctx, organizationId, params) + ret0, _ := ret[0].(*sdk.ServiceAccountsAPIDeleteServiceAccountsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ServiceAccountsAPIDeleteServiceAccountsWithResponse indicates an expected call of ServiceAccountsAPIDeleteServiceAccountsWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) ServiceAccountsAPIDeleteServiceAccountsWithResponse(ctx, organizationId, params interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ServiceAccountsAPIDeleteServiceAccountsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ServiceAccountsAPIDeleteServiceAccountsWithResponse), ctx, organizationId, params) +} + // ServiceAccountsAPIGetServiceAccount mocks base method. func (m *MockClientWithResponsesInterface) ServiceAccountsAPIGetServiceAccount(ctx context.Context, organizationId, serviceAccountId string, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() diff --git a/docs/resources/node_configuration.md b/docs/resources/node_configuration.md index 669a4edbd..7aac32a4b 100644 --- a/docs/resources/node_configuration.md +++ b/docs/resources/node_configuration.md @@ -88,10 +88,23 @@ resource "castai_node_configuration" "default" { Optional: - `aks_image_family` (String) Image OS Family to use when provisioning node in AKS. If both image and family are provided, the system will use provided image and provisioning logic for given family. If only image family is provided, the system will attempt to resolve the latest image from that family based on kubernetes version and node architecture. If image family is omitted, a default family (based on cloud provider) will be used. See Cast.ai documentation for details. Possible values: (ubuntu,azure-linux) +- `ephemeral_os_disk` (Block List, Max: 1) Ephemeral OS disk configuration for CAST provisioned nodes (see [below for nested schema](#nestedblock--aks--ephemeral_os_disk)) - `loadbalancers` (Block List) Load balancer configuration for CAST provisioned nodes (see [below for nested schema](#nestedblock--aks--loadbalancers)) - `max_pods_per_node` (Number) 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 30 - `os_disk_type` (String) Type of managed os disk attached to the node. (See [disk types](https://learn.microsoft.com/en-us/azure/virtual-machines/disks-types)). One of: standard, standard-ssd, premium-ssd (ultra and premium-ssd-v2 are not supported for os disk) + +### Nested Schema for `aks.ephemeral_os_disk` + +Required: + +- `placement` (String) Placement of the ephemeral OS disk. One of: cacheDisk, resourceDisk + +Optional: + +- `cache` (String) Cache type for the ephemeral OS disk. One of: ReadOnly, ReadWrite + + ### Nested Schema for `aks.loadbalancers`