Skip to content

Commit acb291a

Browse files
committed
fix: set config and environment file permissions
Signed-off-by: matttrach <matt.trachier@suse.com>
1 parent b1ad6fe commit acb291a

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

modules/cluster/main.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ resource "file_local" "kubeconfig" {
374374
module.deploy_initial_node,
375375
module.deploy_additional_nodes,
376376
]
377-
name = "kubeconfig"
378-
directory = local.local_file_path
379-
contents = local.ino.output.kubeconfig
377+
name = "kubeconfig"
378+
directory = local.local_file_path
379+
contents = local.ino.output.kubeconfig
380+
permissions = "0644" // kube-proxy requires read permissions for others
380381
}

modules/deploy/main.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,12 @@ resource "file_local" "instantiate_envrc_snapshot" {
176176
file_local_snapshot.persist_envrc,
177177
terraform_data.remove_tmp_envrc,
178178
]
179-
directory = local.deploy_path
180-
name = "envrc"
181-
contents = base64decode(file_local_snapshot.persist_envrc.snapshot)
179+
directory = local.deploy_path
180+
name = "envrc"
181+
contents = base64decode(file_local_snapshot.persist_envrc.snapshot)
182+
permissions = "0700" # make it executable so it can be sourced
182183
}
183184

184-
185185
resource "terraform_data" "destroy" {
186186
depends_on = [
187187
file_local.instantiate_envrc_snapshot,
@@ -271,7 +271,7 @@ resource "file_local" "instantiate_outputs" {
271271

272272
# during initial create this should be an extra apply that has no effect
273273
# when the inputs change and the template needs to be rebuilt this will allow the persist
274-
# to rebuild the template before running the create script
274+
# to rebuild the template and state file before running the create script
275275
resource "terraform_data" "create_after_persist" {
276276
depends_on = [
277277
file_local.instantiate_envrc_snapshot,

0 commit comments

Comments
 (0)