-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using nomad namespace causes inconsistent result after apply error #69
Comments
Thanks for the report, @JanBerktold , working on this now. |
The root cause seems to be that the calls to the Nomad API (specifically, read and delete) do not reference the namespace, and therefore may result in 404s. One limited workaround is to set the NOMAD_NAMESPACE environment variable before calling I will release a 1.4.1 provider when this is fixed. I'm updating the Nomad Job datasource as well. |
@JanBerktold , just released 1.4.1 with support for this. let me know how it works. |
Thank you for the quick turn around! |
Hello @cgbaker, running the latest version of nomad's provider + latest version of TF I'm hitting the same error. Debug output: https://gist.github.com/wallacepf/7bf4863122f539159bd1bb4329cf67b1 Terraform version:
Terraform configuration file
Job File
|
Hi Wallace, please file a new issue so that someone on the Nomad team can
pick it up.
Thanks,
Chris
…On Fri, Oct 22, 2021, 17:29 Wallace Figueiredo ***@***.***> wrote:
Hello @cgbaker <https://github.com/cgbaker>, running the latest version
of nomad's provider + latest version of TF I'm hitting the same error.
Debug output:
https://gist.github.com/wallacepf/7bf4863122f539159bd1bb4329cf67b1
Terraform version:
�Terraform v1.0.9
Terraform configuration file
terraform {
required_providers {
nomad = {
version = "~> 1.4.15"
}
}
}
provider "nomad" {
address = "http://192.168.86.27:4646"
}
resource "nomad_namespace" "cicd" {
name = "cicd"
description = "Namespace for CICD"
}
resource "nomad_job" "gl-runner" {
jobspec = file ("${path.module}/jobs/gl-runner.nomad")
hcl2 {
enabled = "true"
vars = {
"datacenters" = "[\"NUC\"]",
"namespace" = nomad_namespace.cicd.name
}
}
}
Job File
variable "datacenters" {
type = list(string)
}
variable "namespace" {
type = string
}
job "gitlab-runners" {
datacenters = var.datacenters
type = "service"
namespace = var.namespace
group "runners" {
task "runners" {
driver = "docker"
config {
image = "gitlab/gitlab-runner:alpine"
volumes = [
"/srv/gitlab-runner/config:/etc/gitlab-runner"
]
}
}
}
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#69 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMY6T3SJWTKPXE5OWWPW23UIHQT5ANCNFSM4IFGYKNA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
When setting a nomad namespace, the provider always produces an
Provider produced inconsistent result after apply
error. The example can be fixed by setting thenamespace
input to an empty string.Terraform Version
Affected Resource(s)
Terraform Configuration Files
The template:
Debug Output
https://gist.github.com/JanBerktold/cc66903f5a30d118be34da42ca727851
Panic Output
Not applicable.
Expected Behavior
Expected Nomad job to run in namespace.
Actual Behavior
Steps to Reproduce
terraform apply
The text was updated successfully, but these errors were encountered: