source-controller/internal/controller
Sunny 1a7adeb801 Fix helmrepo reconciler unfinished worker bug
Although all the APIs had interval as a required field, when tests
objects were created, they had the zero value of interval, which the API
server accepts. A zero interval value results in the test objects to
reconcile only once when they are created and never reconcile again
unless there's an update to the object. Most of the tests worked with
this behavior.

With HelmRepository removing the interval requirement and adding an
internal default, all the HelmRepository objects created in the tests
without any interval have a default interval value which results in
objects to reconcile automatically if they are not cleaned up after
running tests. TestHelmRepositoryReconciler_InMemoryCaching and
TestHelmChartReconciler_Reconcile create HelmRepository but doesn't
delete it at the end. This leads to a reconciliation of HelmRepository
outside of the test in the envtest environment. It just happened to be
that the reconciliation time matches with the end of test time. At the
end of the test run, the reconcilers receive shutdown signal and any
test server, like helmrepository server, are stopped. A HelmRepository
reconciliation triggered just before the shutdown signal gets stuck in
the reconciliation. HelmRepository can't download the index as the test
index server has stopped and hangs for some time. The HelmRepository
reconciler worker remains in active state, unlike other reconciler
workers that shut down, resulting in the test to timeout at the end.

The is fixed by deleting the HelmRepository object created in
TestHelmRepositoryReconciler_InMemoryCaching and
TestHelmChartReconciler_Reconcile at the end of the test similar to
other tests.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-11-22 21:05:57 +05:30
..
testdata oci: add tests for insecure cosign support; refactor test utils 2023-07-31 13:50:18 +05:30
artifact.go Move controllers to internal/controller 2023-05-03 15:35:45 +05:30
artifact_matchers_test.go Move controllers to internal/controller 2023-05-03 15:35:45 +05:30
artifact_test.go Move controllers to internal/controller 2023-05-03 15:35:45 +05:30
bucket_controller.go bucket: Add prefix filtering capability 2023-10-17 14:13:04 +03:00
bucket_controller_fetch_test.go bucket: Add prefix filtering capability 2023-10-17 14:13:04 +03:00
bucket_controller_test.go Update dependencies to Kubernetes 1.28 2023-11-20 16:50:44 +02:00
common_test.go Move controllers to internal/controller 2023-05-03 15:35:45 +05:30
gitrepository_controller.go misc: address `k8s.io/utils/pointer` deprecation 2023-10-10 09:40:37 +02:00
gitrepository_controller_fuzz_test.go update dependencies and switch to `go-git/go-git` 2023-05-26 13:46:48 +05:30
gitrepository_controller_test.go Update dependencies to Kubernetes 1.28 2023-11-20 16:50:44 +02:00
helmchart_controller.go optional interval and default timeout for helmrepo 2023-11-22 21:05:57 +05:30
helmchart_controller_test.go Fix helmrepo reconciler unfinished worker bug 2023-11-22 21:05:57 +05:30
helmrepository_controller.go Static helmrepository OCI 2023-11-22 21:05:51 +05:30
helmrepository_controller_test.go Fix helmrepo reconciler unfinished worker bug 2023-11-22 21:05:57 +05:30
ocirepository_controller.go cosign: allow identity matching for keyless verification 2023-10-31 08:04:34 -07:00
ocirepository_controller_test.go Update dependencies to Kubernetes 1.28 2023-11-20 16:50:44 +02:00
source_predicate.go Move controllers to internal/controller 2023-05-03 15:35:45 +05:30
storage.go storage: change default file permissions 2023-11-06 12:22:40 +01:00
storage_test.go update dependencies and switch to `go-git/go-git` 2023-05-26 13:46:48 +05:30
suite_test.go Static helmrepository OCI 2023-11-22 21:05:51 +05:30