Skip to content

Commit

Permalink
Re-add kinds config field to tbot with a deprecation warning (#12933)
Browse files Browse the repository at this point in the history
* 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 <zmb3@users.noreply.github.com>

* Use standardized deprecation comment formatting

Co-authored-by: Zac Bergquist <zmb3@users.noreply.github.com>
  • Loading branch information
timothyb89 and zmb3 authored May 27, 2022
1 parent e8cfe5d commit 17dbc2d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tool/tbot/config/config_destination.go
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 17dbc2d

Please sign in to comment.