Skip to content

Commit 74360b1

Browse files
Merge pull request #106 from pluralsh/awscli-vsn-error
Autodetect awscli version outdated
2 parents a3f8f24 + 63171ea commit 74360b1

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

cmd/plural/workspace.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"fmt"
5+
"strings"
56
"os"
67
"path/filepath"
78

@@ -131,8 +132,16 @@ func createCrds(c *cli.Context) error {
131132
return nil
132133
}
133134

134-
if err := utils.Exec("kubectl", "create", "-f", path); err != nil {
135-
return utils.Exec("kubectl", "replace", "-f", path)
135+
if err = utils.Exec("kubectl", "create", "-f", path); err != nil {
136+
err = utils.Exec("kubectl", "replace", "-f", path)
137+
}
138+
139+
if err != nil {
140+
errStr := fmt.Sprint(err)
141+
if strings.Contains(errStr, "invalid apiVersion \"client.authentication.k8s.io/v1alpha1\"") {
142+
return fmt.Errorf("kubectl failed with %s, this is usually due to your aws cli version being out of date", errStr)
143+
}
144+
return err
136145
}
137146

138147
return nil

pkg/api/recipes.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type RecipeInput struct {
1010
Description string
1111
Provider string
1212
Restricted bool
13-
Tests []RecipeTestInput `yaml:"tests",json:"tests,omitempty"`
13+
Tests []RecipeTestInput `yaml:"tests" json:"tests,omitempty"`
1414
Sections []RecipeSectionInput
1515
Dependencies []DependencyInput
1616
OidcSettings *OIDCSettings `yaml:"oidcSettings,omitempty"`
@@ -65,7 +65,7 @@ type ConfigurationItemInput struct {
6565
Placeholder string
6666
Longform string
6767
Optional bool
68-
FunctionName string `yaml:"functionName,omitempty",json:"functionName,omitempty"`
68+
FunctionName string `yaml:"functionName,omitempty" json:"functionName,omitempty"`
6969
Condition *ConditionInput
7070
Validation *ValidationInput
7171
}

0 commit comments

Comments
 (0)