Skip to content
Permalink
Browse files

Add command riff doctor

  • Loading branch information...
zhitongLIU committed Jun 16, 2019
1 parent e71ab46 commit fbe8ef6957d3e6400de325f958dbce3103b3019b
Showing with 50 additions and 0 deletions.
  1. +1 −0 docs/riff.md
  2. +36 −0 docs/riff_doctor.md
  3. +1 −0 pkg/riff/commands/riff.go
  4. +12 −0 pkg/riff/commands/riff_test.go
@@ -20,6 +20,7 @@ riff is for functions
* [riff application](riff_application.md) - applications built from source using application buildpacks
* [riff completion](riff_completion.md) - generate shell completion script
* [riff credential](riff_credential.md) - credentials for container registries
* [riff doctor](riff_doctor.md) - check riff's requirements are installed
* [riff function](riff_function.md) - functions built from source using function buildpacks
* [riff handler](riff_handler.md) - handlers map HTTP requests to applications, functions or images
* [riff processor](riff_processor.md) - processors apply functions to messages on streams
@@ -0,0 +1,36 @@
## riff doctor

check riff's requirements are installed

### Synopsis

<todo>

```
riff doctor [flags]
```

### Examples

```
riff doctor
```

### Options

```
-h, --help help for doctor
```

### Options inherited from parent commands

```
--config file config file (default is $HOME/.riff.yaml)
--kube-config file kubectl config file (default is $HOME/.kube/config)
--no-color disable color output in terminals
```

### SEE ALSO

* [riff](riff.md) - riff is for functions

@@ -39,6 +39,7 @@ func NewRiffCommand(c *cli.Config) *cobra.Command {
cmd.AddCommand(NewHandlerCommand(c))
cmd.AddCommand(NewStreamCommand(c))
cmd.AddCommand(NewProcessorCommand(c))
cmd.AddCommand(NewDoctorCommand(c))

return cmd
}
@@ -17,6 +17,7 @@
package commands_test

import (
"github.com/projectriff/riff/pkg/cli"
"testing"

"github.com/projectriff/riff/pkg/riff/commands"
@@ -33,3 +34,14 @@ func TestRiffCommand(t *testing.T) {

table.Run(t, commands.NewRiffCommand)
}

func TestRiffMainSubCommands(t *testing.T) {
riffCommand := commands.NewRiffCommand(cli.NewDefaultConfig())
commands := riffCommand.Commands()

expectedCount := 7
count := len(commands)
if count != expectedCount {
t.Fatalf("Expected %d riff subcommands, got %d", expectedCount, count)
}
}

0 comments on commit fbe8ef6

Please sign in to comment.
You can’t perform that action at this time.