-
Notifications
You must be signed in to change notification settings - Fork 42
Conversation
after targeting a new shoot I still have the same shoot in the target stack
|
Hi @DockToFuture , I fixed second issue in c86ab58 , For the first issue Could you please raise an example for this issue? then i can get an better understandinfg on this... Thanks a lot! |
I would expect in the following example, that after I have dropped the namespace from the target stack and I execute
|
Hi @DockToFuture ,
also add some code in Thanks |
c193fd5
to
4892f69
Compare
pkg/cmd/target.go
Outdated
ReadTarget(pathTarget, &targetReal) | ||
|
||
if len(targetReal.Target) == 1 && targetReal.Stack()[0].Kind == "namespace" { | ||
panic("the target has only namespace, this is invalid, at least one garden needs to be targeted before using namespace") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you replace panic
function with return errors.New("error message")
? User will be confused by the stack trace.
pkg/cmd/target.go
Outdated
} else if len(targetReal.Target) == 1 && targetReal.Stack()[0].Kind != "namespace" { | ||
target.Target = targetReal.Target | ||
} else { | ||
panic("length of target.Stack is illegal") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
pkg/cmd/target.go
Outdated
ReadTarget(pathTarget, &target) | ||
|
||
if len(target.Target) > 4 { | ||
panic("the length is greater than 4 and illegal") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
pkg/cmd/target.go
Outdated
panic("the length is greater than 4 and illegal") | ||
} | ||
if len(target.Target) == 0 { | ||
panic("the length is 0 and illegal. at least one garden needs to be targeted") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
pkg/cmd/target.go
Outdated
} | ||
if len(target.Target) == 1 { | ||
if string(target.Target[0].Kind) != "garden" { | ||
panic("if one element in target, this needs to be garden") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
Hi @DockToFuture , Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm, thank you for the pr!
thanks @DockToFuture ! |
What this PR does / why we need it:
This PR makes namespace to be one kind of target, just like garden/seed/project/shoot
Which issue(s) this PR fixes:
Fixes # #169
Special notes for your reviewer:
gardenctl ls namespace
is supportedand verified target status in
cat /Users/i352986/.garden/sessions/plantingSession/target
Release note: