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

Fixed cloudfunction action runtimes version issue #2424

Merged
merged 1 commit into from
Mar 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/ibm-function-cloudant-trigger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "ibm_function_action" "action" {
namespace = var.namespace

exec {
kind = "nodejs:6"
kind = "nodejs:10"
code = file("hello.js")
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/ibm-function-cloudant-trigger/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ resource "ibm_function_action" "action" {
namespace = var.namespace

exec {
kind = "nodejs:6"
kind = "nodejs:10"
code = file("hello.js")
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/ibm-function-iam-cloudant-trigger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ resource "ibm_function_action" "action" {
namespace = var.namespace

exec {
kind = "nodejs:6"
kind = "nodejs:10"
code = file("hello.js")
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/ibm-function-iam-cloudant-trigger/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ resource "ibm_function_action" "action" {
namespace = var.namespace

exec {
kind = "nodejs:6"
kind = "nodejs:10"
code = file("hello.js")
}
}
Expand Down
1 change: 0 additions & 1 deletion examples/ibm-satellite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ module "satellite-location" {
location = var.location
managed_from = var.managed_from
location_zones = var.location_zones
location_tags = var.location_tags
ibmcloud_api_key = var.ibmcloud_api_key
ibm_region = var.ibm_region
resource_group = var.resource_group
Expand Down
1 change: 0 additions & 1 deletion examples/ibm-satellite/modules/location/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ module "satellite-location" {
location = var.location
managed_from = var.managed_from
location_zones = var.location_zones
location_tags = var.location_tags
ibmcloud_api_key = var.ibmcloud_api_key
ibm_region = var.ibm_region
resource_group = var.resource_group
Expand Down
2 changes: 1 addition & 1 deletion ibm/data_source_ibm_function_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func dataSourceIBMFunctionAction() *schema.Resource {
"kind": {
Type: schema.TypeString,
Computed: true,
Description: "The type of action. Possible values:php:7.1, nodejs:8, swift:3, nodejs, blackbox, java, sequence, nodejs:6, python:3, python, python:2, swift, swift:3.1.1.",
Description: "The type of action. Possible values:php:7.3, nodejs:8, swift:3, nodejs, blackbox, java, sequence, nodejs:10, python:3, python, python:2, swift, swift:4.2.",
},
"main": {
Type: schema.TypeString,
Expand Down
2 changes: 1 addition & 1 deletion ibm/data_source_ibm_function_action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

func TestAccFunctionActionDataSourceBasic(t *testing.T) {
name := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("terraform_action_%d", acctest.RandIntRange(10, 100))
namespace := os.Getenv("IBM_FUNCTION_NAMESPACE")

resource.Test(t, resource.TestCase{
Expand Down
2 changes: 1 addition & 1 deletion ibm/data_source_ibm_function_package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

func TestAccFunctionPackageDataSourceBasic(t *testing.T) {
name := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("terraform_package_%d", acctest.RandIntRange(10, 100))
namespace := os.Getenv("IBM_FUNCTION_NAMESPACE")
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down
8 changes: 4 additions & 4 deletions ibm/data_source_ibm_function_rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
)

func TestAccFunctionRuleDataSourceBasic(t *testing.T) {
name := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
actionName := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
triggerName := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("terraform_rule_%d", acctest.RandIntRange(10, 100))
actionName := fmt.Sprintf("terraform_action_%d", acctest.RandIntRange(10, 100))
triggerName := fmt.Sprintf("terraform_trigger_%d", acctest.RandIntRange(10, 100))
namespace := os.Getenv("IBM_FUNCTION_NAMESPACE")

resource.Test(t, resource.TestCase{
Expand Down Expand Up @@ -45,7 +45,7 @@ func testAccCheckFunctionRuleDataSource(actionName, triggerName, name, namespace
name = "%s"
namespace = "%s"
exec {
kind = "nodejs:6"
kind = "nodejs:10"
code = file("test-fixtures/hellonode.js")
}
}
Expand Down
2 changes: 1 addition & 1 deletion ibm/data_source_ibm_function_trigger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

func TestAccFunctionTriggerDataSourceBasic(t *testing.T) {
name := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("terraform_trigger_%d", acctest.RandIntRange(10, 100))
namespace := os.Getenv("IBM_FUNCTION_NAMESPACE")

resource.Test(t, resource.TestCase{
Expand Down
106 changes: 53 additions & 53 deletions ibm/resource_ibm_function_action_test.go

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions ibm/resource_ibm_function_package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

func TestAccCFFunctionPackage_Basic(t *testing.T) {
var conf whisk.Package
name := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("terraform_package_%d", acctest.RandIntRange(10, 100))
namespace := os.Getenv("IBM_FUNCTION_NAMESPACE")
updatedName := fmt.Sprintf("terraform_updated_%d", acctest.RandIntRange(10, 100))
resource.Test(t, resource.TestCase{
Expand Down Expand Up @@ -111,9 +111,9 @@ func TestAccCFFunctionPackage_Basic(t *testing.T) {

func TestAccIAMFunctionPackage_Basic(t *testing.T) {
var conf whisk.Package
name := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("terraform_package_%d", acctest.RandIntRange(10, 100))
namespace := fmt.Sprintf("namespace_%d", acctest.RandIntRange(10, 100))
updatedName := fmt.Sprintf("terraform_updated_%d", acctest.RandIntRange(10, 100))
updatedName := fmt.Sprintf("terraform_package_updated_%d", acctest.RandIntRange(10, 100))
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Expand Down Expand Up @@ -203,8 +203,8 @@ func TestAccIAMFunctionPackage_Basic(t *testing.T) {

func TestAccCFFunctionPackage_Bind_Basic(t *testing.T) {
var conf whisk.Package
name := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
updatedName := fmt.Sprintf("terraform_updated_%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("terraform_package_%d", acctest.RandIntRange(10, 100))
updatedName := fmt.Sprintf("terraform_package_updated_%d", acctest.RandIntRange(10, 100))
namespace := os.Getenv("IBM_FUNCTION_NAMESPACE")
bindName := "/whisk.system/alarms"

Expand Down Expand Up @@ -293,7 +293,7 @@ func TestAccCFFunctionPackage_Bind_Basic(t *testing.T) {

func TestAccIAMFunctionPackage_Bind_Basic(t *testing.T) {
var conf whisk.Package
name := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("terraform_package_%d", acctest.RandIntRange(10, 100))
updatedName := fmt.Sprintf("terraform_updated_%d", acctest.RandIntRange(10, 100))
namespace := fmt.Sprintf("namespace_%d", acctest.RandIntRange(10, 100))
bindName := "/whisk.system/alarms"
Expand Down Expand Up @@ -383,7 +383,7 @@ func TestAccIAMFunctionPackage_Bind_Basic(t *testing.T) {

func TestAccCFFunctionPackage_Import(t *testing.T) {
var conf whisk.Package
name := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("terraform_package_%d", acctest.RandIntRange(10, 100))
namespace := os.Getenv("IBM_FUNCTION_NAMESPACE")
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down Expand Up @@ -415,7 +415,7 @@ func TestAccCFFunctionPackage_Import(t *testing.T) {

func TestAccIAMFunctionPackage_Import(t *testing.T) {
var conf whisk.Package
name := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("terraform_package_%d", acctest.RandIntRange(10, 100))
namespace := fmt.Sprintf("namespace_%d", acctest.RandIntRange(10, 100))
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down
28 changes: 14 additions & 14 deletions ibm/resource_ibm_function_rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ import (

func TestAccCFFunctionRule_Basic(t *testing.T) {
var conf whisk.Rule
name := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("terraform_rule_%d", acctest.RandIntRange(10, 100))
namespace := os.Getenv("IBM_FUNCTION_NAMESPACE")
actionName := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
triggerName := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
updatedTriggerName := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
actionName := fmt.Sprintf("terraform_action_%d", acctest.RandIntRange(10, 100))
triggerName := fmt.Sprintf("terraform_trigger_%d", acctest.RandIntRange(10, 100))
updatedTriggerName := fmt.Sprintf("terraform_update_trigger_%d", acctest.RandIntRange(10, 100))

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down Expand Up @@ -60,11 +60,11 @@ func TestAccCFFunctionRule_Basic(t *testing.T) {

func TestAccIAMFunctionRule_Basic(t *testing.T) {
var conf whisk.Rule
name := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("terraform_rule_%d", acctest.RandIntRange(10, 100))
namespace := fmt.Sprintf("namespace_%d", acctest.RandIntRange(10, 100))
actionName := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
triggerName := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
updatedTriggerName := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
actionName := fmt.Sprintf("terraform_action_%d", acctest.RandIntRange(10, 100))
triggerName := fmt.Sprintf("terraform_trigger_%d", acctest.RandIntRange(10, 100))
updatedTriggerName := fmt.Sprintf("terraform_update_trigger_%d", acctest.RandIntRange(10, 100))

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down Expand Up @@ -101,8 +101,8 @@ func TestAccIAMFunctionRule_Basic(t *testing.T) {

func TestAccCFFunctionRule_Import(t *testing.T) {
var conf whisk.Rule
name := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
triggeName := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("terraform_rule_%d", acctest.RandIntRange(10, 100))
triggeName := fmt.Sprintf("terraform_trigger_%d", acctest.RandIntRange(10, 100))
namespace := os.Getenv("IBM_FUNCTION_NAMESPACE")

resource.Test(t, resource.TestCase{
Expand Down Expand Up @@ -133,8 +133,8 @@ func TestAccCFFunctionRule_Import(t *testing.T) {

func TestAccIAMFunctionRule_Import(t *testing.T) {
var conf whisk.Rule
name := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
triggeName := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("terraform_rule_%d", acctest.RandIntRange(10, 100))
triggeName := fmt.Sprintf("terraform_trigger_%d", acctest.RandIntRange(10, 100))
namespace := fmt.Sprintf("namespace_%d", acctest.RandIntRange(10, 100))

resource.Test(t, resource.TestCase{
Expand Down Expand Up @@ -262,7 +262,7 @@ func testAccCheckIAMFunctionRuleCreate(actionName, triggerName, name, namespace
name = "%s"
namespace = ibm_function_namespace.namespace.name
exec {
kind = "nodejs:6"
kind = "nodejs:10"
code = file("test-fixtures/hellonode.js")
}
}
Expand Down Expand Up @@ -413,7 +413,7 @@ func testAccCheckCFFunctionRuleCreate(actionName, triggerName, name, namespace s
name = "%s"
namespace = "%s"
exec {
kind = "nodejs:6"
kind = "nodejs:10"
code = file("test-fixtures/hellonode.js")
}
}
Expand Down
12 changes: 6 additions & 6 deletions ibm/resource_ibm_function_trigger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

func TestAccIAMFunctionTrigger_Basic(t *testing.T) {
var conf whisk.Trigger
name := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("terraform_trigger_%d", acctest.RandIntRange(10, 100))
namespace := fmt.Sprintf("namespace_%d", acctest.RandIntRange(10, 100))
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down Expand Up @@ -53,7 +53,7 @@ func TestAccIAMFunctionTrigger_Basic(t *testing.T) {

func TestAccIAMFunctionTrigger_Feed_Basic(t *testing.T) {
var conf whisk.Trigger
name := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("terraform_trigger_%d", acctest.RandIntRange(10, 100))
namespace := fmt.Sprintf("namespace_%d", acctest.RandIntRange(10, 100))
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down Expand Up @@ -89,7 +89,7 @@ func TestAccIAMFunctionTrigger_Feed_Basic(t *testing.T) {

func TestAccIAMFunctionTrigger_Import(t *testing.T) {
var conf whisk.Trigger
name := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("terraform_trigger_%d", acctest.RandIntRange(10, 100))
namespace := fmt.Sprintf("namespace_%d", acctest.RandIntRange(10, 100))
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down Expand Up @@ -119,7 +119,7 @@ func TestAccIAMFunctionTrigger_Import(t *testing.T) {

func TestAccCFFunctionTrigger_Basic(t *testing.T) {
var conf whisk.Trigger
name := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("terraform_trigger_%d", acctest.RandIntRange(10, 100))
namespace := os.Getenv("IBM_FUNCTION_NAMESPACE")

resource.Test(t, resource.TestCase{
Expand Down Expand Up @@ -154,7 +154,7 @@ func TestAccCFFunctionTrigger_Basic(t *testing.T) {

func TestAccCFFunctionTrigger_Feed_Basic(t *testing.T) {
var conf whisk.Trigger
name := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("terraform_trigger_%d", acctest.RandIntRange(10, 100))
namespace := os.Getenv("IBM_FUNCTION_NAMESPACE")
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down Expand Up @@ -190,7 +190,7 @@ func TestAccCFFunctionTrigger_Feed_Basic(t *testing.T) {

func TestAccCFFunctionTrigger_Import(t *testing.T) {
var conf whisk.Trigger
name := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("terraform_trigger_%d", acctest.RandIntRange(10, 100))
namespace := os.Getenv("IBM_FUNCTION_NAMESPACE")
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down
2 changes: 1 addition & 1 deletion ibm/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ func validateActionName(v interface{}, k string) (ws []string, errors []error) {

func validateActionKind(v interface{}, k string) (ws []string, errors []error) {
value := v.(string)
kindList := []string{"php:7.1", "nodejs:8", "swift:3", "nodejs", "blackbox", "java", "sequence", "nodejs:6", "python:3", "python", "python:2", "swift", "swift:3.1.1"}
kindList := []string{"php:7.3", "nodejs:8", "swift:3", "nodejs", "blackbox", "java", "sequence", "nodejs:10", "python:3", "python", "python:2", "swift", "swift:4.2"}
if !stringInSlice(value, kindList) {
errors = append(errors, fmt.Errorf(
"%q (%q) Invalid kind is provided.Supported list of kinds of actions are (%q)", k, value, kindList))
Expand Down
1 change: 1 addition & 0 deletions website/allowed-subcategories.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ Schematics
Transit Gateway
VPC infrastructure
Secrets Manager
Satellite

2 changes: 1 addition & 1 deletion website/docs/index.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ resource "ibm_function_action" "nodehello" {
name = "action-name"
namespace = "function-namespace-name"
exec {
kind = "nodejs:6"
kind = "nodejs:10"
code = file("hellonode.js")
}
}
Expand Down
6 changes: 3 additions & 3 deletions website/docs/r/function_action.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ resource "ibm_function_action" "nodehello" {
namespace = "function-namespace-name"

exec {
kind = "nodejs:6"
kind = "nodejs:10"
code = file("hellonode.js")
}
}
Expand All @@ -36,7 +36,7 @@ resource "ibm_function_action" "nodehellowithparameter" {
namespace = "function-namespace-name"

exec {
kind = "nodejs:6"
kind = "nodejs:10"
code = file("hellonodewithparameter.js")
}

Expand All @@ -62,7 +62,7 @@ resource "ibm_function_action" "nodezip" {
namespace = "function-namespace-name"

exec {
kind = "nodejs:6"
kind = "nodejs:10"
code_path = "nodeaction.zip"
}
}
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/function_rule.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ resource "ibm_function_action" "action" {
namespace = "function-namespace-name

exec {
kind = "nodejs:6"
kind = "nodejs:10"
code = file("test-fixtures/hellonode.js")
}
}
Expand Down