From 622709fa5417423a838ce538dbbf17520cb0cd8a Mon Sep 17 00:00:00 2001 From: Kacper Sawicki Date: Mon, 2 Nov 2020 19:51:48 +0100 Subject: [PATCH 1/5] Compare exit code 1 when error occurs --- cmd/compare.go | 6 +++++- cmd/sync.go | 6 +++++- go.mod | 1 - go.sum | 17 ----------------- resourcemanager/resourcemanager.go | 5 ++++- 5 files changed, 14 insertions(+), 21 deletions(-) diff --git a/cmd/compare.go b/cmd/compare.go index ca6e4a4..eedb221 100644 --- a/cmd/compare.go +++ b/cmd/compare.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "io" + "os" c "github.com/codilime/floodgate/config" rm "github.com/codilime/floodgate/resourcemanager" @@ -43,7 +44,10 @@ func runCompare(cmd *cobra.Command, options compareOptions) error { if err := resourceManager.Init(config); err != nil { return err } - changes := resourceManager.GetChanges() + changes, err := resourceManager.GetChanges() + if err != nil { + os.Exit(1) + } if len(changes) == 0 { return nil } diff --git a/cmd/sync.go b/cmd/sync.go index e89b4fd..0e4f645 100644 --- a/cmd/sync.go +++ b/cmd/sync.go @@ -3,6 +3,7 @@ package cmd import ( "fmt" "io" + "os" c "github.com/codilime/floodgate/config" rm "github.com/codilime/floodgate/resourcemanager" @@ -46,7 +47,10 @@ func runSync(cmd *cobra.Command, options syncOptions) error { return err } if options.dryRun { - changes := resourceManager.GetChanges() + changes, err := resourceManager.GetChanges() + if err != nil { + os.Exit(1) + } printChangedResources(cmd.OutOrStdout(), changes) } else { if err := resourceManager.SyncResources(); err != nil { diff --git a/go.mod b/go.mod index 6ef87de..6bea21e 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,6 @@ go 1.14 require ( github.com/antihax/optional v1.0.0 - github.com/boscard/gateapi v0.0.0-20200701082216-4601ca769d77 github.com/ghodss/yaml v1.0.0 github.com/google/go-jsonnet v0.15.0 github.com/hashicorp/terraform v0.12.26 diff --git a/go.sum b/go.sum index 742494a..25cf98c 100644 --- a/go.sum +++ b/go.sum @@ -66,8 +66,6 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bmatcuk/doublestar v1.1.5/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/boscard/gateapi v0.0.0-20200701082216-4601ca769d77 h1:WuGxEm32bM23fg+qlcuAKOHTQFZb6/nRJneiHv3gGWo= -github.com/boscard/gateapi v0.0.0-20200701082216-4601ca769d77/go.mod h1:qIknioQFfp5lnzV4NbaaCzHe5uUjVIKez65GZ9qPRcs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= @@ -82,8 +80,6 @@ github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/corona10/goimagehash v1.0.2 h1:pUfB0LnsJASMPGEZLj7tGY251vF+qLGqOgEP4rUs6kA= -github.com/corona10/goimagehash v1.0.2/go.mod h1:/l9umBhvcHQXVtQO1V6Gp1yD20STawkhRnnX0D1bvVI= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -98,8 +94,6 @@ github.com/dylanmei/winrmtest v0.0.0-20190225150635-99b7fe2fddf1/go.mod h1:lcy9/ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8= -github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= @@ -113,13 +107,9 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/go-test/deep v1.0.1/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/goccy/go-graphviz v0.0.5 h1:qcjgvNiYbLyfLAq9LvyYBJ7sNMbQh9w4FoAzBDrYhYw= -github.com/goccy/go-graphviz v0.0.5/go.mod h1:wXVsXxmyMQU6TN3zGRttjNn3h+iCAS7xQFC6TlNvLhk= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -203,7 +193,6 @@ github.com/hashicorp/vault v0.10.4/go.mod h1:KfSyffbKxoVyspOdlaGVjIuwLobi07qD1bA github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -274,8 +263,6 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nfnt/resize v0.0.0-20160724205520-891127d8d1b5 h1:BvoENQQU+fZ9uukda/RzCAL/191HHwJA5b13R6diVlY= -github.com/nfnt/resize v0.0.0-20160724205520-891127d8d1b5/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= @@ -371,15 +358,11 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90Pveol golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72 h1:+ELyKg6m8UBf0nPFSqD0mi7zUfwPyXo23HNjMnXPz7w= -golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 h1:cg5LA/zNPRzIXIWSCxQW10Rvpy94aQh3LT/ShoCpkHw= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20200119044424-58c23975cae1 h1:5h3ngYt7+vXCDZCup/HkCQgW5XwmSvR/nA2JmJ0RErg= -golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= diff --git a/resourcemanager/resourcemanager.go b/resourcemanager/resourcemanager.go index 69096f0..aad3ad3 100644 --- a/resourcemanager/resourcemanager.go +++ b/resourcemanager/resourcemanager.go @@ -70,12 +70,13 @@ func (rm ResourceManager) GetResources() spr.SpinnakerResources { } // GetChanges get resources' changes -func (rm ResourceManager) GetChanges() (changes []ResourceChange) { +func (rm ResourceManager) GetChanges() (changes []ResourceChange, err error) { for _, application := range rm.resources.Applications { var change string changed, err := application.IsChanged() if err != nil { log.Fatal(err) + return changes, err } if changed { change = application.GetFullDiff() @@ -87,6 +88,7 @@ func (rm ResourceManager) GetChanges() (changes []ResourceChange) { changed, err := pipeline.IsChanged() if err != nil { log.Fatal(err) + return changes, err } if changed { change = pipeline.GetFullDiff() @@ -98,6 +100,7 @@ func (rm ResourceManager) GetChanges() (changes []ResourceChange) { changed, err := pipelineTemplate.IsChanged() if err != nil { log.Fatal(err) + return changes, err } if changed { change = pipelineTemplate.GetFullDiff() From 862d7cd9a2b95ec470833256987aa9eb163f2410 Mon Sep 17 00:00:00 2001 From: Kacper Sawicki Date: Mon, 2 Nov 2020 19:55:27 +0100 Subject: [PATCH 2/5] Change exit code to 2 --- cmd/compare.go | 2 +- cmd/sync.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/compare.go b/cmd/compare.go index eedb221..9cf4f54 100644 --- a/cmd/compare.go +++ b/cmd/compare.go @@ -46,7 +46,7 @@ func runCompare(cmd *cobra.Command, options compareOptions) error { } changes, err := resourceManager.GetChanges() if err != nil { - os.Exit(1) + os.Exit(2) } if len(changes) == 0 { return nil diff --git a/cmd/sync.go b/cmd/sync.go index 0e4f645..a0e9032 100644 --- a/cmd/sync.go +++ b/cmd/sync.go @@ -49,7 +49,7 @@ func runSync(cmd *cobra.Command, options syncOptions) error { if options.dryRun { changes, err := resourceManager.GetChanges() if err != nil { - os.Exit(1) + os.Exit(2) } printChangedResources(cmd.OutOrStdout(), changes) } else { From 383a9ad14d35cce41b49ca60bb8d8544941c3a14 Mon Sep 17 00:00:00 2001 From: Dawid Trzebiatowski Date: Tue, 3 Nov 2020 15:46:29 +0100 Subject: [PATCH 3/5] Update CI to code changes --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 16753a7..678a102 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -254,7 +254,7 @@ jobs: echo "Print version using version command" /floodgate/bin/floodgate version echo "Comare changes - clean Spinnaker" - /floodgate/bin/floodgate << parameters.floodgate_extra_params >> --config ~/floodgate.yaml compare && exit 1 || echo "Found changes" + /floodgate/bin/floodgate << parameters.floodgate_extra_params >> --config ~/floodgate.yaml compare && exit 1 || if [ $? -eq 1 ]; then echo "Found changes"; else echo "Unsupported error code: $?"; exit 1; fi echo "Apply local resources" /floodgate/bin/floodgate << parameters.floodgate_extra_params >> --config ~/floodgate.yaml sync echo "Compare changes - synced resources" From 589e50d26205a5785ad2b6cffe4acbd0b3c32131 Mon Sep 17 00:00:00 2001 From: Kacper Sawicki Date: Tue, 3 Nov 2020 16:16:46 +0100 Subject: [PATCH 4/5] Change main err exit code --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 63c0801..e3b8918 100644 --- a/main.go +++ b/main.go @@ -10,6 +10,6 @@ import ( func main() { if err := cmd.Execute(os.Stdout); err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) - os.Exit(1) + os.Exit(256) } } From f71d8fec83c91ff3284ae2a0b36b3032e7cea5ec Mon Sep 17 00:00:00 2001 From: Kacper Sawicki Date: Tue, 3 Nov 2020 19:06:40 +0100 Subject: [PATCH 5/5] Fix exit codes --- cmd/apply.go | 3 ++- cmd/compare.go | 9 ++++++--- cmd/execute.go | 2 +- cmd/inspect.go | 3 ++- cmd/sync.go | 2 +- parser/parser.go | 6 +++--- resourcemanager/resourcemanager.go | 5 ++++- 7 files changed, 19 insertions(+), 11 deletions(-) diff --git a/cmd/apply.go b/cmd/apply.go index 789c3e3..3d867fc 100644 --- a/cmd/apply.go +++ b/cmd/apply.go @@ -7,6 +7,7 @@ import ( "io" "io/ioutil" "log" + "os" ) // applyOptions store apply command options @@ -48,7 +49,7 @@ func runApply(cmd *cobra.Command, options applyOptions) error { resourceManager := &rm.ResourceManager{} if err := resourceManager.Init(config); err != nil { - return err + os.Exit(2) } resources := resourceManager.GetResources() diff --git a/cmd/compare.go b/cmd/compare.go index 9cf4f54..b663b2a 100644 --- a/cmd/compare.go +++ b/cmd/compare.go @@ -1,7 +1,6 @@ package cmd import ( - "errors" "fmt" "io" "os" @@ -42,7 +41,7 @@ func runCompare(cmd *cobra.Command, options compareOptions) error { config.Merge(cfg) resourceManager := &rm.ResourceManager{} if err := resourceManager.Init(config); err != nil { - return err + os.Exit(2) } changes, err := resourceManager.GetChanges() if err != nil { @@ -52,8 +51,12 @@ func runCompare(cmd *cobra.Command, options compareOptions) error { return nil } + //print changes and exit with code 1 printCompareDiff(cmd.OutOrStdout(), changes) - return errors.New("end diff") + fmt.Println("end diff") + os.Exit(1) + + return nil } func printCompareDiff(out io.Writer, changes []rm.ResourceChange) { diff --git a/cmd/execute.go b/cmd/execute.go index 3b3bbb1..1318748 100644 --- a/cmd/execute.go +++ b/cmd/execute.go @@ -59,7 +59,7 @@ func runExecute(cmd *cobra.Command, options executeOptions) error { resourceManager := &rm.ResourceManager{} if err := resourceManager.Init(config); err != nil { - return err + os.Exit(2) } client := resourceManager.GetClient() diff --git a/cmd/inspect.go b/cmd/inspect.go index fc47d00..0791dcf 100644 --- a/cmd/inspect.go +++ b/cmd/inspect.go @@ -3,6 +3,7 @@ package cmd import ( "fmt" "io" + "os" c "github.com/codilime/floodgate/config" rm "github.com/codilime/floodgate/resourcemanager" @@ -40,7 +41,7 @@ func runInspect(cmd *cobra.Command, options inspectOptions) error { config.Merge(cfg) resourceManager := &rm.ResourceManager{} if err := resourceManager.Init(config); err != nil { - return err + os.Exit(2) } fmt.Fprintln(cmd.OutOrStdout(), "Current Spinnaker resource status:") fmt.Fprintln(cmd.OutOrStdout(), "\nApplications:") diff --git a/cmd/sync.go b/cmd/sync.go index a0e9032..840b948 100644 --- a/cmd/sync.go +++ b/cmd/sync.go @@ -44,7 +44,7 @@ func runSync(cmd *cobra.Command, options syncOptions) error { config.Merge(cfg) resourceManager := &rm.ResourceManager{} if err := resourceManager.Init(config); err != nil { - return err + os.Exit(2) } if options.dryRun { changes, err := resourceManager.GetChanges() diff --git a/parser/parser.go b/parser/parser.go index 1141572..5a2c3c8 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -65,7 +65,7 @@ func (p *Parser) ParseDirectories(directories []string) (*ParsedResourceData, er for _, entrypoint := range directories { output, err := p.loadFilesFromDirectory(entrypoint) if err != nil { - log.Fatal(err) + log.Warn(err) return nil, err } objects = append(objects, output...) @@ -93,8 +93,8 @@ func (p *Parser) loadFilesFromDirectory(entrypoint string) ([]map[string]interfa } obj, err := fileLoader.LoadFile(path) if err != nil { - log.Warn(f.Name(), " not loaded due to\n", err) - return nil + log.Warn(f.Name(), " not loaded due to") + return err } objects = append(objects, obj...) log.Debugf("Loaded file: %s", path) diff --git a/resourcemanager/resourcemanager.go b/resourcemanager/resourcemanager.go index aad3ad3..2cc2d3a 100644 --- a/resourcemanager/resourcemanager.go +++ b/resourcemanager/resourcemanager.go @@ -55,7 +55,10 @@ func (rm *ResourceManager) Init(config *c.Config, customOptions ...Option) error if err != nil { return err } - rm.createResourcesFromData(resourceData) + err = rm.createResourcesFromData(resourceData) + if err != nil { + return err + } return nil }