Commit Graph

10 Commits

Author SHA1 Message Date
Hidde Beydals 29caae3fca Rewrite `GitRepositoryReconciler` to new standards
This commit rewrites the `GitRepositoryReconciler` to new standards,
while implementing the newly introduced Condition types, and trying
to adhere better to Kubernetes API conventions.

More specifically it introduces:

- Implementation of more explicit Condition types to highlight
  abnormalities.
- Extensive usage of the `conditions` subpackage from `runtime`.
- Better and more conflict-resilient (status)patching of reconciled
  objects using the `patch` subpackage from runtime.
- Proper implementation of kstatus' `Reconciling` and `Stalled`
  conditions.
- First (integration) tests that solely rely on `testenv` and do not
  use Ginkgo.

There are a couple of TODOs marked in-code, these are suggestions for
the future and should be non-blocking.
In addition to the TODOs, more complex and/or edge-case test scenarios
may be added as well.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-02-15 15:42:14 +05:30
Hidde Beydals 917300dc79 Write chart data on identitical values overwrite
This likely happened because the byte buffer response was already
being read by the chart loader, making it empty by the time the
artifact was written to storage.

As an alternative, and because it makes the code a tiny bit less
obnoxious: write the data to a temp file first, and later decide
what file to copy over and use as an stored artifact.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-21 14:50:03 +02:00
Dylan Arbour c0bd4ab7d0 Test values overrides
Adds a test that loads the helmChart from the updated resource and
verifies that `testOverride` (the value overrode in the test fixtures)
changes from `false` to `true`.

Signed-off-by: Dylan Arbour <arbourd@users.noreply.github.com>
2021-04-08 18:57:05 -04:00
Aurel Canciu a55c502bb4
Fix HelmChart valuesFile chart path restriction
As part of the feature implementation to support helm chart
dependencies, the functionality for allowing values files overwriting
from any location scoped to the same source was altered. This should fix
the problem by allowing users to load files from any arbitrary location
as long as it's in the context of the same source from where the helm
chart itself is loaded.

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-12-17 12:57:41 +02:00
Aurel Canciu 946d1e6ac0
Remove use of chartutil.ProcessDependencies
It looks like the use of chartutil.ProcessDependencies in the HelmChart
Controller was not correct, this method seems to be used in Helm only
during install/upgrade. The intention was to load the dependencies but
this seems to not be needed as it's already done through the loaders
(loader.Load).

The use of this method caused a regression where Chart.yaml files would
be overwritten and registered subcharts that had aliases would be
renamed using the alias name. While this is an expected behaviour of
chartutil.ProcessDependencies it is not what the controller should do
to the chart during (re)packaging.

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-10-30 19:16:28 +02:00
Aurel Canciu f1362bd3a9
Implement DepdendencyManager for non-packaged
Non-packaged charts that don't have their dependencies present in
charts/ will now have these dependencies built using the
DependencyManager. The idea behind it is to replicate the logic
implemeneted in Helm's downloader.Manager with the support for already
existing HelmRepository resources and their chart retrieval capabilities.

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-10-28 15:46:18 +02:00
Aurel Canciu ad995d80cc
Reorganize helm chart testdata for controllers
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-10-28 14:57:12 +02:00
Hidde Beydals 582c2092b6 Change copyright to Flux authors
Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-10-27 17:54:22 +01:00
Hidde Beydals 3c70c8d333 controllers: test HelmRepository TLS auth 2020-04-17 10:41:24 +02:00
Hidde Beydals a50ea436fa controllers: basic HelmRepository reconciler tests 2020-04-17 10:35:52 +02:00