Fix early_auth_check always set to true
The provider configuration option early_auth_check
is currently broken and always set to true.
_, ok := d.GetOk()
sets ok
to false
for boolean types with a value of false.
I know the function GetOkExists()
is deprecated but there seems to be no other way to check if a boolean attribute is not set or set to false.
Configuration
provider "gitlab" {
early_auth_check = false
token = "foo"
}
Expected Behaviour
No initial auth check to https://gitlab.com/api/v4/user
is executed.
Actual Behaviour
Initial auth check to https://gitlab.com/api/v4/user
is executed.
Error: GET https://gitlab.com/api/v4/user: 401 {message: 401 Unauthorized}
with provider["registry.terraform.io/gitlabhq/gitlab"],
on main.tf line 10, in provider "gitlab":
10: provider "gitlab" {