From a4a6e614dc4d37a6fdbd60f56d69b2ecf20066fc Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Wed, 23 Jul 2025 15:22:15 +0300 Subject: [PATCH] update k8s config --- docs/config.md | 6 ++++-- internal/launchr/types.go | 1 + pkg/action/manager.go | 2 +- plugins/actionnaming/plugin.go | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/config.md b/docs/config.md index cd32705..60bc797 100644 --- a/docs/config.md +++ b/docs/config.md @@ -17,8 +17,10 @@ To change the default container runtime: ```yaml # ... -container: - runtime: kubernetes +launchrctl: + runtime: + container: + default_runtime: kubernetes # ... ``` diff --git a/internal/launchr/types.go b/internal/launchr/types.go index 446703f..b7077e7 100644 --- a/internal/launchr/types.go +++ b/internal/launchr/types.go @@ -29,6 +29,7 @@ const ( // PkgPath is a main module path. const PkgPath = "github.com/launchrctl/launchr" +const ConfigKey = "launchrctl" func init() { // Set parent pid for subprocesses. diff --git a/pkg/action/manager.go b/pkg/action/manager.go index 74d04cf..7102dab 100644 --- a/pkg/action/manager.go +++ b/pkg/action/manager.go @@ -539,7 +539,7 @@ func WithDefaultRuntime(cfg launchr.Config) DecorateWithFn { DefaultRuntime string `yaml:"default_runtime"` } var rtConfig configContainer - err := cfg.Get("runtime.container", &rtConfig) + err := cfg.Get(fmt.Sprintf("%s.runtime.container", launchr.ConfigKey), &rtConfig) if err != nil { launchr.Term().Warning().Printfln("configuration file field %q is malformed", "container") } diff --git a/plugins/actionnaming/plugin.go b/plugins/actionnaming/plugin.go index ff2b3e8..598a5ef 100644 --- a/plugins/actionnaming/plugin.go +++ b/plugins/actionnaming/plugin.go @@ -40,7 +40,7 @@ func (p Plugin) OnAppInit(app launchr.App) error { // Load naming configuration. var launchrConfig launchrCfg // @todo refactor yaml property position. - err := cfg.Get("launchrctl", &launchrConfig) + err := cfg.Get(launchr.ConfigKey, &launchrConfig) if err != nil { return err }