Commit Graph

145 Commits

Author SHA1 Message Date
Hidde Beydals e8e2d41461
api: update dependencies
- github.com/fluxcd/pkg/apis/kustomize to v1.1.0
- github.com/fluxcd/pkg/apis/meta to v1.1.0
- k8s.io/apiextensions-apiserver to v0.27.2
- k8s.io/apimachinery to v0.27.2
- sigs.k8s.io/controller-runtime to v0.15.0

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-05-24 09:44:30 +02:00
Hidde Beydals 2c686b7c23
Update indirect dependencies
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-05-12 12:47:39 +02:00
longquan0104 30b131ab1c
Stable sort release values by key
This commit changes the way the checksum is calculated for the release
values, by stable sorting the keys. By doing this, an upgrade will not
be triggered when a key/value pair has just been moved, instead of
containing a real change of value.

To make it backwards compatible (and without triggering an upgrade due
to new ordering), the checksum without ordering is continued to be
calculated and compared against until removal in a future controller
release. However, only the checksum of the ordered values is taken note
of in the Status of the HelmRelease.

Co-authored-by: Hidde Beydals <hidde@hhh.computer>
Signed-off-by: longquan0104 <longquan0104@gmail.com>
2023-05-11 10:17:52 +02:00
Stefan Prodan 18ed296944
Fix chart metadata by making it truly optional
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-04-03 17:22:50 +03:00
Hidde Beydals 3f65b45e4a
api: add `PersistentClient` flag to allow control
This adds a `PersistentClient` flag which should be consumed by the
controller while initializing the Kubernetes client used by Helm
actions.

This to allow the controller to work with certain charts which do
require a client which does not persist, as they create Custom Resource
Definitions on demand during e.g. install, which then later aren't
observed by Helm as it does not reset the REST mapper between successive
action steps.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-30 16:14:15 +02:00
Hidde Beydals 08925bc282
Add reconciler sharding capability based on label
With this enhancement, the controller can be configured with
`--watch-label-selector`, after which only objects with this label will
be reconciled by the controller.

This allows for horizontal scaling of the helm-controller, where each
controller can be deployed multiple times with a unique label selector
which is used as the sharding key.

Note that if you want to ensure a `HelmChart` gets created for a
specific source-controller instance, you have to provide the labels for
this controller in `.spec.chart.metadata.labels` of the `HelmRelease`.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-29 15:37:53 +02:00
Hidde Beydals a72a2fc6ca
misc: tidy HelmChart annotation and labels feat
- Assing `ObjectMeta` field in Helm chart template.
- Ensure things are at least lightly mentioned in spec documentation.
- Add two simple test cases.
- Fix broken links to Kubernetes documentation.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-29 14:32:13 +02:00
Raffael Sahli 2cc2fee410 feat: manage label and annotations for a helmchart
Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com>
2023-03-29 14:18:40 +02:00
Hidde Beydals a12fd2aa93
api: update dependencies
- github.com/fluxcd/pkg/apis/kustomize to v1.0.0
- github.com/fluxcd/pkg/apis/meta to v1.0.0
- k8s.io/apiextensions-apiserver to v0.26.3
- k8s.io/apimachinery to v0.26.3

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-27 18:36:30 +02:00
Hidde Beydals 8becd60cbd
api: update dependencies
- github.com/fluxcd/pkg/apis/kustomize to v0.8.1
- github.com/fluxcd/pkg/apis/meta to v0.19.1
- sigs.k8s.io/controller-runtime to v0.14.5

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-02 14:41:32 +01:00
Hidde Beydals 87044ba4a0
api: update dependencies
- k8s.io/apiextensions-apiserver v0.26.2
- k8s.io/apimachinery v0.26.2

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-01 13:30:37 +01:00
Hidde Beydals 16ce900b20
api: switch to `meta.KubeConfigReference`
This is backwards compatible, as it only changes the type without the
further requirements around the YAML declaration.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-01 09:36:43 +01:00
Hidde Beydals 8aedb5de24 api: update dependencies
- sigs.k8s.io/controller-runtime to v0.14.4
- Unpin golang.org/x/text from v0.4.0 to allow update to v0.5.0

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-16 17:49:08 +01:00
Stefan Prodan 7b19e37eb8
Update dependencies
- helm.sh/helm/v3 v3.11.0
- k8s.io/* v0.26.1
- sigs.k8s.io/controller-runtime v0.14.2
- github.com/fluxcd/pkg/runtime v0.27.0

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-01-31 16:51:15 +02:00
Paulo Gomes 77b8877494
Update dependencies
- github.com/fluxcd/pkg/apis/kustomize v0.7.0
- github.com/fluxcd/pkg/apis/meta v0.18.0
- k8s.io/apiextensions-apiserver v0.25.4
- k8s.io/apimachinery v0.25.4
- github.com/fluxcd/pkg/apis/event v0.2.0
- github.com/fluxcd/pkg/runtime v0.24.0
- github.com/fluxcd/source-controller/api v0.32.1
- github.com/onsi/gomega v1.24.1
- helm.sh/helm/v3 v3.10.2
- k8s.io/cli-runtime v0.25.4

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-11-22 10:06:20 +00:00
Zhongcheng Lao 4b56a39797
Allow 'h' in HelmRelease timeout field
Signed-off-by: Zhongcheng Lao <Zhongcheng.Lao@microsoft.com>
2022-11-15 09:19:10 +08:00
Stefan Prodan f5d314c51a
Use Flux Event API v1beta1
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-11-08 16:26:31 +02:00
Stefan Prodan 4b6ef97202
Update dependencies
- `k8s.io/*` v0.25.3
- `helm.sh/helm/v3` v3.10.1
- `fluxcd/pkg/runtime` v0.22.0
- `golang.org/x/text` v0.4.0 (fix CVE-2022-32149)

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-10-21 18:34:21 +03:00
Soule BA 2b0e35559c
Add cosign verification to the chart Template
If implemented users can reconcile charts with cosign verification
enabled.

Signed-off-by: Soule BA <bah.soule@gmail.com>
2022-10-21 16:18:02 +02:00
Hidde Beydals ec2eee8f62 api: allow configuration of `h` unit for timeouts
Unlike the other Flux components, there are some scenarios in which a
timeout of 1h (or more) is justified to be able to Helm actions which
take a long time to finish.

To support this, widen the validation added in
54aee36b3a to allow the configuration
of the `h` time unit again. At the cost of theoretically keeping the
workers busy for a long duration of time (and thereby not processing
other changes), but without causing a full denial of service.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-10-21 11:14:55 +00:00
Paulo Gomes 16cf566717
Update dependencies
- github.com/fluxcd/pkg/apis/kustomize v0.6.0
- github.com/fluxcd/pkg/apis/meta v0.16.0
- github.com/fluxcd/pkg/runtime v0.19.0
- github.com/fluxcd/source-controller/api v0.30.0
- helm.sh/helm/v3 v3.10.0
- k8s.io/api v0.25.2
- k8s.io/apiextensions-apiserver v0.25.2
- k8s.io/apimachinery v0.25.2
- k8s.io/cli-runtime v0.25.2
- k8s.io/client-go v0.25.2
- k8s.io/utils v0.0.0-20220922133306-665eaaec4324
- sigs.k8s.io/controller-runtime v0.13.0

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-09-29 16:48:47 +01:00
Stefan Prodan 54aee36b3a
api: add custom validation for v1.Duration types
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-09-20 12:21:37 +03:00
Somtochi Onyekwere 6935835df3 Align controller logs to Kubernetes structured logging
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-09-01 18:37:23 +01:00
Stefan Prodan 62cb973324
Update Kubernetes packages to v1.25.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-08-29 12:26:48 +03:00
Paulo Gomes f2ceb80888
Update dependencies
Dependencies updated:
- github.com/fluxcd/source-controller/api to version 0.27.0.
- github.com/onsi/gomega to version 1.20.0.
- helm.sh/helm to/version 3 to version 3.9.3.
- k8s.io/api to version 0.24.4.
- k8s.io/apiextensions-apise torversion er to version 0.24.3.
- k8s.io/apimachinery to version 0.24.4.
- k8s.io/cli-runtime to version 0.24.3.
- k8s.io/client-go to version 0.24.3.
- k8s.io/utils to version 0.0.0-20220812165043-ad590609e2e5.
- sigs.k8s.io/kustomize/api to version 0.12.1.
- github.com/fluxcd/pkg/apis/kustomize to version 0.4.2.
- github.com/fluxcd/pkg/apis/meta to version 0.14.2.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-08-19 09:31:12 +01:00
Paulo Gomes 3cd330cc53
Add validation to TargetPath and ValuesKey
Formalises the API requirements around TargetPath and ValuesKey,
which were the two fields missing validation within ValuesReference.
In both cases the validation was introduced at CRD level, so that
the apiserver will enforce it.

ValuesKey must be a valid Data Key. Therefore the same logic used by
upstream Kubernetes is reused here to ensure a valid key is being used.

For TargetPath a loose regex is being used to largely represent the
expected format. A max length of 250 is now being enforced.

This is a breaking change, as invalid TargetPath and ValuesKey will now
be rejected by the apiserver, instead of being accepted and potentially
failing at reconciliation time.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-08-17 14:30:35 +01:00
Paulo Gomes c945cd6ed1
build: Upgrade to Go 1.18
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-07-06 17:06:39 +01:00
Paulo Gomes 1c1d9c1684
Update gopkg.in/yaml.v3 to v3.0.1
The api package was not updated as part of #501.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-07-01 13:35:24 +01:00
Hidde Beydals 7d3ee6c662 Update dependencies
- github.com/fluxcd/source-controller/api to v0.25.3
- k8s.io/api to v0.24.1
- k8s.io/apiextensions-apiserver to v0.24.1
- k8s.io/apimachinery to v0.24.1
- k8s.io/cli-runtime to v0.24.1
- k8s.io/client-go to v0.24.1

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-06-07 13:07:45 +02:00
Hidde Beydals baae489a78 api: update k8s.io/* dependencies
- k8s.io/apiextensions-apiserver to v0.24.1
- k8s.io/apimachinery to v0.24.1

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-06-07 13:07:45 +02:00
Stefan Prodan 773d9f7f09
Update go-yaml to v3.0.0
Fix CVE-2022-28948

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-05-26 18:52:55 +03:00
Stefan Prodan 048cdfde59
Update dependencies
- fluxcd/pkg/apis/meta v0.14.0
- fluxcd/pkg/runtime v0.16.0
- fluxcd/pkg/ssa v0.16.0
- k8s.io/* v0.24.0
- helm.sh/helm/v3 v3.9.0-rc.1 (required by breaking changes in Kubernetes 1.24)

Note that fluxcd/pkg/runtime v0.16 comes with support for Kubernetes API Priority and Fairness feature.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-05-26 18:45:44 +03:00
Hidde Beydals f82dadd88b api: update dependencies
- k8s.io/apiextensions-apiserver to v0.23.6
- k8s.io/apimachinery to v0.23.6

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-05-03 14:15:08 +02:00
Nick Stogner 9f60433550 Add .spec.kubeConfig.secretRef.key
Signed-off-by: Nick Stogner <nicholas.stogner@gmail.com>
2022-04-28 13:19:22 +02:00
Hidde Beydals 5452351aeb api: update dependencies
- github.com/fluxcd/pkg/apis/kustomize to v0.3.3
- github.com/fluxcd/pkg/apis/meta to v0.12.2
- k8s.io/apiextensions-apiserver to v0.23.5
- k8s.io/apimachinery to v0.23.5
- sigs.k8s.io/controller-runtime to v0.11.2

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-19 13:51:44 +02:00
Paulo Gomes 86a8d26985
Update KubeConfig documentation
When the flag --default-service-account was added it changed
slightly the behaviour of the spec.KubeConfig field. It forces
the impersonation to always take place, either via the contents
of spec.ServiceAccountName or its fallback at controller level.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-04-04 16:30:07 +01:00
Hidde Beydals 1763d6852f Implement `meta.ObjectWithConditions` interfaces
Follow up on #421 to fully implement new tooling requirements. By
implementing the interfaces, the `conditions` package can now be used.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-03-22 15:27:15 +01:00
Hidde Beydals c6eefda5fc Update Go Modules with `-compat=1.17`
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-03-21 12:09:39 +01:00
Hidde Beydals eb9517b29a api: update dependencies
- github.com/fluxcd/pkg/apis/kustomize to v0.3.2
- k8s.io/apiextensions-apiserver to v0.23.4
- sigs.k8s.io/controller-runtime to v0.11.1

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-03-18 14:46:28 +01:00
Sunny 6bd29a729d Use new standardized runtime and meta package
This includes an update of the source-controller to v0.22.0, to pull in
the v1beta2 API which makes use of the same packages.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-03-18 13:10:32 +01:00
Tomek Rękawek 5b1b1ce642 Support targeted Patches in the PostRenderer specification.
Signed-off-by: Tomek Rękawek <rekawek@adobe.com>
2022-03-11 14:34:28 +01:00
Sunny 2142425d44
api: Move Status in CRD printcolumn to the end
Status content could be very long compare to other fields. Moving it to
the end helps improve the visibility of other fields.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-02-24 01:55:06 +05:30
Stefan Prodan 1410615554
Set QPS and Burst when impersonating service account
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-02-21 14:25:27 +02:00
Samuel Torres 7d6c0f7c47 Add disableWait property on Helm uninstall
This commit changes the default behavior of the Helm uninstall action
to wait for all resources to be deleted, and introduces a
`.spec.uninstall.disableWait` flag to disable this behavior.

Signed-off-by: Samuel Torres <samuelpirestorres@gmail.com>
2022-02-16 12:09:29 +01:00
Paulo Gomes 5572b8a553
Refactor fuzzing
Structure the fuzz implementation to be closer to what go native will support.
Add Makefile target to enable smoketesting fuzzers.
Add smoketest as CI workflow.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-01-17 20:45:16 +00:00
Aurel Canciu 2c82071f6c
Update flux pkg components
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2022-01-07 17:53:07 +01:00
Aurel Canciu 57d4c29db1
Update Go to v1.17
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2022-01-07 17:52:29 +01:00
Hidde Beydals 90e42d87f7 Update dependencies (fix CVE-2021-43784)
- Update github.com/opencontainers/runc to v1.0.3,
  to fix CVE-2021-43784, GO-2021-0085, GO-2021-0087
- Update github.com/fluxcd/pkg/apis/kustomize to v0.3.0

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-12-09 11:53:47 +01:00
Stefan Prodan 8ee4d88af9
Update controller-runtime to v0.10.2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-11-22 15:07:12 +02:00
Hidde Beydals ea447a451b Update Helm to v3.7.0
This pulls in Kubernetes dependencies at `v0.22.1`, but should include
improvements that would help resolve https://github.com/fluxcd/helm-controller/issues/149

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-10-08 13:56:58 +02:00