Skip to content
This repository was archived by the owner on Mar 13, 2021. It is now read-only.

Commit fbe8ef6

Browse files
committed
Add command riff doctor
1 parent e71ab46 commit fbe8ef6

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed

docs/riff.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ riff is for functions
2020
* [riff application](riff_application.md) - applications built from source using application buildpacks
2121
* [riff completion](riff_completion.md) - generate shell completion script
2222
* [riff credential](riff_credential.md) - credentials for container registries
23+
* [riff doctor](riff_doctor.md) - check riff's requirements are installed
2324
* [riff function](riff_function.md) - functions built from source using function buildpacks
2425
* [riff handler](riff_handler.md) - handlers map HTTP requests to applications, functions or images
2526
* [riff processor](riff_processor.md) - processors apply functions to messages on streams

docs/riff_doctor.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## riff doctor
2+
3+
check riff's requirements are installed
4+
5+
### Synopsis
6+
7+
<todo>
8+
9+
```
10+
riff doctor [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
riff doctor
17+
```
18+
19+
### Options
20+
21+
```
22+
-h, --help help for doctor
23+
```
24+
25+
### Options inherited from parent commands
26+
27+
```
28+
--config file config file (default is $HOME/.riff.yaml)
29+
--kube-config file kubectl config file (default is $HOME/.kube/config)
30+
--no-color disable color output in terminals
31+
```
32+
33+
### SEE ALSO
34+
35+
* [riff](riff.md) - riff is for functions
36+

pkg/riff/commands/riff.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func NewRiffCommand(c *cli.Config) *cobra.Command {
3939
cmd.AddCommand(NewHandlerCommand(c))
4040
cmd.AddCommand(NewStreamCommand(c))
4141
cmd.AddCommand(NewProcessorCommand(c))
42+
cmd.AddCommand(NewDoctorCommand(c))
4243

4344
return cmd
4445
}

pkg/riff/commands/riff_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package commands_test
1818

1919
import (
20+
"github.com/projectriff/riff/pkg/cli"
2021
"testing"
2122

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

3435
table.Run(t, commands.NewRiffCommand)
3536
}
37+
38+
func TestRiffMainSubCommands(t *testing.T) {
39+
riffCommand := commands.NewRiffCommand(cli.NewDefaultConfig())
40+
commands := riffCommand.Commands()
41+
42+
expectedCount := 7
43+
count := len(commands)
44+
if count != expectedCount {
45+
t.Fatalf("Expected %d riff subcommands, got %d", expectedCount, count)
46+
}
47+
}

0 commit comments

Comments
 (0)