diff --git a/cmd/operator.go b/cmd/operator.go index 6b3cf177..e833cd00 100644 --- a/cmd/operator.go +++ b/cmd/operator.go @@ -51,10 +51,10 @@ func run(cmd *cobra.Command, args []string) error { return fmt.Errorf("failed to load properties: %v", err) } - if ok, err := duty.HasMigrationRun(ctx, api.DefaultContext.Pool()); err != nil { + if ok, err := duty.HasMigrationsRun(ctx, api.DefaultContext.Pool()); err != nil { return fmt.Errorf("failed to check if migrations have run: %w", err) } else if !ok { - return errors.New("migrations haven't run yet") + return errors.New("Migrations not run, waiting for mission-control pod to start") } zapLogger := logger.GetZapLogger() diff --git a/cmd/server.go b/cmd/server.go index e5c324f5..74018c71 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -28,10 +28,10 @@ var Serve = &cobra.Command{ RunE: func(cmd *cobra.Command, args []string) error { api.DefaultContext = api.NewScrapeContext(db.MustInit()) - if ok, err := duty.HasMigrationRun(cmd.Context(), api.DefaultContext.Pool()); err != nil { + if ok, err := duty.HasMigrationsRun(cmd.Context(), api.DefaultContext.Pool()); err != nil { return fmt.Errorf("failed to check if migrations have run: %w", err) } else if !ok { - return errors.New("migrations haven't run yet") + return errors.New("Migrations not run, waiting for mission-control pod to start") } if err := dutyContext.LoadPropertiesFromFile(api.DefaultContext.DutyContext(), propertiesFile); err != nil { diff --git a/go.mod b/go.mod index 2045d8ba..a1d821e7 100644 --- a/go.mod +++ b/go.mod @@ -41,7 +41,7 @@ require ( github.com/evanphx/json-patch v5.6.0+incompatible github.com/fergusstrange/embedded-postgres v1.25.0 github.com/flanksource/commons v1.22.1 - github.com/flanksource/duty v1.0.445 + github.com/flanksource/duty v1.0.447 github.com/flanksource/is-healthy v1.0.4 github.com/flanksource/ketall v1.1.6 github.com/flanksource/mapstructure v1.6.0 @@ -296,7 +296,7 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) -replace github.com/flanksource/duty => ../duty +// replace github.com/flanksource/duty => ../duty // replace github.com/flanksource/ketall => ../ketall diff --git a/go.sum b/go.sum index 3d6d5182..8d33229b 100644 --- a/go.sum +++ b/go.sum @@ -856,6 +856,8 @@ github.com/fergusstrange/embedded-postgres v1.25.0 h1:sa+k2Ycrtz40eCRPOzI7Ry7Ttk github.com/fergusstrange/embedded-postgres v1.25.0/go.mod h1:t/MLs0h9ukYM6FSt99R7InCHs1nW0ordoVCcnzmpTYw= github.com/flanksource/commons v1.22.1 h1:Ycg8r26bx537UTdAEFgngDW1r2j5bX6Lr3NGxLICpiw= github.com/flanksource/commons v1.22.1/go.mod h1:GD5+yGvmYFPIW3WMNN+y1JkeDMJY74e05pQAsRbrvwY= +github.com/flanksource/duty v1.0.447 h1:Dxt7ZVfhboS5jloyWLPt28/MpgrVNL5CfzyCA9s4ZPw= +github.com/flanksource/duty v1.0.447/go.mod h1:eF0Z6vZ2vSO1vy8HDYMc+OkhGWx4Pg5+P16gUuL8+oI= github.com/flanksource/gomplate/v3 v3.20.4/go.mod h1:27BNWhzzSjDed1z8YShO6W+z6G9oZXuxfNFGd/iGSdc= github.com/flanksource/gomplate/v3 v3.24.2 h1:WZSriw1MaBhzrDV1IOP9eNsupIPxIHy0yTaMOVhCvsk= github.com/flanksource/gomplate/v3 v3.24.2/go.mod h1:94BxYobZqouGdVezuz6LNto5C+yLMG0LnNnM9CUPyoo= diff --git a/hack/generate-schemas/go.mod b/hack/generate-schemas/go.mod index 0ec5dbea..06793246 100644 --- a/hack/generate-schemas/go.mod +++ b/hack/generate-schemas/go.mod @@ -22,7 +22,7 @@ require ( github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/distribution/reference v0.5.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/flanksource/duty v1.0.445 // indirect + github.com/flanksource/duty v1.0.447 // indirect github.com/flanksource/gomplate/v3 v3.24.2 // indirect github.com/flanksource/is-healthy v1.0.4 // indirect github.com/flanksource/kubectl-neat v1.0.4 // indirect diff --git a/hack/generate-schemas/go.sum b/hack/generate-schemas/go.sum index 22e077f7..0618ec6e 100644 --- a/hack/generate-schemas/go.sum +++ b/hack/generate-schemas/go.sum @@ -245,8 +245,8 @@ github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2 github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/flanksource/commons v1.22.1 h1:Ycg8r26bx537UTdAEFgngDW1r2j5bX6Lr3NGxLICpiw= github.com/flanksource/commons v1.22.1/go.mod h1:GD5+yGvmYFPIW3WMNN+y1JkeDMJY74e05pQAsRbrvwY= -github.com/flanksource/duty v1.0.445 h1:QsrQUsv971avvPtF9uLMeq/rvarGR475WWsbPzZcBSI= -github.com/flanksource/duty v1.0.445/go.mod h1:eF0Z6vZ2vSO1vy8HDYMc+OkhGWx4Pg5+P16gUuL8+oI= +github.com/flanksource/duty v1.0.447 h1:Dxt7ZVfhboS5jloyWLPt28/MpgrVNL5CfzyCA9s4ZPw= +github.com/flanksource/duty v1.0.447/go.mod h1:eF0Z6vZ2vSO1vy8HDYMc+OkhGWx4Pg5+P16gUuL8+oI= github.com/flanksource/gomplate/v3 v3.24.2 h1:WZSriw1MaBhzrDV1IOP9eNsupIPxIHy0yTaMOVhCvsk= github.com/flanksource/gomplate/v3 v3.24.2/go.mod h1:94BxYobZqouGdVezuz6LNto5C+yLMG0LnNnM9CUPyoo= github.com/flanksource/is-healthy v1.0.4 h1:r/dVsi7keR5NGLCTpgO/M6Hah2jRtYNfMh/XJNnxacc=