gavinbunney / terraform-provider-bitbucketserver

Terraform provider for Bitbucket Server Management
https://registry.terraform.io/providers/gavinbunney/bitbucketserver/latest
Mozilla Public License 2.0
29 stars 33 forks source link

User name with spaces doesnt work #9

Closed Kamahl19 closed 4 years ago

Kamahl19 commented 4 years ago

When I try to create a user with spaces it crashes. You can easily simulate this by putting a space into username in the test TestAccBitbucketUser like this name = "admin %v"

=== RUN   TestAccBitbucketUser
    TestAccBitbucketUser: testing.go:568: Step 0 error: errors during apply:

        Error: API Error: 404 /rest/api/1.0/users/admin+7292545641539942086 User admin+7292545641539942086 does not exist.

          on /var/folders/t6/mhc7m08j29d0jvfzxc2_zzr40000gn/T/tf-test963642486/main.tf line 2:
          (source code not available)

    TestAccBitbucketUser: testing.go:629: Error destroying resource! WARNING: Dangling resources
        may exist. The full state and error is shown below.

        Error: errors during refresh: failed to get user admin 7292545641539942086 from bitbucket: API Error: 404 /rest/api/1.0/users/admin+7292545641539942086 User admin+7292545641539942086 does not exist.

        State: <nil>
--- FAIL: TestAccBitbucketUser (0.20s)
Kamahl19 commented 4 years ago

Ok I found the bug and fix and I will provide a PR soon