github.com/olli-ai/jx/v2@v2.0.400-0.20210921045218-14731b4dd448/pkg/cmd/step/verify/step_verify_pod.go (about)

     1  package verify
     2  
     3  import (
     4  	"github.com/olli-ai/jx/v2/pkg/cmd/helper"
     5  	"github.com/olli-ai/jx/v2/pkg/cmd/opts"
     6  	"github.com/olli-ai/jx/v2/pkg/cmd/opts/step"
     7  	"github.com/spf13/cobra"
     8  )
     9  
    10  // StepVerifyPodOptions contains the command line flags
    11  type StepVerifyPodOptions struct {
    12  	step.StepOptions
    13  }
    14  
    15  // NewCmdStepVerifyPod creates the `jx step verify pod` command
    16  func NewCmdStepVerifyPod(commonOpts *opts.CommonOptions) *cobra.Command {
    17  
    18  	options := &StepVerifyPodOptions{
    19  		StepOptions: step.StepOptions{
    20  			CommonOptions: commonOpts,
    21  		},
    22  	}
    23  
    24  	cmd := &cobra.Command{
    25  		Use:   "pod",
    26  		Short: "pod [command]",
    27  		Run: func(cmd *cobra.Command, args []string) {
    28  			options.Cmd = cmd
    29  			options.Args = args
    30  			err := options.Run()
    31  			helper.CheckErr(err)
    32  		},
    33  	}
    34  	cmd.AddCommand(NewCmdStepVerifyPodCount(commonOpts))
    35  	cmd.AddCommand(NewCmdStepVerifyPodReady(commonOpts))
    36  	return cmd
    37  }
    38  
    39  // Run implements this command
    40  func (o *StepVerifyPodOptions) Run() error {
    41  	return o.Cmd.Help()
    42  }