diff --git a/.secrets.baseline b/.secrets.baseline index ba554a61dd..55f7c7981a 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "go.mod|go.sum|.*.map|^.secrets.baseline$", "lines": null }, - "generated_at": "2023-09-01T17:36:43Z", + "generated_at": "2023-09-11T17:15:43Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -2050,7 +2050,7 @@ "hashed_secret": "deab23f996709b4e3d14e5499d1cc2de677bfaa8", "is_secret": false, "is_verified": false, - "line_number": 1560, + "line_number": 1559, "type": "Secret Keyword", "verified_result": null }, @@ -2058,7 +2058,7 @@ "hashed_secret": "20a25bac21219ffff1904bde871ded4027eca2f8", "is_secret": false, "is_verified": false, - "line_number": 2213, + "line_number": 2212, "type": "Secret Keyword", "verified_result": null }, @@ -2066,7 +2066,7 @@ "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", "is_secret": false, "is_verified": false, - "line_number": 2232, + "line_number": 2231, "type": "Secret Keyword", "verified_result": null }, @@ -2074,7 +2074,7 @@ "hashed_secret": "1f5e25be9b575e9f5d39c82dfd1d9f4d73f1975c", "is_secret": false, "is_verified": false, - "line_number": 2497, + "line_number": 2496, "type": "Secret Keyword", "verified_result": null } @@ -2139,7 +2139,7 @@ ], "ibm/service/database/resource_ibm_database_mongodb_sharding_test.go": [ { - "hashed_secret": "75074b1c70e165b25d1a07655ce513f0053018dc", + "hashed_secret": "5667b8489a17faa9ef54941db31ed762be280bec", "is_secret": false, "is_verified": false, "line_number": 141, @@ -3586,7 +3586,7 @@ "hashed_secret": "f855f5027fd8fdb2df3f6a6f1cf858fffcbedb0c", "is_secret": false, "is_verified": false, - "line_number": 86802, + "line_number": 89160, "type": "Secret Keyword", "verified_result": null }, @@ -3594,7 +3594,7 @@ "hashed_secret": "5fb0fa884132a8724a8d7cba55853737e442adbd", "is_secret": false, "is_verified": false, - "line_number": 108081, + "line_number": 111481, "type": "Secret Keyword", "verified_result": null }, @@ -3602,7 +3602,7 @@ "hashed_secret": "1e5c2f367f02e47a8c160cda1cd9d91decbac441", "is_secret": false, "is_verified": false, - "line_number": 136739, + "line_number": 141026, "type": "Secret Keyword", "verified_result": null } diff --git a/ibm/service/database/resource_ibm_database.go b/ibm/service/database/resource_ibm_database.go index 14040d52e3..19479695a9 100644 --- a/ibm/service/database/resource_ibm_database.go +++ b/ibm/service/database/resource_ibm_database.go @@ -3152,11 +3152,18 @@ func userUpdateCreate(userData map[string]interface{}, instanceID string, meta i return fmt.Errorf("[ERROR] ChangeUserPassword (%s) failed %s\n%s", *changeUserPasswordOptions.Username, err, response) } - taskID := *changeUserPasswordResponse.Task.ID - updatePass, err := waitForDatabaseTaskComplete(taskID, d, meta, d.Timeout(schema.TimeoutUpdate)) + updatePass := true // Assume that update password passed - if err != nil { - log.Printf("[ERROR] Error waiting for database (%s) user (%s) password update task to complete: %s", instanceID, *changeUserPasswordOptions.Username, err) + if userData["type"].(string) == "ops_manager" && response.StatusCode == 404 { + updatePass = false // when user_password api can't find an ops_manager user, it returns a 404 and does not get to the point of creating a task + } else { + // when user_password api can't find a database user, its task fails + taskID := *changeUserPasswordResponse.Task.ID + updatePass, err = waitForDatabaseTaskComplete(taskID, d, meta, d.Timeout(schema.TimeoutUpdate)) + + if err != nil { + log.Printf("[ERROR] Error waiting for database (%s) user (%s) password update task to complete: %s", instanceID, *changeUserPasswordOptions.Username, err) + } } // Updating the password has failed diff --git a/ibm/service/database/resource_ibm_database_mongodb_sharding_test.go b/ibm/service/database/resource_ibm_database_mongodb_sharding_test.go index d452cb9d9d..7ced69aa72 100644 --- a/ibm/service/database/resource_ibm_database_mongodb_sharding_test.go +++ b/ibm/service/database/resource_ibm_database_mongodb_sharding_test.go @@ -138,8 +138,8 @@ func testAccCheckIBMDatabaseInstanceMongoDBShardingFullyspecified(databaseResour } users { name = "user124" - password = "password12password" - type = "database" + password = "password$12password" + type = "ops_manager" } allowlist { address = "172.168.1.2/32"