From 17dbc2d287720aac9a050223966499572712cf1c Mon Sep 17 00:00:00 2001 From: Tim Buckley Date: Fri, 27 May 2022 15:26:19 -0600 Subject: [PATCH] Re-add `kinds` config field to tbot with a deprecation warning (#12933) * Re-add `kinds` config field with a deprecation warning This re-adds the `kinds` config field with a deprecation warning. We removed the field in #11596 but due to strict YAML parsing this causes existing otherwise compatible configs to error out. * Update tool/tbot/config/config_destination.go Co-authored-by: Zac Bergquist * Use standardized deprecation comment formatting Co-authored-by: Zac Bergquist --- tool/tbot/config/config_destination.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tool/tbot/config/config_destination.go b/tool/tbot/config/config_destination.go index d7fdb75b8cf65..de17e350a47d2 100644 --- a/tool/tbot/config/config_destination.go +++ b/tool/tbot/config/config_destination.go @@ -51,6 +51,11 @@ type DestinationConfig struct { Roles []string `yaml:"roles,omitempty"` Configs []TemplateConfig `yaml:"configs,omitempty"` + // Kinds is a deprecated and unused field that remains for compatibility + // reasons. + // DELETE IN 11.0.0: Kinds should be removed after a grace period. + Kinds []string `yaml:"kinds,omitempty"` + Database *DatabaseConfig `yaml:"database,omitempty"` } @@ -107,6 +112,12 @@ func (dc *DestinationConfig) CheckAndSetDefaults() error { } } + if len(dc.Kinds) > 0 { + log.Warnf("The `kinds` configuration field has been deprecated and " + + "will be removed in a future release. It is now a no-op and can " + + "safely be removed from the configuration file.") + } + return nil }