Skip to content

Commit

Permalink
Make owner an optional argument with newer version of actuated
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
  • Loading branch information
alexellis committed Aug 15, 2023
1 parent bf1af0b commit e951604
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions cmd/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ func makeJobs() *cobra.Command {

func runJobsE(cmd *cobra.Command, args []string) error {

if len(args) < 1 {
return fmt.Errorf("give an owner as an argument")
var owner string
if len(args) == 1 {
owner = strings.TrimSpace(args[0])
}
owner := strings.TrimSpace(args[0])

pat, err := getPat(cmd)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions cmd/runners.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ func makeRunners() *cobra.Command {

func runRunnersE(cmd *cobra.Command, args []string) error {

if len(args) < 1 {
return fmt.Errorf("give an owner as an argument")
var owner string
if len(args) == 1 {
owner = strings.TrimSpace(args[0])
}
owner := strings.TrimSpace(args[0])

pat, err := getPat(cmd)
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions pkg/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package pkg
import (
"fmt"
"io"
"log"
"net/http"
"net/url"
"os"
Expand Down Expand Up @@ -87,6 +88,7 @@ func (c *Client) ListRunners(patStr string, owner string, staff bool, json bool)

if len(owner) > 0 {
q.Set("owner", owner)
log.Printf("Requesting runners for owner %s", owner)
}

u.RawQuery = q.Encode()
Expand Down

0 comments on commit e951604

Please sign in to comment.