Skip to content

Commit

Permalink
fix removal of collect_driver_logs in provider v1.122.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ImpSy committed Jun 21, 2023
1 parent 59db102 commit fa331f6
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,16 @@ terraform import module.ocean-spark.spotinst_ocean_spark.example osc-abcd1234
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | ~> 2.0 |
| <a name="requirement_spotinst"></a> [spotinst](#requirement\_spotinst) | ~> 1.101 |
| <a name="requirement_spotinst"></a> [spotinst](#requirement\_spotinst) | >= 1.115.0, < 1.123.0 |
| <a name="requirement_validation"></a> [validation](#requirement\_validation) | 1.0.0 |

### Providers

| Name | Version |
|------|---------|
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | ~> 2.0 |
| <a name="provider_spotinst"></a> [spotinst](#provider\_spotinst) | ~> 1.101 |
| <a name="provider_spotinst"></a> [spotinst](#provider\_spotinst) | >= 1.115.0, < 1.123.0 |
| <a name="provider_validation"></a> [validation](#provider\_validation) | 1.0.0 |

### Modules

Expand All @@ -190,6 +192,7 @@ No modules.
| [kubernetes_service_account.deployer](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/service_account) | resource |
| [spotinst_ocean_spark.cluster](https://registry.terraform.io/providers/spotinst/spotinst/latest/docs/resources/ocean_spark) | resource |
| [spotinst_ocean_spark_virtual_node_group.this](https://registry.terraform.io/providers/spotinst/spotinst/latest/docs/resources/ocean_spark_virtual_node_group) | resource |
| [validation_warning.log_collection_collect_driver_logs](https://registry.terraform.io/providers/tlkamp/validation/1.0.0/docs/data-sources/warning) | data source |

### Inputs

Expand All @@ -208,7 +211,8 @@ No modules.
| <a name="input_ingress_managed_controller"></a> [ingress\_managed\_controller](#input\_ingress\_managed\_controller) | Controls whether an ingress controller managed by Ocean for Apache Spark will be installed on the cluster | `bool` | `true` | no |
| <a name="input_ingress_managed_load_balancer"></a> [ingress\_managed\_load\_balancer](#input\_ingress\_managed\_load\_balancer) | Controls whether a load balancer managed by Ocean for Apache Spark will be provisioned for the cluster | `bool` | `true` | no |
| <a name="input_ingress_private_link_endpoint_service_address"></a> [ingress\_private\_link\_endpoint\_service\_address](#input\_ingress\_private\_link\_endpoint\_service\_address) | The name of the VPC Endpoint Service the Ocean for Apache Spark control plane should bind to when privatelink is enabled | `string` | `null` | no |
| <a name="input_log_collection_collect_driver_logs"></a> [log\_collection\_collect\_driver\_logs](#input\_log\_collection\_collect\_driver\_logs) | Controls whether the Ocean Spark cluster will collect Spark driver logs | `bool` | `true` | no |
| <a name="input_log_collection_collect_app_logs"></a> [log\_collection\_collect\_app\_logs](#input\_log\_collection\_collect\_app\_logs) | Controls whether the Ocean Spark cluster will collect Spark driver/executor logs | `bool` | `true` | no |
| <a name="input_log_collection_collect_driver_logs"></a> [log\_collection\_collect\_driver\_logs](#input\_log\_collection\_collect\_driver\_logs) | Controls whether the Ocean Spark cluster will collect Spark driver logs (Deprecated: use log\_collection\_collect\_app\_logs instead) | `bool` | `null` | no |
| <a name="input_ocean_cluster_id"></a> [ocean\_cluster\_id](#input\_ocean\_cluster\_id) | Specifies the Ocean cluster identifier | `string` | n/a | yes |
| <a name="input_spark_additional_app_namespaces"></a> [spark\_additional\_app\_namespaces](#input\_spark\_additional\_app\_namespaces) | List of Kubernetes namespaces that should be configured to run Spark applications, in addition to the default 'spark-apps' namespace | `list(string)` | `[]` | no |
| <a name="input_webhook_host_network_ports"></a> [webhook\_host\_network\_ports](#input\_webhook\_host\_network\_ports) | Assign a list of ports on the host networks for our system pods | `list(number)` | `[]` | no |
Expand Down
6 changes: 5 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ resource "kubernetes_cluster_role_binding" "deployer" {
]
}

locals {
collect_app_logs = coalesce(var.log_collection_collect_driver_logs, var.log_collection_collect_app_logs)
}

resource "spotinst_ocean_spark" "cluster" {
ocean_cluster_id = var.ocean_cluster_id

Expand Down Expand Up @@ -69,7 +73,7 @@ resource "spotinst_ocean_spark" "cluster" {
}

log_collection {
collect_driver_logs = var.log_collection_collect_driver_logs
collect_app_logs = local.collect_app_logs
}

webhook {
Expand Down
13 changes: 12 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,18 @@ variable "ingress_private_link_endpoint_service_address" {

variable "log_collection_collect_driver_logs" {
type = bool
description = "Controls whether the Ocean Spark cluster will collect Spark driver logs"
description = "Controls whether the Ocean Spark cluster will collect Spark driver logs (Deprecated: use log_collection_collect_app_logs instead)"
default = null
}

data "validation_warning" "log_collection_collect_driver_logs" {
condition = var.log_collection_collect_driver_logs != null
summary = "variable log_collection_collect_driver_logs is depreacted, use log_collection_collect_app_logs instead"
}

variable "log_collection_collect_app_logs" {
type = bool
description = "Controls whether the Ocean Spark cluster will collect Spark driver/executor logs"
default = true
}

Expand Down
7 changes: 6 additions & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ terraform {
}
spotinst = {
source = "spotinst/spotinst"
version = "~> 1.101"
version = ">= 1.115.0, < 1.123.0"
}

validation = {
source = "tlkamp/validation"
version = "1.0.0"
}
}
}

0 comments on commit fa331f6

Please sign in to comment.