Commit Graph

106 Commits

Author SHA1 Message Date
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
Hidde Beydals c079240190 Introduce ReconcileStrategy in HelmChartTemplateSpec
To allow configuring it within the `HelmRelease`.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-10-08 13:19:55 +02:00
Hidde Beydals af97ef6e33 Update dependencies
- `github.com/fluxcd/source-controller/api` to `v0.15.4`
- `helm.sh/helm/v3` to `v3.6.3`
- `k8s.io/*` to `v0.21.3`
- `sigs.k8s.io/controller-runtime` to `v0.9.5`

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-08-05 14:23:08 +02:00
Max Jonas Werner d6ce7ceb17 apply automated formatting fix
Signed-off-by: Max Jonas Werner <mail@makk.es>
2021-08-05 14:03:16 +02:00
Max Jonas Werner 1f16ebd699 feat: set default observedGeneration to -1 on HelmReleases
This resolves an issue with kustomize-controller marking a
Kustomization as healthy even when the helm-controller hasn't even
looked at the HelmRelease targeted by the Kustomization's
healthChecks, yet. Setting `observedGeneration` to -1 by default will
cause kstatus to report a status of `InProgress` instead of `Ready`.

see https://github.com/fluxcd/kustomize-controller/issues/387 for
details on the issues this is solving.

Signed-off-by: Max Jonas Werner <mail@makk.es>
2021-08-05 14:03:16 +02:00
Hidde Beydals b2bbe9cffa Update Go requirements and versions to v1.16.x
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-06-09 13:30:47 +02:00
Hidde Beydals 44ea1d90ce Update dependencies
Controller-runtime has been updated to `v0.9.0`, K8s dependencies to
`v0.21.1`, and all `fluxcd/pkg` and other dependencies to the versions
that have matching dependencies and/or build constraints.

This includes an update of Helm to `v3.6.0`, and an update of the
Kustomize API to match `v4.1.x`.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-06-09 13:30:47 +02:00
Santosh Kewat f48b8ab953 Added support for helm waitForJobs
Signed-off-by: Santosh Kewat <santoshkewat.bitmesra@gmail.com>

Added support for helm waitForJobs

Signed-off-by: Santosh Kewat <santoshkewat.bitmesra@gmail.com>

Minor fixes

Signed-off-by: Santosh Kewat <santoshkewat.bitmesra@gmail.com>

Changed WaitForJobs to DisableWaitForJobs

Signed-off-by: Santosh Kewat <santoshkewat.bitmesra@gmail.com>

Minor fixes

Signed-off-by: Santosh Kewat <santoshkewat.bitmesra@gmail.com>

Changed WaitForJobs to DisableWaitForJobs

Signed-off-by: Santosh Kewat <santoshkewat.bitmesra@gmail.com>

Removed unnecessary update to v2alpha1

Signed-off-by: Santosh Kewat <santoshkewat.bitmesra@gmail.com>
2021-06-01 18:47:54 +05:30
Stefan Prodan 5b24c92414
Update dependencies
- fluxcd/pkg/apis/meta v0.9.0
- fluxcd/pkg/runtime v0.11.0
- helm/v3 v3.5.4

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-21 14:07:30 +03:00
Alexander Berger fe766fb5c9 Add deprecation notice to SkipCRDs attribute.
Signed-off-by: Alexander Berger <alex-berger@gmx.ch>
2021-04-20 14:21:36 +02:00
Alexander Berger defee3d26a Integrate feedback from hiddeco
Signed-off-by: Alexander Berger <alex-berger@gmx.ch>
2021-04-20 14:21:36 +02:00
Alexander Berger a6cc150aa6 Initial support for HelmRelease for upgrading CRDs
Signed-off-by: Alexander Berger <alex-berger@gmx.ch>
2021-04-20 14:21:36 +02:00
Dylan Arbour da3186716f Add `ValuesFiles` to HelmChart spec
Signed-off-by: Dylan Arbour <arbourd@users.noreply.github.com>
2021-04-19 10:50:17 -04:00
Stefan Prodan 9706eb0a76
Update fluxcd/pkg/runtime to v0.10.2
Followup: https://github.com/fluxcd/pkg/pull/96

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-19 15:07:03 +03:00
Stefan Prodan b74081dbf7
Update fluxcd/pkg/runtime to v0.10.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-25 12:41:48 +02:00
Somtochi Onyekwere e2c5dda4a5 Update pkg/runtime
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-03-17 15:04:30 +01:00
Hidde Beydals 8c517eb0fb Update dependencies
- helm.sh/helm/v3 to v3.5.3
- github.com/fluxcd/source-controller/api to v0.9.1
- sigs.k8s.io/controller-runtime to v0.8.3
- github.com/fluxcd/pkg/runtime to v0.8.4

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-03-15 13:25:37 +01:00
Stefan Prodan c23ef43f28
Update dependencies
- helm.sh/helm/v3 v3.5.2
- sigs.k8s.io/controller-tools/cmd/controller-gen v0.4.1
- sigs.k8s.io/controller-runtime v0.8.2
- fluxcd/pkg/runtime v0.8.3
- fluxcd/source-controller/api v0.9.0

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-24 11:33:22 +02:00
Hidde Beydals 9926055fdc Update dependencies
* source-controller to v0.7.4
  https://github.com/fluxcd/source-controller/blob/v0.7.4/CHANGELOG.md
* pkg/apis/meta to v0.8.0

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-04 10:04:15 +01:00
Hidde Beydals 622a87a663 Depend on the Kustomize API from `fluxcd/pkg`
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-03 20:02:19 +01:00
Alexander Berger 7db84ac307 Add support for Kustomize based PostRenderer as built-in post renderer.
Signed-off-by: Alexander Berger <alex-berger@gmx.ch>
2021-02-03 15:29:51 +01:00
gtracer a5ab88962a add optional storageNamespace
Signed-off-by: gtracer <ganesha.ashoka@gmail.com>

update comments

Signed-off-by: gtracer <ganesha.ashoka@gmail.com>

make test

Signed-off-by: gtracer <ganesha.ashoka@gmail.com>

revert controller-gen version

Signed-off-by: gtracer <ganesha.ashoka@gmail.com>
2021-01-25 17:09:37 +01:00
Stefan Prodan d072da6298
Update fluxcd/pkg/runtime to v0.8.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-21 19:09:04 +02:00
Hidde Beydals c66e875a60 Update K8s, Helm, source API and ctrl-runtime deps
* `github.com/fluxcd/pkg/apis/meta` to `v0.6.0`
* `github.com/fluxcd/source-controller/api` to `v0.6.0`
* `helm.sh/helm/v3` to `v3.5.0`
* `k8s.io/*` to `v0.20.2`
* `sigs.k8s.io/controller-runtime` to `v0.8.0`

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-01-16 14:19:03 +01:00
Hidde Beydals 32693b8106 Upgrade runtime package to v0.6.2
To include a bug fix to the `ReconcilateAtChangedPredicate`
and renaming to `ReconcileRequestedPredicate`.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-01-14 12:32:34 +01:00
Hidde Beydals e511cb8af4 Upgrade controller-runtime to v0.7.0
This commit upgrades the `controller-runtime` dependency to `v0.7.0`,
including all changes required to make all wiring work again.

- Upgrade `runtime` to v0.6.0 to include `controller-runtime` changes.
- Loggers have been removed from the reconcilers and are now retrieved
  from the `context.Context` passed to the `Reconcile` method and
  downwards functions.
- Logger configuration flags are now bound to the flag set using
  `BindFlags` from `runtime/logger`, ensuring the same contract across
  GitOps Toolkit controllers, and the `--log-json` flag has been
  deprecated in favour of the `--log-encoding=json` default.
- The `ChangePredicate` from `runtime` has changed to a
  `ReconcilateAtChangedPredicate`, and is now chained with the
  `GenerationChangedPredicate` from `controller-runtime` using
  `predicate.Or`.
- Signatures that made use of `runtime.Object` have changed to
  `client.Object`, removing the requirement to e.g. call
  `runtime.Object#Object`.
- The `leader-election-role` was changed, as leader election now works
  via the `coordination/v1` API.

Other notable changes:

- `util.ObjectKey` was added to easily construct a `client.ObjectKey` /
  `types.NamespacedName` from a `metav1.Object`.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-01-11 17:41:49 +01:00
Hidde Beydals 84f0fa78c1 Upgrade dependencies
* `github.com/fluxcd/pkg/apis/meta` to `v0.5.0`
* `github.com/fluxcd/pkg/runtime` to `v0.4.0`
* `github.com/fluxcd/source-controller/api` to `v0.5.0`
* `k8s.io/{api,apiextensions-apiserver,apimachinery,cli-runtime,
  client-go}` to `v0.19.4`
* `sigs.k8s.io/controller-runtime` to `v0.6.4`

Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-12-09 19:35:10 +01:00
Hidde Beydals 5e4bd8fe80 Support Helm's NS creation for TargetNamespace
This adds support for creating the target release namespace if it is not
present which can be be useful in certain scenarios.

Note that when the release is uninstalled, the namespace is not removed
and remains on the cluster, and managing your namespace _outside_ of
the HelmRelease is advised.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-11-27 17:54:19 +01:00
Hidde Beydals d97bcd5974 Remove default value from suspend field
As setting it in-cluster without commiting will otherwise result
in drift and overwrite attempts.

Given that without it the "suspended" column would show empty
fields when they are "false", this column has been removed.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-11-26 12:14:31 +01:00
Stefan Prodan 62c2a375cb
Add readiness/liveness probes
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-11-26 10:09:44 +02:00
Hidde Beydals 5f2f9aaf74 Do not mark suspended resource as not ready
If a resource is marked as suspended we should not perform any
reconciliation action for the resource at all.

This includes updating the status of the resource to a
`Ready==False` state, as this is not an accurate representation of
the resource's state: we have been told to no longer look at it
and with that our last observation freezes in time.

Resource deletions are the sole exception to actions (not) being
performed, as we are duty-bound to remove our finalizer from the
resource to make a deletion succeed.

To make the suspend state still visible to the user, a column has
been added to the Custom Resource Definition which prints the
`.spec.suspend` of every HelmRelease.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-11-25 19:21:48 +01:00
Stefan Prodan b59f06e9a7
Implement service account impersonation
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-11-24 16:49:13 +02:00
Hidde Beydals c0156f193c Refactor to adopt k8s standardized Condition type
Changes the condition type to the one introduced in k8s 1.19, including
the newly introduced helpers in place of the old pkg/apis/meta types.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-11-19 19:00:55 +01:00
Hidde Beydals b801b23911 Properly detect chart version divergences
This is a regression bug fix due to the introduction of the default
values in the source-controller CRDs.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-11-18 10:06:40 +01:00
Aurel Canciu 7fe7004821
Update pkg components and k8s to v1.19
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-11-01 18:23:48 +02:00
Hidde Beydals 831fc5c596 Update pkg/runtime API dependency to v0.1.2
Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-10-29 12:54:53 +01:00
Hidde Beydals 7ac2a41e1a Change copyright to Flux authors
Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-10-27 17:55:18 +01:00
Michael Bridgen 0928cc1e4d Use reconcile annotation helpers
Per https://github.com/fluxcd/pkg/issues/39
2020-10-22 12:26:48 +01:00
Hidde Beydals 15914beca1 Support cross-cluster Helm releases
This is an initial implementation for cross-cluster Helm release
support that relies on a KubeConfig secret, and a reference to it in
the HelmRelease resource.

If set, all actions taken by the Helm runner are executed using the
KubeConfig from the secret. The Helm storage is stored on the remote
cluster in a namespace that equals to the namespace of the HelmRelease
in the managing cluster, the release itself is made in either this
namespace, or the configured TargetNamespace. In any case, both are
expected to exist and/or created beforehand.

Other references to Kubernetes resources in the HelmRelease, like
ValuesReference resources, are expected to exist on the managing
cluster.
2020-10-20 21:30:56 +02:00
Stefan Prodan 6a04f769b2
Update fluxcd/pkg/runtime to v0.1.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-10-13 15:33:46 +03:00