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

Conflict with exec.image and exec.code/exec.code_path (can't use custom docker images) #2556

Closed
3dteemu opened this issue Apr 29, 2021 · 2 comments
Labels
service/Functions Issues related to Functions

Comments

@3dteemu
Copy link

3dteemu commented Apr 29, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform IBM Provider Version

terraform -v
Terraform v0.15.1
on linux_amd64

  • provider registry.terraform.io/hashicorp/external v2.1.0
  • provider registry.terraform.io/hashicorp/http v2.1.0
  • provider registry.terraform.io/ibm-cloud/ibm v1.23.2

Affected Resource(s)

  • ibm_function_action

Terraform Configuration Files

resource "ibm_function_action" "my_action" {
  name = "my-package/my-action"
  namespace = var.cloud_functions_namespace

  exec {
    kind = "blackbox"
    image = "my-repo/my-custom-image"
    code = filebase64("actions/my-action/dist/bundle.zip")
  }
}

Although in my case I use filebase64 as the code is zipped, I also tested with file as in the example below.

Expected Behavior

Should work as the documentation example says:

resource "ibm_function_action" "swifthello" {
  name      = "dockeraction"
  namespace = "function-namespace-name"

  exec {
    kind   = "blackbox"    
    image  = "janesmith/blackboxdemo"
    code   = file("helloSwift.swift")
  }
}

https://cloud.ibm.com/docs/ibm-cloud-provider-for-terraform?topic=ibm-cloud-provider-for-terraform-function-resources#docker-action

Actual Behavior

Error: ConflictsWith

│ with ibm_function_action.my_action,
│ on functions.tf line 165, in resource "ibm_function_action" "my_action":
│ 165: code = filebase64("actions/my-action/dist/bundle.zip")

│ "exec.0.code": conflicts with exec.0.image

Steps to Reproduce

  1. terraform apply

Important Factoids

I'm trying to use custom Docker image as documented in IBM OpenWhisk docs

The docker image is uploaded to Docker Hub.

In the documentation the example says this should be possible. However, the input parameters section describes exec.image to conflict with exec.code:

When using the blackbox executable, the name of the container image name. NOTE: Conflicts with exec.components, exec.code.

Therefore the parameter documentation conflicts with the example.

Currently it is not possible to use custom Docker image with Terraform.

@kavya498
Copy link
Collaborator

kavya498 commented May 6, 2021

Available in latest

@kavya498 kavya498 added the service/Functions Issues related to Functions label May 6, 2021
@kavya498
Copy link
Collaborator

Closing this issue
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/Functions Issues related to Functions
Projects
None yet
Development

No branches or pull requests

2 participants