diff --git a/castai/resource_node_configuration.go b/castai/resource_node_configuration.go index 439d321f..2cf247d1 100644 --- a/castai/resource_node_configuration.go +++ b/castai/resource_node_configuration.go @@ -83,8 +83,8 @@ func resourceNodeConfiguration() *schema.Resource { Type: schema.TypeInt, Optional: true, Default: 100, - ValidateDiagFunc: validation.ToDiagFunc(validation.IntBetween(30, 1000)), - Description: "Minimal disk size in GiB. Defaults to 100, min 30, max 1000", + ValidateDiagFunc: validation.ToDiagFunc(validation.IntBetween(30, 65536)), + Description: "Minimal disk size in GiB. Defaults to 100, min 30, max 65536", }, FieldNodeConfigurationSubnets: { Type: schema.TypeList, diff --git a/castai/sdk/api.gen.go b/castai/sdk/api.gen.go index 41883823..36f7d3a1 100644 --- a/castai/sdk/api.gen.go +++ b/castai/sdk/api.gen.go @@ -75,6 +75,22 @@ const ( Worker ExternalclusterV1NodeType = "worker" ) +// Defines values for K8sSelectorV1Operator. +const ( + DoesNotExist K8sSelectorV1Operator = "DoesNotExist" + DoesNotExist1 K8sSelectorV1Operator = "doesNotExist" + Exists K8sSelectorV1Operator = "Exists" + Exists1 K8sSelectorV1Operator = "exists" + Gt K8sSelectorV1Operator = "Gt" + Gt1 K8sSelectorV1Operator = "gt" + IN K8sSelectorV1Operator = "IN" + In K8sSelectorV1Operator = "in" + Lt K8sSelectorV1Operator = "Lt" + Lt1 K8sSelectorV1Operator = "lt" + NotIn K8sSelectorV1Operator = "notIn" + NotInt K8sSelectorV1Operator = "NotInt" +) + // Defines values for NodeconfigV1AKSConfigOsDiskType. const ( OSDISKTYPEPREMIUMSSD NodeconfigV1AKSConfigOsDiskType = "OS_DISK_TYPE_PREMIUM_SSD" @@ -149,6 +165,9 @@ type CastaiAuthtokenV1beta1AuthToken struct { // (read only) Time when the token was created (unix timestamp in nanoseconds). CreatedAt *time.Time `json:"createdAt,omitempty"` + // created_by is used to link this token to a user who created it. + CreatedBy *string `json:"createdBy"` + // (read only) ID of the token. Id *string `json:"id,omitempty"` @@ -156,10 +175,13 @@ type CastaiAuthtokenV1beta1AuthToken struct { LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` // (required) User provided name of the token. - Name *string `json:"name,omitempty"` + Name string `json:"name"` // whether token has readonly permissions. - Readonly *bool `json:"readonly,omitempty"` + Readonly bool `json:"readonly"` + + // service_account_id is used to link this token to a service account. + ServiceAccountId *string `json:"serviceAccountId"` // (read only, visible once on creation) actual token used to authenticate via api. Token *string `json:"token"` @@ -1339,6 +1361,9 @@ type ExternalclusterV1Node_Labels struct { // NodeAffinity provides control over the assignment of individual nodes to dedicated host instances. type ExternalclusterV1NodeAffinity struct { + // THe affinity rules required for choosing the group. + Affinity *[]K8sSelectorV1KubernetesNodeAffinity `json:"affinity,omitempty"` + // The name of the dedicated group. DedicatedGroup *string `json:"dedicatedGroup"` } @@ -1547,6 +1572,28 @@ type ExternalclusterV1Zone struct { Name *string `json:"name,omitempty"` } +// K8sSelectorV1KubernetesNodeAffinity defines model for k8s_selector.v1.KubernetesNodeAffinity. +type K8sSelectorV1KubernetesNodeAffinity struct { + Key string `json:"key"` + + // - IN: In values + // - NotInt: Not int values + // - Exists: Just exist + // - DoesNotExist: Values does not exist + // - Gt: Greater then + // - Lt: Lower then + Operator K8sSelectorV1Operator `json:"operator"` + Values []string `json:"values"` +} + +// - IN: In values +// - NotInt: Not int values +// - Exists: Just exist +// - DoesNotExist: Values does not exist +// - Gt: Greater then +// - Lt: Lower then +type K8sSelectorV1Operator string + // NodeconfigV1AKSConfig defines model for nodeconfig.v1.AKSConfig. type NodeconfigV1AKSConfig struct { // Maximum number of pods that can be run on a node, which affects how many IP addresses you will need for each node. @@ -2500,7 +2547,11 @@ type ScheduledrebalancingV1TriggerConditions struct { // AuthTokenAPIListAuthTokensParams defines parameters for AuthTokenAPIListAuthTokens. type AuthTokenAPIListAuthTokensParams struct { + // User id to filter by, if this is set we will only return tokens that have this user id. UserId *string `form:"userId,omitempty" json:"userId,omitempty"` + + // Service account id to filter by, if this is set we will only return tokens that have this service account id ignoring users_id. + ServiceAccountId *string `form:"serviceAccountId,omitempty" json:"serviceAccountId,omitempty"` } // AuthTokenAPICreateAuthTokenJSONBody defines parameters for AuthTokenAPICreateAuthToken. diff --git a/castai/sdk/client.gen.go b/castai/sdk/client.gen.go index c6595b3a..158c367d 100644 --- a/castai/sdk/client.gen.go +++ b/castai/sdk/client.gen.go @@ -1881,6 +1881,22 @@ func NewAuthTokenAPIListAuthTokensRequest(server string, params *AuthTokenAPILis } + if params.ServiceAccountId != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "serviceAccountId", runtime.ParamLocationQuery, *params.ServiceAccountId); 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) diff --git a/docs/resources/node_configuration.md b/docs/resources/node_configuration.md index 9a8661fa..30cf4f38 100644 --- a/docs/resources/node_configuration.md +++ b/docs/resources/node_configuration.md @@ -72,7 +72,7 @@ resource "castai_node_configuration" "default" { - `init_script` (String) Init script to be run on your instance at launch. Should not contain any sensitive data. Value should be base64 encoded - `kops` (Block List, Max: 1) (see [below for nested schema](#nestedblock--kops)) - `kubelet_config` (String) Optional kubelet configuration properties in JSON format. Provide only properties that you want to override. Applicable for EKS only. [Available values](https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/) -- `min_disk_size` (Number) Minimal disk size in GiB. Defaults to 100, min 30, max 1000 +- `min_disk_size` (Number) Minimal disk size in GiB. Defaults to 100, min 30, max 65536 - `ssh_public_key` (String) SSH public key to be used for provisioned nodes - `tags` (Map of String) Tags to be added on cloud instances for provisioned nodes - `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))