Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions registry/tagging.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package registry

import (
"context"
"fmt"
"strings"

"github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/operations"
"github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/shared"
Expand All @@ -22,5 +24,18 @@ func AddTags(ctx context.Context, namespaceName, revisionDigest string, tags []s
},
})

if isMismatchedWorkspaceError(err) {
return fmt.Errorf("The current workspace does not match the original workspace for this registry entry. Ensure you are in the correct workspace.")
}
return err
}

func isMismatchedWorkspaceError(err error) bool {
message := err.Error()

if strings.Contains(message, "resolving for reference") {
return true
}

return false
}
Loading