Commit Graph

123 Commits

Author SHA1 Message Date
Hidde Beydals ba3ed63a9d Remove HelmRepository owner ref on HelmChart
As the HelmChart is not the result of the HelmRepository, but more
like a Deployment -> Secret relationship.
2020-07-16 12:39:53 +02:00
stefanprodan eb20a8f465 Improve error handling and reporting
- return reconciliation error so that controller runtime metrics record failures
- change structure logging labels to match the controller runtime format
- log the reconciliation duration for all kinds
- normalise log messages and labels across all controllers
2020-07-15 12:24:11 +03:00
stefanprodan 6f89f2d4c5 Implement event recording
- emit Kubernetes events for artifact acquisition actions
- forward events to notification controller
2020-07-03 08:46:26 +03:00
stefanprodan 5ee875afbd status: add revision to the ready condition message 2020-04-29 08:49:45 +03:00
stefanprodan 8071dadbf0 status: record progressing
Set ready condition to unknown while the reconciliation is progressing.
This allows other operators to wait for a sync to complete.
2020-04-27 11:16:35 +03:00
Hidde Beydals 2103d38a70
Merge pull request #33 from fluxcd/git-timeout
api: add timeout field to GitRepositorySpec
2020-04-22 12:16:31 +02:00
Hidde Beydals 920d37fcda api: add timeout field to GitRepositorySpec
This commit adds a timeout field to the GitRepositorySpec to be used
during the git clone operation when reconciling the resource.
When no interval is defined the default timeout returned by the getter
is 20 seconds.

The timeout can not be added yet to the Helm related sources as it
is currently not possible to inject anything custom into the HTTP
client from the Helm HTTP getter except for the authentication
options built in. A submit has been submitted to make this possible
and is waiting for review.

This commit includes some context changes to the other reconcilers
to tidy them up and make them depend on a single background context.

It also includes some added docblocks that crossed my path.
2020-04-22 11:42:27 +02:00
Hidde Beydals 5b77100589 controllers: make concurrent reconciles config opt
Introduces new helpers and config structs to all reconcilers to
set the max concurrent reconciles number.

Introduces a new flag `--concurrent` to configure the number of
concurrent reconciles per reconciler, defaults to `2`.
2020-04-19 11:52:10 +02:00
Hidde Beydals 236a6950cd controllers: test HelmChart missing HelmRepository 2020-04-17 20:39:33 +02:00
Hidde Beydals 7e7f1ccd89 controllers: test HelmChart secretKey usage 2020-04-17 20:29:45 +02:00
Hidde Beydals 6083d886ce controllers: add HelmChart reconciler tests 2020-04-17 19:21:48 +02:00
Hidde Beydals ab3879d170 controllers: check if != nil before defering 2020-04-16 11:11:51 +02:00
Hidde Beydals 45da46216c
Merge pull request #21 from fluxcd/log-context
Use same logger during reconcile operations
2020-04-14 12:08:53 +02:00
stefanprodan 1832b2d11d Introduce source interface
- add source interface with `GetArtifact` and `GetInterval` funcs
- implement source interface for all types
- fix HelmChart requeue
2020-04-14 12:49:31 +03:00
Hidde Beydals b0f4908af0 Use same logger during reconcile operations 2020-04-14 11:36:46 +02:00
stefanprodan e88d7219ca Change artifact path format
- move artifact path composition to API
- change path format to `<source-kind>/<source-namespace>/<source-name>/<artifact-filename>`
2020-04-13 19:52:30 +03:00
Hidde Beydals 194371c4c0 Set owner ref to HelmRepository on HelmChart 2020-04-13 12:29:13 +02:00
Hidde Beydals ea610829c3 Helm repository and chart HTTP and TLS auth 2020-04-13 11:47:51 +02:00
Hidde Beydals 1b391f4896 Move artifact gc to delete event predicate 2020-04-13 01:35:44 +02:00
Hidde Beydals 629da726c6 Rename RepositoryChange to SourceChange predicate 2020-04-13 01:11:07 +02:00
Hidde Beydals 4bde6bf880 Prevent delete from wiping all artifacts for kind 2020-04-12 22:07:57 +02:00
Hidde Beydals 7e99998c5f Factor out injection of kind string in controllers 2020-04-12 22:07:53 +02:00
Hidde Beydals d378bd1852 Introduce HelmChart API and controller
- Add the HelmChart types and controller
- Semver expressions are found by utilizing Helm repository index
  helpers. As Helm makes use of `masterminds/semver`, the support
  for i.e. ranges less mature than the `GitRepository` implementation.
- Recorded semver is as defined in the metadata of the chart. The
  used name for the artifact does however include the checksum of the
  chart archive, as chart maintainers may not always properly apply
  semver.
- Switches to `sigs.k8s.io/yaml` for YAML operations as this among
  other things is able to properly unmarshal embedded structures.
- Directly requeues on transient errors instead of using the defined
  interval as a back-off strategy is applied on repeated failures.
2020-04-12 18:44:37 +02:00