Skip to content

Commit ad49f4a

Browse files
committed
Update tf provider and use a single path for the config
1 parent b8955be commit ad49f4a

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

Diff for: dev/preview/infrastructure/harvester/provider.tf

+6-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ terraform {
99
required_providers {
1010
harvester = {
1111
source = "harvester/harvester"
12-
version = ">=0.5.1"
12+
version = ">=0.5.3"
1313
}
1414
k8s = {
1515
source = "hashicorp/kubernetes"
@@ -23,20 +23,21 @@ terraform {
2323
}
2424

2525
provider "harvester" {
26-
alias = "harvester"
27-
kubeconfig = var.harvester_kube_path
26+
alias = "harvester"
27+
kubeconfig = var.kubeconfig_path
28+
kubecontext = "harvester"
2829
}
2930

3031
provider "k8s" {
3132
alias = "dev"
33+
config_path = var.kubeconfig_path
3234
config_context = var.dev_kube_context
33-
config_path = var.dev_kube_path
3435
}
3536

3637
provider "k8s" {
3738
alias = "harvester"
39+
config_path = var.kubeconfig_path
3840
config_context = var.harvester_kube_context
39-
config_path = var.harvester_kube_path
4041
}
4142

4243
provider "google" {

Diff for: dev/preview/infrastructure/harvester/variables.tf

+7-11
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,22 @@ variable "preview_name" {
33
description = "The preview environment's name"
44
}
55

6-
variable "harvester_kube_path" {
6+
variable "kubeconfig_path" {
77
type = string
8-
description = "The path to the Harvester Cluster kubeconfig"
8+
default = "/home/gitpod/.kube/config"
9+
description = "The path to the kubernetes config"
910
}
1011

1112
variable "harvester_kube_context" {
1213
type = string
13-
default = "default"
14-
description = "The name of the context to use within the config"
15-
}
16-
17-
variable "dev_kube_path" {
18-
type = string
19-
description = "The path to the Dev Cluster kubeconfig"
14+
default = "harvester"
15+
description = "The name of the harvester kube context"
2016
}
2117

2218
variable "dev_kube_context" {
2319
type = string
24-
default = "gke_gitpod-core-dev_europe-west1-b_core-dev"
25-
description = "The name of the context to use within the config"
20+
default = "dev"
21+
description = "The name of the dev kube context"
2622
}
2723

2824
variable "vm_memory" {

0 commit comments

Comments
 (0)