diff --git a/cmd/environment.go b/cmd/environment.go index ecd113a3..f7dddd4b 100644 --- a/cmd/environment.go +++ b/cmd/environment.go @@ -3,6 +3,7 @@ package cmd import ( "context" "fmt" + s "github.com/uselagoon/machinery/api/schema" "os" "strings" @@ -13,7 +14,6 @@ import ( "github.com/uselagoon/lagoon-cli/pkg/output" l "github.com/uselagoon/machinery/api/lagoon" lclient "github.com/uselagoon/machinery/api/lagoon/client" - s "github.com/uselagoon/machinery/api/schema" ) // @TODO re-enable this at some point if more environment based commands are made available @@ -131,10 +131,16 @@ var updateEnvironmentCmd = &cobra.Command{ } if environmentType != "" { envType := s.EnvType(strings.ToUpper(environmentType)) + if validationErr := s.ValidateType(envType); validationErr != nil { + handleError(validationErr) + } environmentFlags.EnvironmentType = &envType } if deployT != "" { deployType := s.DeployType(strings.ToUpper(deployT)) + if validationErr := s.ValidateType(deployType); validationErr != nil { + handleError(validationErr) + } environmentFlags.DeployType = &deployType } diff --git a/go.mod b/go.mod index 07b84f04..4ec1069e 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( github.com/guregu/null v4.0.0+incompatible // workaround for https://github.com/manifoldco/promptui/issues/98 github.com/nicksnyder/go-i18n v1.10.1 // indirect - github.com/uselagoon/machinery v0.0.10 + github.com/uselagoon/machinery v0.0.11 golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 // indirect golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect gopkg.in/alecthomas/kingpin.v3-unstable v3.0.0-20191105091915-95d230a53780 // indirect @@ -41,4 +41,4 @@ replace github.com/olekukonko/tablewriter => github.com/shreddedbacon/tablewrite // replace github.com/machinebox/graphql => ../../shreddedbacon/graphql -// replace github.com/olekukonko/tablewriter => ../../shreddedbacon/tablewriter +// replace github.com/olekukonko/tablewriter => ../../shreddedbacon/tablewriter \ No newline at end of file diff --git a/go.sum b/go.sum index 448aa306..fe18d60a 100644 --- a/go.sum +++ b/go.sum @@ -105,12 +105,8 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/tsenart/deadcode v0.0.0-20160724212837-210d2dc333e9 h1:vY5WqiEon0ZSTGM3ayVVi+twaHKHDFUVloaQ/wug9/c= github.com/tsenart/deadcode v0.0.0-20160724212837-210d2dc333e9/go.mod h1:q+QjxYvZ+fpjMXqs+XEriussHjSYqeXVnAdSV1tkMYk= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/uselagoon/machinery v0.0.8 h1:PDPjBOoQGcmDDFsdibVN/iNkvWo3LJd1Yj+jOuw2bBg= -github.com/uselagoon/machinery v0.0.8/go.mod h1:dGAvkxWQkRu/eLQeWLrTl5HvNoFsiXlXInCptHUxzUw= -github.com/uselagoon/machinery v0.0.9-0.20230710124508-ef420b365811 h1:OUujMdzHe71+7l/GlS4VRyvehatO/jTT9+EIfbr+gwc= -github.com/uselagoon/machinery v0.0.9-0.20230710124508-ef420b365811/go.mod h1:IXLxlkahEAEgpCmu9Xa/Wmjo6ja4Aoq7tf8G7VrileE= -github.com/uselagoon/machinery v0.0.10 h1:pR+2iwXod0XnnyeZsJMlmkSU5BV8cYI65JNoaLwUVbQ= -github.com/uselagoon/machinery v0.0.10/go.mod h1:IXLxlkahEAEgpCmu9Xa/Wmjo6ja4Aoq7tf8G7VrileE= +github.com/uselagoon/machinery v0.0.11 h1:s6EhyU/pj1+C4FdS0EqmR6C0dLsoeCd9n+5xHL1YDag= +github.com/uselagoon/machinery v0.0.11/go.mod h1:IXLxlkahEAEgpCmu9Xa/Wmjo6ja4Aoq7tf8G7VrileE= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=