Skip to content

Commit

Permalink
Projects issue IBM-Cloud#2672 - "Terraform sees inputs as changed whe…
Browse files Browse the repository at this point in the history
…n they have not" (IBM-Cloud#5042)

* typo

* typo

* terraform

* terraform

* terraform

* terraform

* terraform

* terraform

* terraform

* terraform

* terraform

* terraform

* add wait for create and delete

* add wait for create and delete

* .

* fix integration tests

* fix integration tests

* fix integration tests

* fix integration tests

* fix integration tests

* regenerate

* new code generation

* new generated code

* point to latest sdk

* point to latest sdk

* adjust test cases and doc

* adjust samples

* update to latest node sdk

* merge with master

* Update project_instance.html.markdown

Fixing formatting issues

* Update project_event_notification.html.markdown

* Update README.md

* Update variables.tf

* Update project_event_notification.html.markdown

* new version

* terraform

* terraform

* terraform

* terraform

* terraform

* terraform

* terraform

* terraform

* terraform

* terraform

* feat: projects graph fragment pattern

* align with origin/master

* update test cases

* restore README.md and versions.tf to master branch

* remove duplicated entries

* feat: graph fragment pattern poc

* feat: restore definition blocks

* regenerate the terraform code based on latest YAML

* regenerate the terraform code based on latest YAML

* regenerate the terraform code based on latest YAML

* update doc

* update doc

* fix test cases

* commit generated code

* commit fix

* commit fix

* test cases

* test cases

* test cases

* test cases

* updates

* upgrade to latest go sdk

* update generated doc

* update generated code

* updated secrets baseline

* update code to latest API changes

* secrets

* fix secrets

* update samples with real values

* update secrets

* update secrets

* update generated code to the latest API definition

* update secrets baseline

* merge with master

* merge with master

* merge with master

* update code to the latest SDK level

* address some review comments

* address PR comments

* address PR comments

* update to latest sdk level

* update to latest sdk level

* update to latest sdk level

* merge with master

* update to the latest sdk level

* format test case

* regenerate the code with generator fixes

* regenerate code

* fix "inputs" and "settings" properties

* regenerated doc and samples

* fix samples

* terraform

* terraform

* terraform

* terraform

* terraform

* fix marshal strings

* secrets

* resolve conflicts

---------

Co-authored-by: knee-na <[email protected]>
Co-authored-by: Mark-Kulube <[email protected]>
  • Loading branch information
3 people authored Jan 18, 2024
1 parent f9222a6 commit 740cb68
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 101 deletions.
38 changes: 19 additions & 19 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "go.mod|go.sum|.*.map|^.secrets.baseline$",
"lines": null
},
"generated_at": "2024-01-16T23:03:03Z",
"generated_at": "2024-01-17T17:15:00Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -760,23 +760,23 @@
"hashed_secret": "731438016c5ab94431f61820f35e3ae5f8ad6004",
"is_secret": false,
"is_verified": false,
"line_number": 436,
"line_number": 434,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "12da2e35d6b50c902c014f1ab9e3032650368df7",
"is_secret": false,
"is_verified": false,
"line_number": 442,
"line_number": 440,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "813274ccae5b6b509379ab56982d862f7b5969b6",
"is_secret": false,
"is_verified": false,
"line_number": 1165,
"line_number": 1175,
"type": "Base64 High Entropy String",
"verified_result": null
}
Expand All @@ -794,39 +794,39 @@
"hashed_secret": "c427f185ddcb2440be9b77c8e45f1cd487a2e790",
"is_secret": false,
"is_verified": false,
"line_number": 1451,
"line_number": 1454,
"type": "Base64 High Entropy String",
"verified_result": null
},
{
"hashed_secret": "1f7e33de15e22de9d2eaf502df284ed25ca40018",
"is_secret": false,
"is_verified": false,
"line_number": 1518,
"line_number": 1521,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "1f614c2eb6b3da22d89bd1b9fd47d7cb7c8fc670",
"is_secret": false,
"is_verified": false,
"line_number": 3338,
"line_number": 3342,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "7abfce65b8504403afc25c9790f358d513dfbcc6",
"is_secret": false,
"is_verified": false,
"line_number": 3351,
"line_number": 3355,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "0c2d85bf9a9b1579b16f220a4ea8c3d62b2e24b1",
"is_secret": false,
"is_verified": false,
"line_number": 3392,
"line_number": 3396,
"type": "Secret Keyword",
"verified_result": null
}
Expand All @@ -846,15 +846,15 @@
"hashed_secret": "da8cae6284528565678de15e03d461e23fe22538",
"is_secret": false,
"is_verified": false,
"line_number": 1858,
"line_number": 1884,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "1a0334cfa65f4be58b9d914b8e96e9d9478bfbac",
"is_secret": false,
"is_verified": false,
"line_number": 3239,
"line_number": 3265,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -2900,15 +2900,15 @@
"hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4",
"is_secret": false,
"is_verified": false,
"line_number": 342,
"line_number": 341,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "92f08f2d9a0dc3f0d4cb3796435a48508cf59ecd",
"is_secret": false,
"is_verified": false,
"line_number": 700,
"line_number": 687,
"type": "Secret Keyword",
"verified_result": null
}
Expand All @@ -2928,15 +2928,15 @@
"hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4",
"is_secret": false,
"is_verified": false,
"line_number": 125,
"line_number": 124,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "92f08f2d9a0dc3f0d4cb3796435a48508cf59ecd",
"is_secret": false,
"is_verified": false,
"line_number": 307,
"line_number": 302,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -2964,7 +2964,7 @@
"hashed_secret": "92f08f2d9a0dc3f0d4cb3796435a48508cf59ecd",
"is_secret": false,
"is_verified": false,
"line_number": 1091,
"line_number": 1107,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -3062,7 +3062,7 @@
"hashed_secret": "3c2ecad9b250fd6d99893e4d05ec02ca19aa95d0",
"is_secret": false,
"is_verified": false,
"line_number": 389,
"line_number": 396,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -4954,15 +4954,15 @@
"hashed_secret": "d47dcacc720a39e236679ac3e311a0d58bb6519e",
"is_secret": false,
"is_verified": false,
"line_number": 191,
"line_number": 192,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "e66e7d67fdf3c596c435fc7828b13205e4950a0f",
"is_secret": false,
"is_verified": false,
"line_number": 193,
"line_number": 194,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down
43 changes: 7 additions & 36 deletions ibm/service/project/data_source_ibm_project_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package project

import (
"context"
"encoding/json"
"fmt"
"log"

Expand Down Expand Up @@ -531,11 +530,7 @@ func dataSourceIbmProjectConfigOutputValueToMap(model *projectv1.OutputValue) (m
if model.Value != nil {
value := make(map[string]interface{})
for k, v := range model.Value {
bytes, err := json.Marshal(v)
if err != nil {
return modelMap, err
}
value[k] = string(bytes)
value[k] = fmt.Sprintf("%v", v)
}
modelMap["value"] = value
}
Expand Down Expand Up @@ -650,22 +645,14 @@ func dataSourceIbmProjectConfigProjectConfigResponseDefinitionToMap(model projec
if model.Inputs != nil {
inputs := make(map[string]interface{})
for k, v := range model.Inputs {
bytes, err := json.Marshal(v)
if err != nil {
return modelMap, err
}
inputs[k] = string(bytes)
inputs[k] = fmt.Sprintf("%v", v)
}
modelMap["inputs"] = inputs
}
if model.Settings != nil {
settings := make(map[string]interface{})
for k, v := range model.Settings {
bytes, err := json.Marshal(v)
if err != nil {
return modelMap, err
}
settings[k] = string(bytes)
settings[k] = fmt.Sprintf("%v", v)
}
modelMap["settings"] = settings
}
Expand Down Expand Up @@ -743,22 +730,14 @@ func dataSourceIbmProjectConfigProjectConfigResponseDefinitionDAConfigDefinition
if model.Inputs != nil {
inputs := make(map[string]interface{})
for k, v := range model.Inputs {
bytes, err := json.Marshal(v)
if err != nil {
return modelMap, err
}
inputs[k] = string(bytes)
inputs[k] = fmt.Sprintf("%v", v)
}
modelMap["inputs"] = inputs
}
if model.Settings != nil {
settings := make(map[string]interface{})
for k, v := range model.Settings {
bytes, err := json.Marshal(v)
if err != nil {
return modelMap, err
}
settings[k] = string(bytes)
settings[k] = fmt.Sprintf("%v", v)
}
modelMap["settings"] = settings
}
Expand Down Expand Up @@ -796,22 +775,14 @@ func dataSourceIbmProjectConfigProjectConfigResponseDefinitionResourceConfigDefi
if model.Inputs != nil {
inputs := make(map[string]interface{})
for k, v := range model.Inputs {
bytes, err := json.Marshal(v)
if err != nil {
return modelMap, err
}
inputs[k] = string(bytes)
inputs[k] = fmt.Sprintf("%v", v)
}
modelMap["inputs"] = inputs
}
if model.Settings != nil {
settings := make(map[string]interface{})
for k, v := range model.Settings {
bytes, err := json.Marshal(v)
if err != nil {
return modelMap, err
}
settings[k] = string(bytes)
settings[k] = fmt.Sprintf("%v", v)
}
modelMap["settings"] = settings
}
Expand Down
7 changes: 1 addition & 6 deletions ibm/service/project/data_source_ibm_project_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package project

import (
"context"
"encoding/json"
"fmt"
"log"

Expand Down Expand Up @@ -277,11 +276,7 @@ func dataSourceIbmProjectEnvironmentEnvironmentDefinitionRequiredPropertiesToMap
if model.Inputs != nil {
inputs := make(map[string]interface{})
for k, v := range model.Inputs {
bytes, err := json.Marshal(v)
if err != nil {
return modelMap, err
}
inputs[k] = string(bytes)
inputs[k] = fmt.Sprintf("%v", v)
}
modelMap["inputs"] = inputs
}
Expand Down
42 changes: 7 additions & 35 deletions ibm/service/project/resource_ibm_project_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1059,11 +1059,7 @@ func resourceIbmProjectConfigProjectConfigResponseDefinitionToMap(model projectv
if model.Inputs != nil {
inputs := make(map[string]interface{})
for k, v := range model.Inputs {
bytes, err := json.Marshal(v)
if err != nil {
return modelMap, err
}
inputs[k] = string(bytes)
inputs[k] = fmt.Sprintf("%v", v)
}
if len(inputs) > 0 {
modelMap["inputs"] = inputs
Expand All @@ -1072,11 +1068,7 @@ func resourceIbmProjectConfigProjectConfigResponseDefinitionToMap(model projectv
if model.Settings != nil {
settings := make(map[string]interface{})
for k, v := range model.Settings {
bytes, err := json.Marshal(v)
if err != nil {
return modelMap, err
}
settings[k] = string(bytes)
settings[k] = fmt.Sprintf("%v", v)
}
if len(settings) > 0 {
modelMap["settings"] = settings
Expand Down Expand Up @@ -1160,11 +1152,7 @@ func resourceIbmProjectConfigProjectConfigResponseDefinitionDAConfigDefinitionPr
if model.Inputs != nil {
inputs := make(map[string]interface{})
for k, v := range model.Inputs {
bytes, err := json.Marshal(v)
if err != nil {
return modelMap, err
}
inputs[k] = string(bytes)
inputs[k] = fmt.Sprintf("%v", v)
}
if len(inputs) > 0 {
modelMap["inputs"] = inputs
Expand All @@ -1173,11 +1161,7 @@ func resourceIbmProjectConfigProjectConfigResponseDefinitionDAConfigDefinitionPr
if model.Settings != nil {
settings := make(map[string]interface{})
for k, v := range model.Settings {
bytes, err := json.Marshal(v)
if err != nil {
return modelMap, err
}
settings[k] = string(bytes)
settings[k] = fmt.Sprintf("%v", v)
}
if len(settings) > 0 {
modelMap["settings"] = settings
Expand Down Expand Up @@ -1219,11 +1203,7 @@ func resourceIbmProjectConfigProjectConfigResponseDefinitionResourceConfigDefini
if model.Inputs != nil {
inputs := make(map[string]interface{})
for k, v := range model.Inputs {
bytes, err := json.Marshal(v)
if err != nil {
return modelMap, err
}
inputs[k] = string(bytes)
inputs[k] = fmt.Sprintf("%v", v)
}
if len(inputs) > 0 {
modelMap["inputs"] = inputs
Expand All @@ -1232,11 +1212,7 @@ func resourceIbmProjectConfigProjectConfigResponseDefinitionResourceConfigDefini
if model.Settings != nil {
settings := make(map[string]interface{})
for k, v := range model.Settings {
bytes, err := json.Marshal(v)
if err != nil {
return modelMap, err
}
settings[k] = string(bytes)
settings[k] = fmt.Sprintf("%v", v)
}
if len(settings) > 0 {
modelMap["settings"] = settings
Expand All @@ -1257,11 +1233,7 @@ func resourceIbmProjectConfigOutputValueToMap(model *projectv1.OutputValue) (map
if model.Value != nil {
value := make(map[string]interface{})
for k, v := range model.Value {
bytes, err := json.Marshal(v)
if err != nil {
return modelMap, err
}
value[k] = string(bytes)
value[k] = fmt.Sprintf("%v", v)
}
modelMap["value"] = value
}
Expand Down
6 changes: 1 addition & 5 deletions ibm/service/project/resource_ibm_project_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,11 +479,7 @@ func resourceIbmProjectEnvironmentEnvironmentDefinitionRequiredPropertiesToMap(m
if model.Inputs != nil {
inputs := make(map[string]interface{})
for k, v := range model.Inputs {
bytes, err := json.Marshal(v)
if err != nil {
return modelMap, err
}
inputs[k] = string(bytes)
inputs[k] = fmt.Sprintf("%v", v)
}
if len(inputs) > 0 {
modelMap["inputs"] = inputs
Expand Down

0 comments on commit 740cb68

Please sign in to comment.