Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
petersutter committed May 31, 2023
1 parent 3c69566 commit e4f900e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/cmd/resolve/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,13 @@ func (o *options) Run(f util.Factory) error {

shoot, err := findShoot(ctx, o.GardenClient, o.CurrentTarget)
if err != nil {
if errors.Is(err, target.ErrNoShootTargeted) && o.Kind == KindProject {
return target.ErrNoProjectTargeted
if errors.Is(err, target.ErrNoShootTargeted) {
switch o.Kind {
case KindProject:
return target.ErrNoProjectTargeted
case KindSeed:
return target.ErrNoSeedTargeted
}
}

return err
Expand Down
7 changes: 7 additions & 0 deletions pkg/cmd/resolve/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,13 @@ seed:
`))
})
})

It("should fail if no seed is targeted", func() {
t := target.NewTarget(gardenName, "", "", "")
o.CurrentTarget = t

Expect(o.Run(factory)).To(MatchError(target.ErrNoSeedTargeted))
})
})

Context("Resolve Project", func() {
Expand Down

0 comments on commit e4f900e

Please sign in to comment.