Skip to content

Commit

Permalink
chore: should pass in space_id from config as it'll grab the space id…
Browse files Browse the repository at this point in the history
… from the client if nil (#737)
  • Loading branch information
hnrkndrssn authored Aug 15, 2024
1 parent 6a770fa commit 0678c06
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions octopusdeploy_framework/datasource_environments.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ func (e *environmentDataSource) Read(ctx context.Context, req datasource.ReadReq
Take: util.GetNumber(data.Take),
}

spaceID := util.Ternary(data.SpaceID.IsNull(), e.Client.GetSpaceID(), data.SpaceID.ValueString())

existingEnvironments, err := environments.Get(e.Client, spaceID, query)
existingEnvironments, err := environments.Get(e.Client, data.SpaceID.ValueString(), query)
if err != nil {
resp.Diagnostics.AddError("unable to load environments", err.Error())
return
Expand Down
2 changes: 1 addition & 1 deletion octopusdeploy_framework/resource_variable.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func (r *variableTypeResource) Delete(ctx context.Context, req resource.DeleteRe
return
}

if _, err := variables.DeleteSingle(r.Config.Client, r.Config.SpaceID, variableOwnerID.ValueString(), data.ID.ValueString()); err != nil {
if _, err := variables.DeleteSingle(r.Config.Client, data.SpaceID.ValueString(), variableOwnerID.ValueString(), data.ID.ValueString()); err != nil {
resp.Diagnostics.AddError("unable to delete variable", err.Error())
return
}
Expand Down

0 comments on commit 0678c06

Please sign in to comment.