ReloadConfig reloads the instance's configuration.
(ctx context.Context, instanceID string)
| 261 | |
| 262 | // ReloadConfig reloads the instance's configuration. |
| 263 | func (r *Runtime) ReloadConfig(ctx context.Context, instanceID string) (ReloadConfigSummary, error) { |
| 264 | if r.configReloader != nil { |
| 265 | varsCount, modified, err := r.configReloader.reloadConfig(ctx, instanceID) |
| 266 | if err != nil { |
| 267 | return ReloadConfigSummary{}, err |
| 268 | } |
| 269 | return ReloadConfigSummary{VarsCount: varsCount, VarsModified: modified}, nil |
| 270 | } |
| 271 | // For runtimes without a config reloader (rill developer), pull env from admin service and merge with local .env files |
| 272 | count, modified, err := r.pullEnv(ctx, instanceID) |
| 273 | if err != nil { |
| 274 | return ReloadConfigSummary{}, err |
| 275 | } |
| 276 | return ReloadConfigSummary{VarsCount: count, VarsModified: modified}, nil |
| 277 | } |
| 278 | |
| 279 | func (r *Runtime) pullEnv(ctx context.Context, instanceID string) (int, bool, error) { |
| 280 | inst, err := r.Instance(ctx, instanceID) |
nothing calls this directly
no test coverage detected