Skip to content

Commit 2bd1950

Browse files
authored
Merge pull request #3337 from gman0/fix-permclaim-parsing
🐛 cli/bind: fix parsing permission claims passed by cli args
2 parents e52a887 + ac9d248 commit 2bd1950

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cli/pkg/bind/cmd/cmd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ var (
3232
%[1]s bind apiexport root:my-service:my-export --name my-binding
3333
3434
# Create an APIBinding named "my-binding" that binds to the APIExport "my-export" in the "root:my-service" workspace with accepted permission claims.
35-
%[1]s bind apiexport root:my-service:my-export --name my-binding --accept-permission-claims core.secrets,core.configmaps
35+
%[1]s bind apiexport root:my-service:my-export --name my-binding --accept-permission-claims secrets.core,configmaps.core
3636
3737
# Create an APIBinding named "my-binding" that binds to the APIExport "my-export" in the "root:my-service" workspace with rejected permission claims.
38-
%[1]s bind apiexport root:my-service:my-export --name my-binding --reject-permission-claims core.secrets,core.configmaps
38+
%[1]s bind apiexport root:my-service:my-export --name my-binding --reject-permission-claims secrets.core,configmaps.core
3939
`
4040
)
4141

cli/pkg/bind/plugin/bind.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func (b *BindOptions) Run(ctx context.Context) error {
215215
}
216216

217217
func (b *BindOptions) parsePermissionClaim(claim string, accepted bool) error {
218-
claimParts := strings.Split(claim, ".")
218+
claimParts := strings.SplitN(claim, ".", 2)
219219
if len(claimParts) != 2 {
220220
return fmt.Errorf("invalid permission claim %q", claim)
221221
}

0 commit comments

Comments
 (0)