Skip to content
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

Unable to create CE jobs with run_mode = "daemon" #144

Open
bobfang opened this issue Dec 26, 2024 · 1 comment
Open

Unable to create CE jobs with run_mode = "daemon" #144

bobfang opened this issue Dec 26, 2024 · 1 comment

Comments

@bobfang
Copy link

bobfang commented Dec 26, 2024

Affected modules

  • "terraform-ibm-modules/code-engine/ibm//modules/job"

Terraform CLI and Terraform provider versions

  • Terraform version: v1.9.8
  • Provider version: provider registry.terraform.io/ibm-cloud/ibm v1.71.3

Terraform output

│ id: terraform-0e9280e9
│ summary: 'CreateJobWithContext failed: Bad payload - The field ''scale_max_execution_time''
│   is invalid. reason: INVALID'
│ severity: error
│ resource: ibm_code_engine_job
│ operation: create
│ component:
│   name: github.com/IBM-Cloud/terraform-provider-ibm
│   version: 1.71.3
│ ---
│
│
│   with module.job.ibm_code_engine_job.ce_job,
│   on .terraform/modules/job/modules/job/main.tf line 8, in resource "ibm_code_engine_job" "ce_job":
│    8: resource "ibm_code_engine_job" "ce_job" {
│

Expected behavior

Should have been able to create a Code Engine job with type daemon.

Actual behavior

It fails a series of validation checks, even if scale_max_execution_time = null or set to empty. It looks like the provider must not see this field at all for run_mode = daemon to work properly.

Steps to reproduce (including links and screen captures)

module "job" {
  source        = "terraform-ibm-modules/code-engine/ibm//modules/job"
  project_id    = module.ce_project.project_id
  name          = "helloword"
  image_reference = "icr.io/codeengine/helloworld"
  run_mode = "daemon"
  scale_cpu_limit          = "0.25"
  scale_memory_limit       = "0.5G"
}
  1. Run terraform apply

Anything else

Here is the documentation on "run_mode"

In task mode, the max_execution_time and retry_limit properties apply. In daemon mode, since there is no timeout and failed instances are restarted indefinitely, the max_execution_time and retry_limit properties are not allowed.

@bobfang
Copy link
Author

bobfang commented Dec 27, 2024

I think the root problem is actually here:
IBM-Cloud/terraform-provider-ibm#4922

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants