Commit Graph

17 Commits

Author SHA1 Message Date
xtphate a15a1b0731
Feature/support env hcl and interpolations (#1423)
* support HCL language for env variables

Signed-off-by: xtphate <65117176+XT-Phate@users.noreply.github.com>
2024-04-22 08:02:14 +08:00
yxxhero c55fa0f765
Replace interface{} by any (#901)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-06-16 10:49:05 +09:00
Quan TRAN 5650661a88
remove unnecessary remote.Locate() (#565)
* remove unnecessary Locate

Signed-off-by: Quan TRAN <account@itscaro.me>

* add remote test

Signed-off-by: Quan TRAN <itscaro@users.noreply.github.com>

---------

Signed-off-by: Quan TRAN <account@itscaro.me>
Signed-off-by: Quan TRAN <itscaro@users.noreply.github.com>
Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>
2023-03-29 21:27:12 +08:00
yxxhero a817997ed8
bump mergo to 0.3.14 (#751)
bump merge to 0.3.14

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-03-17 18:37:15 +08:00
yxxhero d0ef31e10b
optimize logger code (#706)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-02-19 23:20:47 +08:00
yxxhero d8cb740dcf
fix env value lost in environment values (#605)
* fix env value lost in environment values

Signed-off-by: yxxhero <aiopsclub@163.com>

* add more test

Signed-off-by: yxxhero <aiopsclub@163.com>

Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-27 09:48:07 +08:00
Yusuke Kuoka 6664f01596
Use goccy/go-yaml for v1 / Prep bringing back go-yaml v2 for v0.x (#604)
This is a successor to #596. We need a smooth migration path from `gopkg.in/yaml.v2`, and this pull request moves it forward with `goccy/go-yaml` instead of `gopkg.in/yaml.v3`. Merging this unblocks users stuck in Helmfile v0.146.x or earlier due to #435, so that they can upgrade to 0.147.x or greater without updating their helmfile configs.

We previously tried to upgrade to `yaml.v3` (https://github.com/helmfile/helmfile/issues/394) in Helmfile v0.x, presuming it won't break anything. Apparently, it broke use-cases where you want to layer release's `values` field over three or more release templates and releases (#435).

We then tried to bring back `yaml.v2` for Helmfile v0.x and keep `yaml.v3` for the upcoming Helmfile v1. However, it failed due to incompatibility in the Unmarshaller interface between `yaml.v2` and `yaml.v3` (https://github.com/helmfile/helmfile/pull/596).

`goccy/go-yaml` is, from my observation, a well-maintained alternative to `yaml.v2`. One of its premises is that it enables us to swap the implementation from `gopkg.in/yaml.v2` to `goccy/go-yaml` just by replacing the import directive. It seems to use the same `Unmarshaller` interface as yaml.v2 too.

Once this PR gets merged, I'd like to follow-up with adding a new build-time variable and an envvar to set the proper default for the yaml parser Helmfile uses and the ability to switch the parser at runtime. All in all, the next Helmfile release, v0.150.0 will get reverted to use `gopkg.in/yaml.v2` by default which resolves #435.

New users who started using Helmfile since any of v0.148.0, v0.148.1, and v0.149.0 might be already relying on the new behavior, They might need to specify a new envvar to enable `goccy/go-yaml`.

Signed-off-by: yxxhero <aiopsclub@163.com>
Signed-off-by: yxxhero <aiopsclub@163.com>
Co-authored-by: yxxhero <aiopsclub@163.com>
2022-12-27 10:14:35 +09:00
yxxhero 14ba7cd156 bump: upgrade gopkg.in/yaml.v2 to gopkg.in/yaml.v3
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-10-03 05:24:51 +08:00
Arkaitz Jimenez cc33e7b7d8
Introduce Helmfile's own filesystem abstraction to correctly unit test some components (#307)
Use abstracted FS

Signed-off-by: Arkaitz Jimenez <arkaitzj@gmail.com>

Signed-off-by: Arkaitz Jimenez <arkaitzj@gmail.com>
2022-08-24 12:58:43 +09:00
yxxhero 8690d63401 fix lint error
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-08-13 07:40:32 +08:00
austin ce eb3484d4a8
Rename module to github.com/helmfile/helmfile
Also updates a few more references to the roboll/helmfile repository,
where possible.

Signed-off-by: austin ce <austin.cawley@gmail.com>
2022-05-18 10:05:07 -04:00
Quan TRAN 45be24da53
Add .StateValues as alias of .Values in EnvironmentTemplateData (#2056) 2022-03-31 10:57:33 +09:00
pjotre86 ca6dd7a60f
Make .Environment values available in .gotmpl files. (#2000)
Currently it's not possible to use `.Environment` values in `*.gomtpl` files. The documentation states the opposite: 
https://github.com/roboll/helmfile#environment (2nd paragraph).
The problem is already described in #1090.
This PR fixes this bug.
Fixes #1090

Co-authored-by: Peter Aichinger <petera@topdesk.com>
2021-11-04 10:04:01 +09:00
Kevin J. Qiu 0f86cc9b87
Add the ability to load a remote environment values file (#1296)
Enables the user to specify a remote path for an environment values file, e.g.,

```yaml
environments:
  cluster-azure-us-west:
    values:
      - git::https://git.company.org/helmfiles/global/azure.yaml?ref=master
      - git::https://git.company.org/helmfiles/global/us-west.yaml?ref=master
  cluster-gcp-europe-west:
    values:
      - git::https://git.company.org/helmfiles/global/gcp.yaml?ref=master
      - git::https://git.company.org/helmfiles/global/europe-west.yaml?ref=master

releases:
  - ...
```

This is particularly useful when you co-locate helmfiles within your project repo but want to reuse the definitions in a global repo.
2020-06-11 10:04:01 +09:00
Daniel Elo d404356230 feat: fix empty map merge after mergo bump
since mergo had been bumped to 0.3.9 an environment value like:
```
affinity: {}
```
was not merged properly (not merged at all) instead it threw an error
that it cannot find the key "affinity" in the environment values even
though it was outputted in debug output as read in properly.
2020-04-03 15:01:27 +02:00
Erik Forsberg 65818cd345 feat: When values.yaml.gotmpl can't be parsed as YAML, print the YAML. (#703)
This helps a lot when debugging go templates.
2019-06-19 08:47:36 +09:00
KUOKA Yusuke 78b03e0d92
fix: --state-values-set panic: value of type interface {} is not assignable to type string (#680)
Probably since #647 helmfile has been unable to merge nested maps in environment values if they were loaded from files. This fixes it.

The relevant test is also enhanced so that no further regression like this happens.

Fixes #677
2019-06-12 13:35:04 +09:00