Skip to content

Releases: hairyhenderson/gomplate

v4.1.0

06 Jul 17:32
cc25840
Compare
Choose a tag to compare

4.1.0 (2024-07-06)

Features

  • strings: New functions TrimRight and TrimLeft (#2148) (bdf3a1e)

Bug Fixes

  • vault: Upgrade go-fsimpl for KVv2 vault bug, and add test coverage (#2157) (6ffd703)

Documentation

  • datasources: clarify state of Vault KV v2 support (#2154) (c9643ca)
  • fix: Fix broken links, add CI to check (#2156) (bdf4f8c)
  • fix: Update docs configs to work with the latest hugo theme version (#2155) (17eb360)

Dependencies

  • actions: Bump docker/setup-buildx-action from 3.3.0 to 3.4.0 (#2163) (129ff6b)
  • actions: Bump docker/setup-qemu-action from 3.0.0 to 3.1.0 (#2160) (16ebbbe)
  • go: Bump github.com/aws/aws-sdk-go from 1.54.10 to 1.54.11 (#2152) (e0a6e4f)
  • go: Bump github.com/aws/aws-sdk-go from 1.54.11 to 1.54.13 (#2158) (720c70c)
  • go: Bump github.com/aws/aws-sdk-go from 1.54.13 to 1.54.14 (#2159) (114c54d)
  • go: Bump github.com/aws/aws-sdk-go from 1.54.14 to 1.54.15 (#2165) (51947a7)
  • go: Bump github.com/hairyhenderson/go-fsimpl from 0.1.6 to 0.1.7 (#2167) (80b7c5a)
  • go: Bump golang.org/x/term from 0.21.0 to 0.22.0 (#2162) (59192ec)

v4.0.1

28 Jun 14:25
0738270
Compare
Choose a tag to compare

This release is mainly to fix #2121 - a bug preventing gomplate v4.0.0 from working on 32-bit systems.

4.0.1 (2024-06-28)

Bug Fixes

  • test: Fix strings.Repeat test that failed in the wrong way on 32bit (#2129) (6290186)

Documentation

  • chore: Uncomment 'released' tags for functions in v4.0.0 (#2125) (e3b86e8)

Dependencies

  • go: Bump cuelang.org/go from 0.9.1 to 0.9.2 (#2142) (720960e)
  • go: Bump github.com/aws/aws-sdk-go from 1.54.2 to 1.54.6 (699a2ed)
  • go: Bump github.com/aws/aws-sdk-go from 1.54.6 to 1.54.8 (#2139) (a3475c0)
  • go: Bump github.com/aws/aws-sdk-go from 1.54.8 to 1.54.9 (#2143) (715f2c2)
  • go: Bump github.com/aws/aws-sdk-go from 1.54.9 to 1.54.10 (#2145) (227b65d)
  • go: bump github.com/hack-pad/hackpadfs (#2127) (e6c032b)
  • go: Bump github.com/hack-pad/hackpadfs from 0.2.2 to 0.2.3 (#2131) (4805247)
  • go: Bump github.com/hack-pad/hackpadfs from 0.2.3 to 0.2.4 (#2137) (eddceaa)
  • go: Bump github.com/hairyhenderson/go-fsimpl from 0.1.4 to 0.1.5 (#2146) (7e425e1)
  • go: bump github.com/hairyhenderson/go-fsimpl to fix 32-bit panic (#2128) (5104b19)

v4.0.0

18 Jun 21:24
v4.0.0
fba3b4d
Compare
Choose a tag to compare

v4.0.0

🥳 It's finally here! Welcome to gomplate v4.0.0! This release is a major release, with breaking changes. Read on for more details...

Probably the most important feature that's evolved in gomplate over the years is its support for reading and parsing data from a variety of sources. Using URLs to specify where to find data has proven to be quite flexible, and has allowed for a lot of different data sources to be supported.

In early 2021, I took what I had learned from supporting all of these different data sources, and I created a new module called go-fsimpl, which provides a number of Go filesystem implementations that can be used with Go's filesystem interfaces.

My goal with go-fsimpl was always to use it in gomplate, and now that it's data source support has reached parity with gomplate, it's time to make the switch! As a result, and because go-fsimpl presents a much more consistent and unified approach to data sources, I've had to drop support for one data source, and in fixing some inconsistencies in how URLs have been handled by some of the data sources, I've had to make some breaking changes there as well.

⚠️ Please, if you're using gomplate in production, read these release notes carefully and in full, and review your usage of gomplate to make sure you can adapt to these changes.

Breaking changes

Dropped support for the BoltDB data source

Support for the boltdb URL scheme has been removed. The implementation was never very robust, and I'm not aware of anyone using it. It had some unique quirks that would have made it quite difficult to support in go-fsiml as-is, so I've decided to drop it.

No more slim binaries

The slim binaries were deprecated in v3.11, and will no longer be produced.

Stricter URL handling

Subpaths are now always relative URLs

When using the datasource function with a subpath (second argument), the subpath has previously been intepreted by some data sources as a simple addition to the URL, and by others as a relative URL to be interpreted relative to the data source's base URL (as specified by the --datasource flag).

Now, all data sources will interpret the subpath as a relative URL, and will resolve it relative to the data source's base URL. This means that, given a base URL of git+https://github.com/hairyhenderson/gomplate//random and a subpath of random.go, the resulting URL will be git+https://github.com/hairyhenderson/gomplate//random.go. To correct this, make sure that base URLs end with a trailing slash when the last component is a directory.

Also, if the subpath begins with a slash, it will be interpreted as an absolute path, and will replace the base URL's path. For example, given a base URL of git+file:///tmp/repos//myrepo/ and a subpath of /myfile.txt, the resulting URL will be git+file:///myfile.txt. To correct this, make sure that subpaths don't begin with a slash. Note that for the special // separator indicating the separation between a Git repository and the path within, a subpath should now begin with .// rather than //.

This affects at least the git and file data sources.

Directories in datasource URLs must end with a slash

Previously, some data sources would assume URLs that end without a trailing slash are directories, and relative lookups would be performed within that directory. This was inconsistent with how URLs are normally interpreted, and could lead to unexpected results.

Now, all data sources will always interpret URLs without a trailing slash as files, and relative lookups will be performed within the parent directory of the URL.

For example, given a base URL of vault:///secret and a subpath of foo, the resulting URL will be vault:///foo. To correct this, make sure that base URLs end with a trailing slash when the last component is a directory.

Consistent data values

The aws+smp data source previously returned the AWS output object, with both metadata and data. Users needed to reference the Value field to get the actual data. Now, the aws+smp data source will return the data directly.

The consul data source supports directory semantics, but previously returned all the data as a JSON array of key/value pair objects. Now, the consul data source will return directory listings like all other data sources, as a JSON array of strings (the names of the keys).

Vault app-id authentication support removed

Support for the Vault "app-id" authentication method has been removed. This method was deprecated in Vault 0.6.1, and removed in Vault 1.13. If you're still using this method, you must switch to a different authentication method. Consider the "approle" method as a similar replacement.

The suppressEmpty behaviour is now always enabled

In previous versions of gomplate, output that consist only of whitespace would by default still be written to files, with the suppressEmpty flag or GOMPLATE_SUPPRESS_EMPTY environment variable being required to suppress this behaviour.

Now, this behaviour is always enabled, and the suppressEmpty flag and GOMPLATE_SUPPRESS_EMPTY environment variable have been removed.

Log message formatting changes

A new logging framework is now in use (the standard library's log/slog package), and so error and debug (--verbose) messages will appear differently (different colours for the console format, and key/value pairs may are sorted differently).

Functions returning errors instead of quietly returning 0 on invalid input

Instead of quietly returning 0, a number of functions in the conv namespace will now return an error if the input is invalid.

This includes:

  • conv.ToInt64, conv.ToInt, conv.ToInt64s, conv.ToInts, conv.ToFloat64, conv.ToFloat64s, conv.ParseInt, conv.ParseFloat, conv.ParseUint, conv.Atoi

Because these functions are used by some other functions, this introduces stricter input validation for these functions:

  • coll.Flatten
  • crypto.PBKDF2, crypto.Bcrypt, crypto.RSAGenerateKey, crypto.EncryptAES, crypto.DecryptAES, crypto.DecryptAESBytes
  • math.Abs, math.Add, math.Mul, math.Sub, math.Div, math.Rem, math.Pow, math.Seq, math.Max, math.Min, math.Ceil, math.Floor, math.Round
  • net.CIDRHost, net.CIDRSubnets, net.CIDRSubnetSizes
  • random.ASCII, random.Alpha, random.AlphaNum, random.String, random.Number, random.Float
  • regexp.FindAll, regexp.Split
  • strings.Abbrev, strings.WordWrap
  • time.Nanosecond, time.Microsecond, time.Millisecond, time.Second, time.Minute, time.Hour

Functions in the regexp namespace now return errors instead of panicking

Previously, the regexp.Match and regexp.Replace functions would panic if the regular expression was invalid. Now, they will return an error instead.

Removed functions

The following functions have been removed:

  • conv.Dict, conv.Slice, conv.Has - These have been deprecated since v3.2.0 and have been replaced with coll.Dict, coll.Slice, and coll.Has.

Deprecations

See the deprecation policy.

  • A number of functions are deprecated, and will likely be removed in v5:
    • the slice alias for coll.Slice (use coll.Slice instead)
    • The net.Parse* functions which produced values from the inet.af/netaddr module have been deprecated and replaced with functions using the Go standard library's net/netip package:
  • The array form of configuring nested templates is deprecated, and a new map-based form is now available. This will be removed in a later v4 minor release (i.e. not in v4.0.0, but before v5).
  • Support for the AWS_META_ENDPOINT environment variable for overriding the IMDS endpoint in aws functions has been deprecated in favor of the AWS-native AWS_EC2_METADATA_SERVICE_ENDPOINT. This will be removed in a later v4 minor release (i.e. not in v4.0.0, but before v5).
  • A number of functions and types in the Go API are deprecated. Using a linter like staticcheck will help you find these in your code if you're using gomplate as a module. Follow the instructions in the deprecation comments to find out what to use instead.

Thanks

Plenty of people have contributed to gomplate by filing issues, suggesting new features, or submitting pull requests. I'd like to especially thank the following people for submitting pull requests in this release:

Read more

v4.0.0-pre-3

10 Jun 01:06
v4.0.0-pre-3
b9e6f0f
Compare
Choose a tag to compare
v4.0.0-pre-3 Pre-release
Pre-release

🥳 It's finally (almost) here! Welcome to gomplate v4.0.0-pre-3! This release is a (pre-release of a ) major release, with breaking changes. Read on for more details...

Probably the most important feature that's evolved in gomplate over the years is its support for reading and parsing data from a variety of sources. Using URLs to specify where to find data has proven to be quite flexible, and has allowed for a lot of different data sources to be supported.

In early 2021, I took what I had learned from supporting all of these different data sources, and I created a new module called go-fsimpl, which provides a number of Go filesystem implementations that can be used with Go's filesystem interfaces.

My goal with go-fsimpl was always to use it in gomplate, and now that it supports most of the data sources that gomplate supports, it's time to make the switch! As a result, and because go-fsimpl presents a much more consistent and unified approach to data sources, I've had to drop support for one data source, and in fixing some inconsistencies in how URLs have been handled by some of the data sources, I've had to make some breaking changes there as well.

Please, if you're using gomplate in production, please read these release notes carefully and in full, and review your usage of gomplate to make sure you can adapt to these changes.

Breaking changes

Dropped support for the BoltDB data source

Support for the boltdb URL scheme has been removed. The implementation was never very robust, and I'm not aware of anyone using it. It had some unique quirks that would have made it quite difficult to support in go-fsiml as-is, so I've decided to drop it.

No more slim binaries

The slim binaries were deprecated in v3.11, and will no longer be produced.

Stricter URL handling

Subpaths are now always relative URLs

When using the datasource function with a subpath (second argument), the subpath has previously been intepreted by some data sources as a simple addition to the URL, and by others as a relative URL to be interpreted relative to the data source's base URL (as specified by the --datasource flag).

Now, all data sources will interpret the subpath as a relative URL, and will resolve it relative to the data source's base URL. This means that, given a base URL of git+https://github.com/hairyhenderson/gomplate//random and a subpath of random.go, the resulting URL will be git+https://github.com/hairyhenderson/gomplate//random.go. To correct this, make sure that base URLs end with a trailing slash when the last component is a directory.

Also, if the subpath begins with a slash, it will be interpreted as an absolute path, and will replace the base URL's path. For example, given a base URL of git+file:///tmp/repos//myrepo/ and a subpath of /myfile.txt, the resulting URL will be git+file:///myfile.txt. To correct this, make sure that subpaths don't begin with a slash. Note that for the special // separator indicating the separation between a Git repository and the path within, a subpath should now begin with .// rather than //.

This affects at least the git and file data sources.

Directories in datasource URLs must end with a slash

Previously, some data sources would assume URLs that end without a trailing slash are directories, and relative lookups would be performed within that directory. This was inconsistent with how URLs are normally interpreted, and could lead to unexpected results.

Now, all data sources will always interpret URLs without a trailing slash as files, and relative lookups will be performed within the parent directory of the URL.

For example, given a base URL of vault:///secret and a subpath of foo, the resulting URL will be vault:///foo. To correct this, make sure that base URLs end with a trailing slash when the last component is a directory.

Consistent data values

The aws+smp data source previously returned the AWS output object, with both metadata and data. Users needed to reference the Value field to get the actual data. Now, the aws+smp data source will return the data directly.

The consul data source supports directory semantics, but previously returned all the data as a JSON array of key/value pair objects. Now, the consul data source will return directory listings like all other data sources, as a JSON array of strings (the names of the keys).

Vault app-id auth support removed

Support for the Vault app-id auth method has been removed. This method was deprecated in Vault 0.6.1, and removed in Vault 1.13. If you're still using this method, you must switch to a different auth method.

The suppressEmpty behaviour is now always enabled

In previous versions of gomplate, output that consist only of whitespace would by default still be written to files, with the suppressEmpty flag or GOMPLATE_SUPPRESS_EMPTY environment variable being required to suppress this behaviour. Now, this behaviour is always enabled, and the suppressEmpty flag and GOMPLATE_SUPPRESS_EMPTY environment variable have been removed.

Log message formatting changes

A new logging framework is now in use (the standard library's log/slog package), and so error and debug (--verbose) messages will appear differently (different colours for the console format, and key/value pairs may are sorted differently).

Removed functions

The following functions have been removed:

  • conv.Dict, conv.Slice, conv.Has - These have been deprecated since v3.2.0 and have been replaced with coll.Dict, coll.Slice, and coll.Has.

Deprecations

See the deprecation policy.

  • A number of functions are deprecated, and will likely be removed in v5:
    • the slice alias for coll.Slice (use coll.Slice instead)
    • The net.Parse* functions which produced values from the inet.af/netaddr module have been deprecated and replaced with functions using the Go standard library's net/netip package:
  • The array form of configuring nested templates is deprecated, and a new map-based form is now available. This will be removed in a later v4 minor release (i.e. not in v4.0.0, but before v5).
  • Support for the AWS_META_ENDPOINT environment variable for overriding the IMDS endpoint in aws functions has been deprecated in favor of the AWS-native AWS_EC2_METADATA_SERVICE_ENDPOINT. This will be removed in a later v4 minor release (i.e. not in v4.0.0, but before v5).
  • A number of functions and types in the Go API are deprecated. Using a linter like staticcheck will help you find these in your code if you're using gomplate as a module. Follow the instructions in the deprecation comments to find out what to use instead.

Thanks

Plenty of people have contributed to gomplate by filing issues, suggesting new features, or submitting pull requests. I'd like to especially thank the following people for submitting pull requests in this release:


Be sure to also check out the multi-platform Docker images available at hairyhenderson/gomplate.

If you've gained value out of gomplate and want to find a way to encourage development, please consider sponsoring gomplate!


v4.0.0-pre-3 (2024-06-09)

Full Changelog (since v3.11)
Changes since v4.0.0-pre-2

Release Notes

New features and changes

  • #1336 Use go-fsimpl to read from datasources
  • #1949 Add missing-key flag to manage behavior in case of non-existing key - thanks to @xxxcoltxxx!
  • #1922 Flip to ltsc2022 image for windows variant
  • #1781 Support for CUE
  • #1837 Add support for Linux s390x - thanks to @iblancasa!
  • #1700 Add te...
Read more

v3.11.8

02 Jun 15:45
v3.11.8
f525a6e
Compare
Choose a tag to compare

What's Changed

Full Changelog: v3.11.7...v3.11.8

pre-release v4.0.0-pre-2

25 Jan 01:00
v4.0.0-pre-2
d75551b
Compare
Choose a tag to compare
Pre-release

This is a pre-release for v4.0.0 intended for testing. More changes will come before release!

(preliminary release notes follow - these will be updated for v4.0.0)

🥳 It's finally (almost) here! Welcome to gomplate v4.0.0-pre-2! This release is a (pre-release of a) major
release, with breaking changes.
Read on for more details...

Probably the most important feature that's evolved in gomplate over the years is
its support for reading and parsing data from a variety of sources. Using URLs
to specify where to find data has proven to be quite flexible, and has allowed
for a lot of different data sources to be supported.

In early 2021, I took what I had learned from supporting all of these different
data sources, and I created a new module called
go-fsimpl, which provides a
number of Go filesystem implementations that can be used with Go's filesystem
interfaces.

My goal with go-fsimpl was always to use it in gomplate, and now that it
supports most of the data sources that gomplate supports, it's time to make the
switch! As a result, and because go-fsimpl presents a much more consistent
and unified approach to data sources, I've had to drop support for one data
source, and in fixing some inconsistencies in how URLs have been handled by some
of the data sources, I've had to make some breaking changes there as well.

Please, if you're using gomplate in production, please read these release
notes carefully and in full, and review your usage of gomplate to make sure you
can adapt to these changes.

Breaking changes

Dropped support for the BoltDB data source

Support for the boltdb URL scheme has been removed. The implementation was
never very robust, and I'm not aware of anyone using it. It had some unique
quirks that would have made it quite difficult to support in go-fsiml as-is,
so I've decided to drop it.

No more slim binaries

The slim binaries were deprecated in v3.11, and will no longer be produced.

Stricter URL handling

Subpaths are now always relative URLs

When using the datasource function with a subpath (second argument), the
subpath has previously been intepreted by some data sources as a simple addition
to the URL, and by others as a relative URL to be interpreted relative to the
data source's base URL (as specified by the --datasource flag).

Now, all data sources will interpret the subpath as a relative URL, and will
resolve it relative to the data source's base URL. This means that, given a base
URL of git+https://github.com/hairyhenderson/gomplate//random and a subpath of
random.go, the resulting URL will be
git+https://github.com/hairyhenderson/gomplate//random.go. To correct this,
make sure that base URLs end with a trailing slash when the last component is a
directory.

Also, if the subpath begins with a slash, it will be interpreted as an absolute
path, and will replace the base URL's path. For example, given a base URL of
git+file:///tmp/repos//myrepo/ and a subpath of /myfile.txt, the resulting
URL will be git+file:///myfile.txt. To correct this, make sure that subpaths
don't begin with a slash. Note that for the special // separator indicating
the separation between a Git repository and the path within, a subpath should
now begin with .// rather than //.

This affects at least the git and file data sources.

Directories in datasource URLs must end with a slash

Previously, some data sources would assume URLs that end without a trailing
slash are directories, and relative lookups would be performed within that
directory. This was inconsistent with how URLs are normally interpreted, and
could lead to unexpected results.

Now, all data sources will always interpret URLs without a trailing slash as
files, and relative lookups will be performed within the parent directory of the
URL.

For example, given a base URL of vault:///secret and a subpath of foo, the
resulting URL will be vault:///foo. To correct this, make sure that base URLs
end with a trailing slash when the last component is a directory.

Consistent data values

The aws+smp data source previously returned the AWS output object, with
both metadata and data. Users needed to reference the Value field to get the
actual data. Now, the aws+smp data source will return the data directly.

The consul data source supports directory semantics, but previously returned
all the data as a JSON array of key/value pair objects. Now, the consul data
source will return directory listings like all other data sources, as a JSON
array of strings (the names of the keys).

Vault app-id auth support removed

Support for the Vault app-id auth method has been removed. This method was
deprecated in Vault 0.6.1, and removed in Vault 1.13. If you're still using this
method, you must switch to a different auth method.

Removed functions

The following functions have been removed:

  • (TODO)

Deprecations

See the deprecation policy.

  • A number of functions are deprecated, and will likely be removed in v5:
    • the slice alias for coll.Slice (use coll.Slice instead)
    • The net.Parse* functions which produced values from the inet.af/netaddr
      module have been deprecated and replaced with functions using the Go standard
      library's net/netip package:
  • The array form of configuring nested templates is deprecated, and a new map-
    based form is now available. This will be removed in a later v4 minor release
    (i.e. not in v4.0.0, but before v5).
  • Support for the AWS_META_ENDPOINT environment variable for overriding the
    IMDS endpoint in aws functions has been deprecated in favor of the
    AWS-native AWS_EC2_METADATA_SERVICE_ENDPOINT. This will be removed in a
    later v4 minor release (i.e. not in v4.0.0, but before v5).

Thanks

Plenty of people have contributed to gomplate by filing issues, suggesting new
features, or submitting pull requests. I'd like to especially thank the
following people for submitting pull requests in this release:


Be sure to also check out the multi-platform Docker images available at hairyhenderson/gomplate.

If you've gained value out of gomplate and want to find a way to encourage development, please consider sponsoring gomplate!


v4.0.0-pre-2 (2024-01-23)

Full Changelog (since v3.11)
Changes since v4.0.0-pre-1

Release Notes

New features and changes

  • #1336 Use go-fsimpl to read from datasources
  • #1949 Add missing-key flag to manage behavior in case of non-existing key - thanks to @xxxcoltxxx!
  • #1922 Flip to ltsc2022 image for windows variant
  • #1781 Support for CUE
  • #1837 Add support for Linux s390x - thanks to @iblancasa!
  • #1700 Add tea.xyz package manager - thanks to @adriens!
  • #1698 New plugin args option (implements #1552)
  • #1668 Remove support for obsolete Vault app-id auth
  • #1440 Added ppc64le support - thanks to @mayurwaghmode!
  • #1615 Deprecate netaddr-based funcs
  • #1538 Deprecate non-pipelineable strings aliases
  • #1433 Removed slim (UPX-compressed) binary/image support
  • #1397 Remove BoltDB support

New functions

Read more

v3.11.7

23 Jan 01:16
v3.11.7
6e709cf
Compare
Choose a tag to compare

What's Changed

Full Changelog: v3.11.6...v3.11.7

v3.11.6

17 Nov 16:41
v3.11.6
ddda949
Compare
Choose a tag to compare

What's Changed

Full Changelog: v3.11.5...v3.11.6

v3.11.5

18 Apr 01:35
v3.11.5
ea986e7
Compare
Choose a tag to compare

What's Changed

Full Changelog: v3.11.4...v3.11.5

v3.11.4

24 Feb 22:18
v3.11.4
Compare
Choose a tag to compare

What's Changed

Full Changelog: v3.11.3...v3.11.4