github.com/kubeshop/testkube@v1.17.23/cmd/kubectl-testkube/commands/createticket.go (about)

     1  package commands
     2  
     3  import (
     4  	"github.com/spf13/cobra"
     5  
     6  	"github.com/kubeshop/testkube/cmd/kubectl-testkube/commands/common"
     7  	debuginfo "github.com/kubeshop/testkube/cmd/kubectl-testkube/commands/debug"
     8  	"github.com/kubeshop/testkube/cmd/kubectl-testkube/commands/github"
     9  	"github.com/kubeshop/testkube/pkg/ui"
    10  )
    11  
    12  func NewCreateTicketCmd() *cobra.Command {
    13  	return &cobra.Command{
    14  		Use:   "create-ticket",
    15  		Short: "Create bug ticket",
    16  		Long:  "Create an issue of type bug in the Testkube repository",
    17  		Run: func(cmd *cobra.Command, args []string) {
    18  			client, _, err := common.GetClient(cmd)
    19  			ui.ExitOnError("getting client", err)
    20  
    21  			debug, err := debuginfo.GetDebugInfo(client)
    22  			ui.ExitOnError("get debug info", err)
    23  			ui.ExitOnError("opening GitHub ticket", github.OpenTicket(debug))
    24  		},
    25  	}
    26  }