From 8767e64ff07c0ef9a40157380cd5ed58b1a6cf60 Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Mon, 28 Mar 2022 18:48:43 -0400 Subject: Log warning message when a deprecated function or datasource is used Signed-off-by: Dave Henderson --- data/datasource.go | 1 + data/datasource_boltdb.go | 3 +++ 2 files changed, 4 insertions(+) (limited to 'data') diff --git a/data/datasource.go b/data/datasource.go index 79c29e5f..539ba122 100644 --- a/data/datasource.go +++ b/data/datasource.go @@ -42,6 +42,7 @@ func (d *Data) registerReaders() { d.sourceReaders["aws+smp"] = readAWSSMP d.sourceReaders["aws+sm"] = readAWSSecretsManager + // Deprecated: don't use d.sourceReaders["boltdb"] = readBoltDB d.sourceReaders["consul"] = readConsul d.sourceReaders["consul+http"] = readConsul diff --git a/data/datasource_boltdb.go b/data/datasource_boltdb.go index f7198c74..63be1e64 100644 --- a/data/datasource_boltdb.go +++ b/data/datasource_boltdb.go @@ -3,11 +3,14 @@ package data import ( "context" + "github.com/hairyhenderson/gomplate/v3/internal/deprecated" "github.com/hairyhenderson/gomplate/v3/libkv" "github.com/pkg/errors" ) +// Deprecated: don't use func readBoltDB(ctx context.Context, source *Source, args ...string) (data []byte, err error) { + deprecated.WarnDeprecated(ctx, "boltdb support is deprecated and will be removed in a future major version of gomplate") if source.kv == nil { source.kv, err = libkv.NewBoltDB(source.URL) if err != nil { -- cgit v1.2.3