Commit Graph

779 Commits

Author SHA1 Message Date
Stefan Prodan 8baead9b2e
Add e2e test for CRDs+CRs reconciliation using cert-manager
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-09-30 18:35:39 +03:00
Stefan Prodan 97bbc59eb6
Skip finalizer pruning when impersonation fails
When impersonation fails, emit an event with the stale objects and continue with the finalization as this is not a retryable error.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-09-30 18:35:39 +03:00
Stefan Prodan 69069c3ab3
Refactor reconciliation into actions
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-09-30 18:35:39 +03:00
Stefan Prodan b33e3b3449
Update the status when health checking starts
Set the healthiness status to progressing and specify the health check timeout in the condition message.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-09-30 18:35:39 +03:00
Stefan Prodan 1e01d800c5
Implement reconciliation using server-side apply
Reconciler behaviour:
- Creates an inventory of objects to be applied (persisted in-cluster under `.status.inventory`).
- Applies first custom resource definitions (CRDs) and namespaces, waits for them to register and only then applies the custom resources.
- Validates all resources with server-side dry-run apply (namespaced objects must contain `metadata.namespace`, defaulting to the `default` namespace is no longer supported).
- Reconciles only the resources that drifted.
- Prunes the objects that were previously applied but are missing from the current inventory.
- Emits events for only the resources that where created, configured or deleted.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-09-30 18:34:40 +03:00
Stefan Prodan 79dd86581c
Remove kubectl dependency
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-09-30 18:33:26 +03:00
Stefan Prodan 3a03d235c2
Add SSA resource manager
Package ssa contains utilities for managing Kubernetes resources using sever-side apply.
Package objectutil contains utilities for manipulating Kubernetes objects.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-09-30 18:33:26 +03:00
Stefan Prodan 7ffe62b8e7
Introduce v1beta2 API
Changes from v1beta1:
- `spec.validation` removed (server-side validation is implicit)
- `spec.status.snapshot` replaced by `spec.status.inventory`
- `spec.patchesStrategicMerge` deprecated in favour of `spec.patches`
- `spec.patchesJson6902` deprecated in favour of `spec.patches`

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-09-30 18:33:26 +03:00
Stefan Prodan ea369a0281
Merge pull request #435 from makkes/fix-health-checks
fix: don't skip all errors when recording health check status
2021-09-30 17:27:51 +03:00
Max Jonas Werner 435815c2a5
fix: don't skip all errors when recording health check status
fixes #432

Signed-off-by: Max Jonas Werner <mail@makk.es>
2021-09-30 15:31:02 +02:00
Stefan Prodan 74f08c3f1b
Merge pull request #425 from fluxcd/refactor-tests
Refactor tests
2021-09-10 17:07:58 +03:00
Stefan Prodan 14329c6fa0
Refactor tests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-09-10 16:51:22 +03:00
Stefan Prodan 3cb1ce8029
Run tests with envtest installed in testbin
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-09-10 15:08:31 +03:00
Stefan Prodan 8534a1463a
Merge pull request #424 from fluxcd/release-v0.14.1
Release v0.14.1
2021-09-09 15:37:50 +03:00
Stefan Prodan 54efaca039
Release v0.14.1
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-09-09 15:21:36 +03:00
Stefan Prodan 9838b77597
Merge pull request #420 from michalschott/main
Mask the Kubernetes Secrets data from dry-run and apply logs
2021-09-09 15:13:24 +03:00
Michal Schott 72bc54477a
Filter dryrun errors for senstive data.
Signed-off-by: Michal Schott <michal.schott@onegini.com>
2021-09-08 16:32:18 +02:00
Michal Schott cb93667050
Redact secret data.
Signed-off-by: Michal Schott <michal.schott@onegini.com>
2021-09-03 21:52:22 +02:00
Hidde Beydals 52c61f82f3
Merge pull request #404 from makkes/default-observed-generation
feat: set default observedGeneration to -1 on Kustomizations
2021-08-27 17:37:52 +02:00
Max Jonas Werner d7690d8564
feat: set default observedGeneration to -1 on Kustomizations
This is a follow-up to
https://github.com/fluxcd/helm-controller/pull/294, porting the same
code to the kustomize-controller so that all Flux 2 controllers work
the same way in this regard.

Signed-off-by: Max Jonas Werner <mail@makk.es>
2021-08-27 17:15:24 +02:00
Stefan Prodan ea052f845d
Merge pull request #417 from fluxcd/release-v0.14.0
Release v0.14.0
2021-08-26 12:05:18 +03:00
Stefan Prodan 053f68b8ff
Release v0.14.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-08-26 11:37:05 +03:00
Stefan Prodan 96890d3c98
Merge pull request #416 from fluxcd/kustomize-v4.3.0
Update controller to kustomize v4.3.0
2021-08-26 10:50:33 +03:00
Stefan Prodan 80d712e5e9
Update controller to kustomize v4.3.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-08-26 09:08:39 +03:00
Stefan Prodan c637838682
Merge pull request #411 from fluxcd/skip-gc-for-ownerReference
Skip garbage collection of objects with owner references
2021-08-26 09:02:36 +03:00
Stefan Prodan 1032b6b696
Merge pull request #412 from jalseth/main
Improve trimString function
2021-08-25 18:04:22 +03:00
James Alseth 6f32e53970
Improve trimString function
Previously, the function iterated until the length limit was hit, which
is relatively slow and increases with the length of the limit. The new
implementation is easier to reason about and operates in constant time,
leading to better performance.

Signed-off-by: James Alseth <james@jalseth.me>
2021-08-24 19:18:41 -07:00
Stefan Prodan 16c451ba40
Add GC owner reference tests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-08-19 17:15:04 +03:00
Stefan Prodan a49bbf9ed3
Skip garbage collection of objects with owner references
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-08-18 12:49:28 +03:00
Stefan Prodan 34582cb0dd
Merge pull request #408 from SomtochiAma/add-kustomize-replacement
Add tests for various kustomize transformers.
2021-08-16 18:04:02 +03:00
Somtochi Onyekwere b1071bf871 Add kustomize transformer tests
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-08-16 15:40:14 +01:00
Stefan Prodan ebbf7bcfc9
Merge pull request #406 from SomtochiAma/add-kustomize-replacement
Add kustomize replacement transformer test
2021-08-13 10:00:04 +03:00
Somtochi Onyekwere 659e660b6d Tests for replacement transformer
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-08-13 07:28:19 +01:00
Stefan Prodan b0d1959dda
Merge pull request #402 from fluxcd/release-v0.13.3
Release v0.13.3
2021-08-05 16:39:29 +03:00
Stefan Prodan 0e55929c95
Release v0.13.3
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-08-05 16:12:19 +03:00
Stefan Prodan 00579b4c2c
Merge pull request #401 from fluxcd/update-deps
Update dependencies
2021-08-05 16:05:02 +03:00
Stefan Prodan c89374c758
Update source-controller/api to v0.15.4
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-08-05 15:41:07 +03:00
Stefan Prodan fe0f946840
Update dependencies
- k8s.io/* v0.21.3
- controller-runtime v0.9.5
- kubectl 1.21.3

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-08-05 10:45:32 +03:00
Stefan Prodan 85d73f30d9
Merge pull request #400 from fluxcd/sops-kubeconfig
Make the kubeconfig secrets compatible with SOPS
2021-08-05 10:34:13 +03:00
Stefan Prodan 5d1cb91841
Make the kubeconfig secrets compatible with SOPS
Add `values.yaml` to the supported kubeconfig secret key names in order for SOPS to correctly detect the storage format based on the file extension.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-08-04 14:43:33 +03:00
Stefan Prodan 81a4090328
Merge pull request #397 from darkowlzz/rm-util-objectkey
Remove old util ObjectKey
2021-08-01 12:21:25 +03:00
Sunny 930e7d398e
Remove old util ObjectKey
Replace old utility function ObjectKey with controller-runtime's
client.ObjectKeyFromObject.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2021-08-01 04:27:35 +05:30
Stefan Prodan 9d66fc71ba
Merge pull request #394 from makkes/prevent-npes
fix: prevent nil pointer dereference in health checks
2021-07-27 10:18:29 +03:00
Max Jonas Werner 08920d3286
fix: prevent nil pointer dereference in health checks
When checking the health status of each declared resource, kstatus
might return nil for certain resources (for whatever reason). In that
case, this information is now conveyed in the health status event.

https://github.com/fluxcd/kustomize-controller/pull/374

Signed-off-by: Max Jonas Werner <mail@makk.es>
2021-07-26 19:03:46 +02:00
Stefan Prodan 969bd4d2c8
Merge pull request #390 from fluxcd/test-fix
Fix generation conflicts in tests
2021-07-08 18:42:41 +03:00
Stefan Prodan f556cb29f6
Fix generation conflicts in tests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-07-08 18:21:22 +03:00
Stefan Prodan 6ec3edcb98
Merge pull request #376 from ViBiOh/kustomization_prune_update
Add test for prune toggling
2021-07-08 14:39:47 +03:00
Vincent Boutour 23b0a2d455
Adding test for materializing #375
Signed-off-by: Vincent Boutour <bob@vibioh.fr>
2021-07-07 18:01:57 +02:00
Hidde Beydals d7572972ce
Merge pull request #389 from oliverbaehler/main 2021-07-07 17:38:13 +02:00
Oliver Bähler 6cc6e1d391 More explicit example
Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>
2021-07-07 15:06:41 +02:00