Commit Graph

1351 Commits

Author SHA1 Message Date
Hidde Beydals 89a4e52fe3
Merge pull request #701 from Juneezee/test/t.TempDir 2022-04-29 17:39:23 +02:00
Eng Zer Jun 10b92da433
test: use `T.TempDir` to create temporary test directory
This commit replaces `os.MkdirTemp` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `os.MkdirTemp`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-04-29 23:01:39 +08:00
Hidde Beydals bc5a47e821
Merge pull request #695 from fluxcd/release-v0.24.3 2022-04-28 09:43:25 +02:00
Hidde Beydals 57e7c79098 Release v0.24.3
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-28 09:11:42 +02:00
Max Jonas Werner 9c6a6d91e8 build: let users pass test flags to `make test`
This comes in handy e.g. to only run a single test during development.

Signed-off-by: Max Jonas Werner <mail@makk.es>
2022-04-28 06:31:45 +02:00
Sunny 745d6ee0c5
Merge pull request #691 from fluxcd/cached-helmrepo-diff-checksum
helmrepo: same revision different checksum scenario
2022-04-27 15:28:29 +05:30
Sunny eeaa958866
helmrepo: same revision different checksum condn
This change prevents Reconciling and ArtifactOutdated conditions to be
set on HelmRepo when the checksum of a cached repo index changes.

Adds some tests to ensure that when the repo index is cached, the
revision and checksum of the returned artifact are the same as on the
existing object status.
Also adds checks for the returned artifact and chartRepo from
reconcileSource, to ensure that chartRepo is populated and the checksum
of a new potential artifact is always empty, as it's populated when the
artifact is written in the storage.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-04-27 13:03:51 +05:30
Hidde Beydals dd40748e96
Merge pull request #688 from fluxcd/release-v0.24.2 2022-04-26 09:12:18 +02:00
Hidde Beydals 4c0f22171c Release v0.24.2
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-26 08:53:17 +02:00
Hidde Beydals d7e36e2ec0
Merge pull request #685 from pjbgf/optimise-helm-load
helm: optimise repository index loading
2022-04-26 08:10:28 +02:00
Paulo Gomes 009504b294 helm: optimise repository index loading
Avoid validating (and thus loading) indexes if the checksum already exists in storage.
In other words, if the YAML is identical to the Artifact in storage, the reconciliation should
be a no-op, and therefore can short-circuit long/heavy operations.

Co-authored-by: Hidde Beydals <hello@hidde.co>
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-04-25 17:00:27 +02:00
Paulo Gomes 3c67efaf8f
Merge pull request #686 from codablock/fix-git-tests
tests: Fix flakiness of git related tests
2022-04-25 15:53:34 +01:00
Alexander Block fa09aa2a39 tests: Use proper timeouts in gitrepository and helmrepository tests
I assume using "interval" for timeouts was an accident and "timeout" was
actually meant to be used. This also fixes flakiness of tests.

Signed-off-by: Alexander Block <ablock84@gmail.com>
2022-04-25 14:30:25 +02:00
Alexander Block 7c8b175258 tests: Set GIT_CONFIG_GLOBAL=/dev/null for tests run via make test
This ensures that no host specific git configuration is pulled in while
testing. One such example would be "init.defaultBranch" which is set to
"main" on some hosts, which then causes tests to fail as they keep looking
for "master" branches.

Signed-off-by: Alexander Block <ablock84@gmail.com>
2022-04-25 14:30:16 +02:00
Hidde Beydals cfbe6ac124
Merge pull request #684 from fluxcd/release-v0.24.1 2022-04-22 11:06:37 +02:00
Hidde Beydals d2132086d0 Release v0.24.1
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-22 10:50:29 +02:00
Hidde Beydals 0836d882ba
Merge pull request #683 from fluxcd/fix-panic 2022-04-22 10:42:17 +02:00
Max Jonas Werner c3d5dac4a8
fix panic when HelmRepository's artifact size is nil
This fixes the immediate issue of the nil pointer dereference but we
still haven't isolated the actual cause of the size being nil to begin
with. This is ongoing work and as soon as we have boiled that down to
the simplest case we will provide a regression test for that case.

closes #680

Signed-off-by: Max Jonas Werner <mail@makk.es>
Co-authored-by: Hidde Beydals <hiddeco@users.noreply.github.com>
2022-04-22 10:29:56 +02:00
Hidde Beydals c51b359a6a
Merge pull request #678 from fluxcd/release-v0.24.0 2022-04-19 13:06:47 +02:00
Hidde Beydals c83f0ad96c Release v0.24.0
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-19 12:53:03 +02:00
Hidde Beydals 3559e7aac3
Merge pull request #677 from fluxcd/update-deps 2022-04-19 12:52:21 +02:00
Hidde Beydals 67ef697630 Update github.com/elazarl/goproxy
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-19 12:19:54 +02:00
Hidde Beydals b9b123c063
Merge pull request #667 from souleb/use-cache-when-building-deps 2022-04-19 12:05:20 +02:00
Soule BA 0df8dcccec
Enable dependency manager to use in memory cache
If implemented this will:
- enable the helmCharts dependency manager to use the helm in memry
  cache to retrieve reconciled HelmRepositories indexes.
- record cache events.

Signed-off-by: Soule BA <soule@weave.works>
2022-04-19 11:46:27 +02:00
Hidde Beydals a4d339bf25
Merge pull request #676 from fluxcd/update-deps 2022-04-15 16:58:20 +02:00
Hidde Beydals 18b59351c1 Update dependencies
Azure SDK dependencies cannot be updated, as this requires us to move to
Go 1.18.

- cloud.google.com/go/storage to v1.22.0
- github.com/ProtonMail/go-crypto to v0.0.0-20220407094043-a94812496cf5
- github.com/darkowlzz/controller-check to v0.0.0-20220325122359-11f5827b7981
- github.com/elazarl/goproxy to v0.0.0-20220403042543-a53172b9392e
- github.com/fluxcd/pkg/gittestserver to v0.5.2
- github.com/go-logr/logr to v1.2.3
- github.com/minio/minio-go/v7 to v7.0.24
- github.com/onsi/gomega to v1.19.0
- golang.org/x/crypto to v0.0.0-20220411220226-7b82a4e95df4
- google.golang.org/api to v0.74.0

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-15 16:41:42 +02:00
Hidde Beydals 59df52d332 Update sigs.k8s.io/cli-utils to v0.29.4
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-15 15:47:41 +02:00
Stefan Prodan 4a7d2f5354
Merge pull request #675 from fluxcd/deps-up
Update dependencies
2022-04-15 16:35:48 +03:00
Stefan Prodan 0f64fef2a1
Update dependencies
- helm.sh/helm/v3 v3.8.2
- k8s.io/api v0.23.5
- fluxcd/pkg/runtime v0.14.1

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-04-15 10:49:31 +03:00
Paulo Gomes 7244ddd6a7
Merge pull request #674 from EdwinWalela/dev
Fix Kustomize installation broken link
2022-04-14 12:21:19 +01:00
edwinwalela 229d7ce138 fix kustomize installation broken link
Signed-off-by: edwinwalela <edwinwalela@gmail.com>
2022-04-14 13:08:07 +03:00
Paulo Gomes 2be9173db9
Merge pull request #671 from pjbgf/update-libgit2-1.3.1
Update libgit2 image to 1.3.1
2022-04-14 10:20:43 +01:00
Paulo Gomes 55e514b948
Update attributions
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-04-14 09:59:02 +01:00
Paulo Gomes 77fcc88805
Update libgit2 to 1.3.1
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-04-14 09:59:01 +01:00
Paulo Gomes 2f4a3371b2
Merge pull request #672 from EdwinWalela/dev
remove hostname hyphen split block
2022-04-14 09:50:06 +01:00
edwinwalela 9c4dfc02f2 remove hostname hyphen split block
Signed-off-by: edwinwalela <edwinwalela@gmail.com>
2022-04-14 11:11:01 +03:00
Paulo Gomes a0070ce5fe
Merge pull request #653 from peterfication/change-file-permissions-to-octal
Change all file permissions to octal format
2022-04-13 17:48:55 +01:00
Peter Gundel 37551f1964
Reduce file permission
As suggested by @pjbgf

Co-authored-by: Paulo Gomes <paulo.gomes.uk@gmail.com>

Co-authored-by: Paulo Gomes <paulo.gomes.uk@gmail.com>
Signed-off-by: Peter Gundel <mail@petergundel.de>
2022-04-13 17:14:45 +02:00
Peter Gundel 0949d0adb9
Change all file permissions to octal format
This better represent permissions as Linux handles such information in
octal format, meaning that the left-most 0 has an important meaning
and is not to be ignored as normally integers would.

See https://github.com/fluxcd/source-controller/issues/603

Signed-off-by: Peter Gundel <mail@petergundel.de>
2022-04-12 21:24:34 +02:00
Paulo Gomes fe17137c62
Merge pull request #661 from pjbgf/release-v0.23.0
Release v0.23.0
2022-04-12 12:26:16 +01:00
Paulo Gomes b750f19d19
Release v0.23.0
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-04-12 11:48:24 +01:00
Paulo Gomes 125c5bce96
Merge pull request #664 from pjbgf/rate-limit
Add flags to configure exponential back-off retry
2022-04-12 11:02:05 +01:00
Paulo Gomes 4198191759
Add flags to configure exponential back-off retry
Add two new flags to enable users to configure exponential
back-off for Flux objects. The default values are now
set to 750ms for minimum retry time, and 15min for max.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-04-12 10:44:46 +01:00
Hidde Beydals 711780cdf9
Merge pull request #663 from fluxcd/helm-safe-dir-loader 2022-04-11 12:21:49 +02:00
Hidde Beydals 9a17fd53e7 helm: attach loader to helm.MaxChartFileSize
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-11 11:47:28 +02:00
Hidde Beydals e85ea781e2 helm: switch to our own chart loader package
This includes some rewiring of tests, and slight changes in how we work
with the local chart reference. `Path` is expected to be relative to
`WorkDir`, and both fields are now mandatory.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-11 11:47:28 +02:00
Hidde Beydals b9063d7362 helm: add more test coverage for secureloader
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-11 11:47:28 +02:00
Hidde Beydals 6fc066b1b6 helm: introduce customized chart loaders
This introduces our own `secureloader` package, with a directory
loader that's capable of following symlinks while validating they stay
within a certain root boundary.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-11 09:36:14 +02:00
Hidde Beydals 5ae30cb4aa helm: drop github.com/pkg/errors
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-11 09:36:14 +02:00
Hidde Beydals 25f54ee80e sympath: provide abs path after eval symlink
This can be used to detect traversion outside of a certain path scope
while walking.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-11 09:36:14 +02:00