Skip to content

Commit 1b1b401

Browse files
committed
improve precondition
1 parent b251af9 commit 1b1b401

File tree

1 file changed

+2
-6
lines changed
  • scaletest/templates/scaletest-runner

1 file changed

+2
-6
lines changed

scaletest/templates/scaletest-runner/main.tf

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,8 @@ resource "null_resource" "permission_check" {
4040
# for the plan, and consequently, updating the template.
4141
lifecycle {
4242
precondition {
43-
condition = can(regex("^(default|scaletest)$", data.coder_workspace.me.owner))
44-
error_message = "User is not allowed, expected 'scaletest'."
45-
}
46-
precondition {
47-
condition = can(regex("^(default|runner)$", data.coder_workspace.me.name))
48-
error_message = "Workspace name is not allowed, expected 'runner'."
43+
condition = can(regex("^(default/default|scaletest/runner)$", "${data.coder_workspace.me.owner}/${data.coder_workspace.me.name}"))
44+
error_message = "User and workspace name is not allowed, expected 'scaletest/runner'."
4945
}
5046
}
5147
}

0 commit comments

Comments
 (0)