gomplate

A flexible commandline tool for template rendering. Supports lots of local and remote datasources.

MIT License

Stars
2.7K
Committers
61

Bot releases are visible (Hide)

gomplate - v4.1.0 Latest Release

Published by hairyhenderson-bot[bot] 3 months ago

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)
gomplate - v4.0.1

Published by hairyhenderson-bot[bot] 4 months ago

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)
gomplate - v4.0.0

Published by hairyhenderson 4 months ago

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:


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 (2024-06-18)

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

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
  • #1977 Move funcs package to internal/funcs
  • #1963 Add --exclude-processing option
  • #2068 Switch from zerolog to slog
  • #1981 Always suppress empty output
  • #2069 coll.Pick now supports slice of strings as input
  • #2083 Replaced the data.Data type with a datasource registry
  • #2089 Update strings.Indent to error on bad input
  • #2095 Removed deprecated RunTemplates function and old Config type
  • #2094 Exported new Config type and updated Run function and other API functions
  • #2105 Return errors instead of panicking on regexp functions
  • #2104 Return errors instead of 0 on invalid inputs to conv.* functions
  • #2115 Add ability to override type query parameter name with GOMPLATE_TYPE_PARAM environment variable

New functions

  • #1900 Add support for Ed25519 - thanks to @horvski!
  • #1829 Add semver functions - thanks to @wuhuizuo!
  • #1589 New coll.Index function
  • #1585 Add coll.JQ using gojq library - thanks to @ahochsteger!
  • #1587 Add strings.SkipLines function
  • #1464 Add coll.GoSlice and deprecate slice alias
  • #2118 New coll.Set and coll.Unset functions

Bug fixes

  • #1918 Clarify config parsing errors
  • #1915 Fix the wdFS behaviour due to Go 1.21.4's changes to IsAbs
  • #1916 Fix git+file bug with non-current windows drives
  • #1851 Remove defers from main() to stop suppressing panics
  • #1835 Make strings.Title not lowercase acronyms - thanks to @zregvart!
  • #1643 Fix file descriptor leak
  • #1480 Fix nested template panic - thanks to @mihaitodor!

Documentation fixes/updates

  • #1868 List release versions for each function, add unreleased label
  • #1873 Explain that index supports nested keys - thanks to @isavcic!
  • #1885 docs: format user template in hello example - thanks to @tenstad!
  • #1866 document the workaround for Vault KV secrets engine - version 2 - thanks to @AndrewSav!
  • #1745 Fix output-map usage docs
  • #1729 Migrate docs site to new theme
  • #1714 Clarified documentation of data.CSVBy* functions - thanks to @giorgiga!
  • #1588 Clarify documentation to highlight the differences between index and .
  • #1622 Fix minor typo: Pic -> Pick - thanks to @hartzell!
  • #1518 Fix incorrect coll.GoSlice example (fixes #1517)
  • #1506 Clarify git URL docs - stop implying subpaths starting with // are a good idea

Misc. internal contributions

  • #1940 test: use t.Setenv to set env vars in tests - thanks to @Juneezee!
  • #1828 build: bump github.com/Masterminds/semver to github.com/Masterminds/semver/v3 - thanks to @wuhuizuo!
  • #1796 Bump go4.org/unsafe/assume-no-moving-gc for compatibility with Go 1.21 - thanks to @stefanb!
  • #1739 Update Makefile to use CGO_ENABLED environment variable - thanks to @sukhil-suresh!
gomplate - v4.0.0-pre-3

Published by hairyhenderson 4 months ago

πŸ₯³ 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 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
  • #1977 Move funcs package to internal/funcs
  • #1963 Add --exclude-processing option
  • #2068 Switch from zerolog to slog
  • #1981 Always suppress empty output
  • #2069 coll.Pick now supports slice of strings as input
  • #2083 Replaced the data.Data type with a datasource registry
  • #2089 Update strings.Indent to error on bad input
  • #2095 Removed deprecated RunTemplates function and old Config type
  • #2094 Exported new Config type and updated Run function and other API functions

New functions

  • #1900 Add support for Ed25519 - thanks to @horvski!
  • #1829 feat(funcs): add semver functions - thanks to @wuhuizuo!
  • #1589 New coll.Index function
  • #1585 Add coll.JQ using gojq library - thanks to @ahochsteger!
  • #1587 Add strings.SkipLines function
  • #1464 Add coll.GoSlice and deprecate slice alias

Bug fixes

  • #1918 Clarify config parsing errors
  • #1915 Fix the wdFS behaviour due to Go 1.21.4's changes to IsAbs
  • #1916 Fix git+file bug with non-current windows drives
  • #1851 Remove defers from main() to stop suppressing panics
  • #1835 Make strings.Title not lowercase acronyms - thanks to @zregvart!
  • #1643 Fix file descriptor leak
  • #1480 Fix nested template panic - thanks to @mihaitodor!

Documentation fixes/updates

  • #1868 List release versions for each function, add unreleased label
  • #1873 Explain that index supports nested keys - thanks to @isavcic!
  • #1885 docs: format user template in hello example - thanks to @tenstad!
  • #1866 document the workaround for Vault KV secrets engine - version 2 - thanks to @AndrewSav!
  • #1745 Fix output-map usage docs
  • #1729 Migrate docs site to new theme
  • #1714 Clarified documentation of data.CSVBy* functions - thanks to @giorgiga!
  • #1588 Clarify documentation to highlight the differences between index and .
  • #1622 Fix minor typo: Pic -> Pick - thanks to @hartzell!
  • #1518 Fix incorrect coll.GoSlice example (fixes #1517)
  • #1506 Clarify git URL docs - stop implying subpaths starting with '//' are a good idea

Misc. internal contributions

  • #1940 test: use t.Setenv to set env vars in tests - thanks to @Juneezee!
  • #1828 build: bump github.com/Masterminds/semver to github.com/Masterminds/semver/v3 - thanks to @wuhuizuo!
  • #1796 Bump go4.org/unsafe/assume-no-moving-gc for compatibility with Go 1.21 - thanks to @stefanb!
  • #1739 Update Makefile to use CGO_ENABLED environment variable - thanks to @sukhil-suresh!
gomplate - v3.11.8

Published by hairyhenderson 5 months ago

What's Changed

Full Changelog: https://github.com/hairyhenderson/gomplate/compare/v3.11.7...v3.11.8

gomplate - pre-release v4.0.0-pre-2

Published by hairyhenderson 9 months ago

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

  • #1900 Add support for Ed25519 - thanks to @horvski!
  • #1829 feat(funcs): add semver functions - thanks to @wuhuizuo!
  • #1589 New coll.Index function
  • #1585 Add coll.JQ using gojq library - thanks to @ahochsteger!
  • #1587 Add strings.SkipLines function
  • #1464 Add coll.GoSlice and deprecate slice alias

Bug fixes

Documentation fixes/updates

  • #1868 List release versions for each function, add unreleased label
  • #1873 Explain that index supports nested keys - thanks to @isavcic!
  • #1885 docs: format user template in hello example - thanks to @tenstad!
  • #1866 document the workaround for Vault KV secrets engine - version 2 - thanks to @AndrewSav!
  • #1745 Fix output-map usage docs
  • #1729 Migrate docs site to new theme
  • #1714 Clarified documentation of data.CSVBy* functions - thanks to @giorgiga!
  • #1588 Clarify documentation to highlight the differences between index and .
  • #1622 Fix minor typo: Pic -> Pick - thanks to @hartzell!
  • #1518 Fix incorrect coll.GoSlice example (fixes #1517)
  • #1506 Clarify git URL docs - stop implying subpaths starting with '//' are a good idea

Misc. internal contributions

  • #1940 test: use t.Setenv to set env vars in tests - thanks to @Juneezee!
  • #1828 build: bump github.com/Masterminds/semver to github.com/Masterminds/semver/v3 - thanks to @wuhuizuo!
  • #1796 Bump go4.org/unsafe/assume-no-moving-gc for compatibility with Go 1.21 - thanks to @stefanb!
  • #1739 Update Makefile to use CGO_ENABLED environment variable - thanks to @sukhil-suresh!
gomplate - v3.11.7

Published by hairyhenderson 9 months ago

What's Changed

Full Changelog: https://github.com/hairyhenderson/gomplate/compare/v3.11.6...v3.11.7

gomplate - v3.11.6

Published by hairyhenderson 11 months ago

What's Changed

Full Changelog: https://github.com/hairyhenderson/gomplate/compare/v3.11.5...v3.11.6

gomplate - v3.11.5

Published by hairyhenderson over 1 year ago

What's Changed

Full Changelog: https://github.com/hairyhenderson/gomplate/compare/v3.11.4...v3.11.5

gomplate - v3.11.4

Published by hairyhenderson over 1 year ago

What's Changed

Full Changelog: https://github.com/hairyhenderson/gomplate/compare/v3.11.3...v3.11.4

gomplate - v3.11.3

Published by hairyhenderson about 2 years ago

This is a very minor patch release to update a dependency that's causing gomplate to trigger vulnerability scanners for CVE-2022-27664.

To the best of my understanding gomplate is not vulnerable, as it doesn't expose any HTTP servers - this patch release is purely to help vulnerability scans pass!

What's Changed

Full Changelog: https://github.com/hairyhenderson/gomplate/compare/v3.11.2...v3.11.3

gomplate - v3.11.2

Published by hairyhenderson about 2 years ago

Another patch release to allow gomplate to be compiled with Go 1.19.

What's Changed

Full Changelog: https://github.com/hairyhenderson/gomplate/compare/v3.11.1...v3.11.2

gomplate - v3.11.1

Published by hairyhenderson over 2 years ago

Just a simple patch release to fix a bug that prevented the go install installation method.

What's Changed

Full Changelog: https://github.com/hairyhenderson/gomplate/compare/v3.11.0...v3.11.1

gomplate - v3.11.0

Published by hairyhenderson over 2 years ago

πŸ‘‹ Welcome to another gomplate release! Once more, a number of bug fixes and new
features. Thanks to the community, gomplate is now available via
MacPorts as well!

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:

Deprecations

I'm starting to work on gomplate v4, the next major release (with breaking
changes). In preparation for this, I'm listing some features as deprecated (see
the deprecation policy). Note that some of these may have been
deprecated for a while, but I'd like to call them out explicitly here.

  • The BoltDB
    datasource is now deprecated (see this discussion),
    and will be removed in v4.0.0.
  • The slim binaries are deprecated, and will no longer be produced starting
    with v4.0.0.
  • A number of functions are deprecated, though not all will be removed in v4:
  • 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).

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!

v3.11.0 (2022-06-12)

Full Changelog

Release Notes

New features and changes

  • #1422 New experimental gomplate.Renderer API is available for rendering templates programmatically. This should be of interest for developers wishing to use gomplate as a library. See the Go docs for examples.
  • #1410 Nested templates can now be referenced by URL and not just by path.
    • Notes:
      • Currently, only the file: URL scheme is supported. The full set of datasource URL schemes will be supported in a future release.
      • This also introduces a new format for the templates config option, and deprecates the previous format. See the docs for templates for more information.
  • #1402 Support for AWS IMDSv2 (EC2 instance metadata) is now available - thanks to @surki for the contribution!
  • #1358 Adding warning messages when using deprecated functions and datasources.
  • #1335 Now built with Go 1.18, which adds two new functions: break, and continue.
  • #1317 Plugins now support piping input arguments to the plugin's stdin, rather than a commandline argument. This can be configured in the config file (see the docs for details).
  • #1307 Missing directories are now automatically created for output files

New functions

Bug fixes

  • #1349 Fix bug in JSON and YAML functions where escaped forward slashes (\/) were not being correctly interpreted
  • #1350 Fix config merging when context/datasources are provided on the command line but not in the config file - thanks to @paddycarey for the contribution!
  • #1334 Fix file directory reading (fixes #1333)
  • #1310 Fix strings.Title to handle unicode punctuation (moves to alternate implementation after Go 1.18 deprecated the standard library function)
  • #1308 Fix bug where strings.Indent would not work correctly when a new-line character is used (now disallowed)
  • #1296 The aws+sm datasource will now correctly read a secret written as binary (SecretBinary) rather than a string (SecretString)

Documentation fixes/updates

  • #1338 Clarify that inputDir is read recursively
  • #1313 Add MacPorts installation instructions - thanks to @herbygillot for the contribution!
  • #1312 Improved plugin documentation
  • #1309 Updated install docs to remove mention of the deprecated slim binary, and update the Go install instructions for recent Go versions
  • #1301 conv.URL: Add example of how to redact the password
  • #1300 time.Now: Add example of how to use Time.IsDST
  • #1279 strings.Split: More examples to clarify how to use strings.Split - thanks to @karlschriek for the contribution!
gomplate - v3.10.0

Published by hairyhenderson about 3 years ago

πŸ₯³ It's high time for another gomplate release! This release contains quite a few
bug fixes and improvements.

Some packaging updates:

  • There is now a binary built for macOS on the Apple Silicon (M1/etc - darwin-arm64) platform!
  • For Windows users, there is now a Chocolatey package available!
  • Docker images are now also pushed to GitHub Container Registry

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!

v3.10.0 (2021-09-24)

Full Changelog

Release Notes

New features and changes

New functions

Bug fixes

  • #1217 Support git repos with default branches other than master (fixes #1049)
  • #1210 Fix CONSUL_HTTP_ADDR parsing (fixes #1209)
  • #1199 Fix a few filehandle leaks (fixes #995)
  • #1128 Fix data race in random functions
  • #1127 Fix data race when gomplate is used programatically - fixed by removing use of globals in func namespaces (fixes #1126)
  • #1104 Stop emitting ANSI colour codes on Windows in unsupported terminals (partial fix for #1095)
  • #1082 Fix error when using --input-dir=. (found in #1081)
  • #1063 Fix difficulty in using gomplate programatically - bumped k8s.io/client-go to valid semver (fixes #1061)

Documentation fixes/updates

  • #1136 Fix files.IsDir typo in doc example (fixes #1133)
  • #1120 Add chocolatey package badges (thanks to @adriens!)
  • #1121 Explain how to install gomplate on Windows (thanks to @adriens!)
gomplate - v3.9.0

Published by hairyhenderson over 3 years ago

This is largely a bug-fix and stability release, but also contains some fairly
major internal refactoring, specifically to better support some future changes
that will make gomplate easier to use as a library!

Be sure to 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!

v3.9.0 (2021-01-24)

Full Changelog

Release Notes

New features and changes

Bug fixes

  • #1051 Fixing potential data race in signal handling code (possible when gomplate is used as a library)
  • #1027 & #1043 Fix ignored left/right delim env vars (fixes #1018)
  • #1029 & #1041 Only extra print newline with console output (fixes #996)
  • #956 Properly support Windows file modes (fixes #948)

Documentation fixes/updates

  • #981 Fixing docker image tag reference (fixes #996)
gomplate - v3.8.0

Published by hairyhenderson about 4 years ago

It's time for another gomplate release, and this time we have a good number of bug fixes, new functions, and updated dependencies.

Thanks to @surki and @jen20 for their contributions to this release!

Of particular note is the new experimental mode which you can use to try out some new functionality that isn't ready to be "locked in" just yet.

In particular, there are now some new RSA Encryption/Decryption functions, including crypto.RSAGenerateKey, which gives you a way to quickly generate an RSA encryption key pair! The reason these are experimental is because I'm not sure about the UX yet, and the function names may change in a future release.

Be sure to 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 me!

v3.8.0 (2020-08-29)

Full Changelog

Release Notes

New features and changes

  • #919 New experimental mode!
    • Some functions and features will be provided for early feedback behind the experimental configuration option. These features may change before being permanently enabled, and feedback is encouraged from early adopters!
  • #926 Fall back to JSON/YAML arrays when parsing datasources instead of refusing to parse (implements #924)
  • #925 Gomplate is now built with Go 1.15

New functions

Bug fixes

  • #874 Allow referencing aws+sm and aws+smp keys that don't start with / (fixes #868)
  • #875 Reverted to UPX v3.94 for compressing the slim variant of gomplate, to avoid some bugs caused by a newer version (fixes #861)
  • #934 Only open input/output files when necessary (fixes #928)
  • #935 Fixing "wrong type for value" error when parsing YAML documents containing anchors (fixes #909)

Documentation fixes/updates

gomplate - v3.7.0

Published by hairyhenderson over 4 years ago

It's high time for another gomplate release! πŸŽ‰

The main feature this time around is new support for configuration files! Now you can store config files alongside templates and replace complicated command lines with a single call to gomplate!

We now also have multi-platform Docker images available at hairyhenderson/gomplate,
including support for ARM platforms and Windows.

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

v3.7.0 (2020-05-21)

Full Changelog

Release Notes

New features and changes

  • #692 Config file support - see the docs for details
  • #743 Recognizing non-standard application/x-yaml and application/text mime types used in GCP
  • #791 (internal) Adding context.Context support and a logger
  • #805 Support more data types as input to data.ToCSV
  • #811 Produce multi-platform Docker images (adds support for Linux on ARMv6, ARMv7, and ARM64, and for Windows on AMD64)
  • #840 Defer writing until output differs, so that files are left unmodified when the output is the same
  • #842 Add directory datasource support to aws+smp datasources

New functions

Bug fixes

  • #819 Fix broken file datasource URL parsing (query string was ignored) (fixes #809)
  • #833 Fix AWS Session unknown region bug (fixes #795)
  • #841 Apply --chmod before opening output file

Documentation fixes/updates

  • #720 Documenting the initial context ($) variable
  • #742 Added missing documentation for gs datasources (fixes #737)
  • #830 Add references to the built-in Go text/template actions
  • #845 Add documentation about variable scopes
gomplate - v3.6.0

Published by hairyhenderson almost 5 years ago

A big release after a bit of a hiatus. πŸ˜…

Big new features include plugin support and 3 new datasources (AWS S3, Google Cloud Storage, and Git!).

Also for those who are using the hairyhenderson/gomplate
Docker images, there are some new tags which will make it easier to stay up to date!

v3.6.0 (2019-11-15)

Full Changelog

Release Notes

New features and changes

  • #625 New s3 datasource for reading datasources from AWS S3. See the docs for full information.

  • #632 New gs datasource for reading datasources from Google Cloud Storage. See the docs for full information.

  • #661 New git datasource! Supports git over HTTP(s), SSH, the "classic" Git protocol, and repos on local filesystems. See the docs for full information.

  • #581 New --exec-pipe flag - allows piping output directly into a post-execution command

  • #586 New --include flag (opposite of --exclude)

  • #635 With the new --plugin/-p flag you can plug in your own custom functions!

  • #683 When parsing a YAML stream with multiple documents (separated with ---), gomplate will now return the first non-empty document

  • #651 New stable and major (v3) docker image tags - (fixes #648) thanks to @docwhat

    • New Docker image tags available stable, v3, stable-slim, v3-slim, stable-alpine, v3-alpine
  • #598 and #677 Moved to go modules. As a result, if you import gomplate into your own code, your import paths need to change to github.com/hairyhenderson/gomplate/v3

New functions

Bug fixes

  • #617 Fix example in docs for coll.Uniq
  • #623 Fix parsing of media types with + character
  • #641 Fix markdown rendering in docs - thanks to @Ilyes512 for this one!
  • #673 Fix bug where subpath was ignored when inferring MIME type (fixes #672)
gomplate - v3.5.0

Published by hairyhenderson over 5 years ago

A small but mighty release, almost entirely powered by the community! πŸ’ͺ

The major features this time around are support for a AWS Secrets Manager data source, and list support for Consul data sources!

v3.5.0 (2019-06-01)

Full Changelog

Release Notes

New features and changes

Package Rankings
Top 1.04% on Proxy.golang.org
Top 9.61% on Alpine-v3.16
Top 7.43% on Alpine-v3.7
Top 3.49% on Alpine-v3.18
Top 7.91% on Alpine-v3.6
Top 7.92% on Alpine-v3.14
Top 10.33% on Alpine-v3.17
Top 7.83% on Alpine-v3.11
Top 7.66% on Alpine-v3.9
Top 8.08% on Alpine-v3.8
Top 7.36% on Alpine-v3.13
Top 9.35% on Alpine-v3.10
Top 9.04% on Alpine-v3.15
Top 7.54% on Alpine-edge
Top 7.5% on Alpine-v3.12
Badges
Extracted from project README
Build Go Report Card Codebeat Status Coverage Total Downloads CII Best Practices DockerHub Pulls Chocolatey Chocolatey Install Docs Slack Discussions Analytics
Related Projects