BZ Correct error message when joining two projects
When joing two projects if the first one specified does not exist
instead of issueing the error "no projects found" the command fails
with a timeout.
Correct this so that regardless of which project does not exist the
correct error is thrown
@@ -33,6 +33,7 @@ var (
type JoinOptions struct {
Options *ProjectOptions
+ JoinProject *ProjectOptions
joinProjectName string
}
@@ -40,6 +41,7 @@ type JoinOptions struct {
func NewJoinOptions(streams genericclioptions.IOStreams) *JoinOptions {
return &JoinOptions{
Options: NewProjectOptions(streams),
+ JoinProject: NewProjectOptions(streams),
}
}
@@ -69,6 +71,9 @@ func (o *JoinOptions) Complete(f kcmdutil.Factory, c *cobra.Command, args []stri
if err := o.Options.Complete(f, c, args); err != nil {
return err
}
+ if err := o.JoinProject.Complete(f, c, []string{o.joinProjectName}); err != nil {
+ return err
+ }
o.Options.CheckSelector = c.Flag("selector").Changed
return nil
}
@@ -89,6 +94,10 @@ func (o *JoinOptions) Run() error {
if err != nil {
return err
}
+ _, err = o.JoinProject.GetProjects()
+ if err != nil {
+ return err
+ }
errList := []error{}
for _, project := range projects {
