Skip to content

Commit e133f2e

Browse files
committed
resource provider
1 parent 4b2d1e3 commit e133f2e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/resourceprovider/resourceprovider.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ import (
99
"github.com/ctrlplanedev/cli/internal/api"
1010
)
1111

12-
func New(client *api.ClientWithResponses, workspaceId string, name string) (*ResourceProvider, error) {
13-
log.Debug("Upserting resource provider", "workspaceId", workspaceId, "name", name)
12+
func New(client *api.ClientWithResponses, workspace string, name string) (*ResourceProvider, error) {
1413
ctx := context.Background()
14+
workspaceId := client.GetWorkspaceID(ctx, workspace).String()
1515

1616
log.Debug("Upserting resource provider", "workspaceId", workspaceId, "name", name)
17+
1718
resp, err := client.UpsertResourceProviderWithResponse(ctx, workspaceId, api.UpsertResourceProviderJSONRequestBody{
1819
Name: name,
1920
})

0 commit comments

Comments
 (0)