mirror of
https://github.com/ysoftdevs/terraform-provider-bitbucket.git
synced 2026-04-22 16:48:26 +02:00
fix provider context
This commit is contained in:
@@ -65,12 +65,9 @@ func (p *bitbucketTokenProvider) Configure(ctx context.Context, req provider.Con
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
serverURL := config.ServerURL.ValueString()
|
providerData := &ProviderData{
|
||||||
authHeader := config.AuthHeader.ValueString()
|
AuthHeader: config.AuthHeader.ValueString(),
|
||||||
|
ServerURL: config.ServerURL.ValueString(),
|
||||||
providerData := ProviderData{
|
|
||||||
AuthHeader: authHeader,
|
|
||||||
ServerURL: serverURL,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
resp.DataSourceData = providerData
|
resp.DataSourceData = providerData
|
||||||
|
|||||||
@@ -70,14 +70,10 @@ func (r *BitbucketTokenResource) Schema(_ context.Context, req resource.SchemaRe
|
|||||||
|
|
||||||
func (r *BitbucketTokenResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) {
|
func (r *BitbucketTokenResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) {
|
||||||
if req.ProviderData == nil {
|
if req.ProviderData == nil {
|
||||||
resp.Diagnostics.AddError(
|
|
||||||
"Missing provider configuration",
|
|
||||||
"The Bitbucket provider was not configured before using this resource.",
|
|
||||||
)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
providerData, ok := req.ProviderData.(ProviderData)
|
providerData, ok := req.ProviderData.(*ProviderData)
|
||||||
if !ok {
|
if !ok {
|
||||||
resp.Diagnostics.AddError(
|
resp.Diagnostics.AddError(
|
||||||
"Unexpected Provider Data Type",
|
"Unexpected Provider Data Type",
|
||||||
|
|||||||
Reference in New Issue
Block a user