Skip to content

Commit

Permalink
feat: use latest version
Browse files Browse the repository at this point in the history
Signed-off-by: Mateusz Urbanek <[email protected]>
  • Loading branch information
shanduur committed Nov 1, 2024
1 parent df0e360 commit 454e5b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion terraform/linode/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module "lke" {
root = abspath(path.module)

cluster_name = "7S23SK"
k8s_version = "1.31"
k8s_version = "latest"

kubeconfig = var.kubeconfig
}
8 changes: 7 additions & 1 deletion terraform/linode/modules/lke/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
data "linode_lke_versions" "lke" {}

locals {
latest_version = sort(data.linode_lke_versions.lke.versions)[-1]
}

resource "linode_lke_cluster" "lke" {
k8s_version = var.k8s_version
k8s_version = var.k8s_version == "latest" ? local.latest_version : var.k8s_version
label = var.cluster_name
region = var.region

Expand Down

0 comments on commit 454e5b5

Please sign in to comment.