Skip to content

Commit

Permalink
Merge pull request #98 from josephschorr/fix-read-build
Browse files Browse the repository at this point in the history
Fix building of the read relationships call in zed
  • Loading branch information
jzelinskie authored Mar 11, 2022
2 parents be081cb + 096ad6b commit 3bff91a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmd/zed/relationship.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,19 +200,19 @@ func buildReadRequest(cmd *cobra.Command, args []string) (*v1.ReadRelationshipsR
}
}

subjectFilter := cobrautil.MustGetString(cmd, "subject-filter")
switch {
case len(args) > 1:
if len(args) > 1 {
readFilter.OptionalRelation = args[1]
}

case len(args) == 3:
subjectFilter := cobrautil.MustGetString(cmd, "subject-filter")
if len(args) == 3 {
if subjectFilter != "" {
return nil, errors.New("cannot specify subject filter both positionally and via --subject-filter")
}
subjectFilter = args[2]
fallthrough
}

case subjectFilter != "":
if subjectFilter != "" {
if strings.Contains(subjectFilter, ":") {
subjectNS, subjectID, subjectRel, err := parseSubject(subjectFilter)
if err != nil {
Expand Down

0 comments on commit 3bff91a

Please sign in to comment.