Commit Graph

1934 Commits

Author SHA1 Message Date
Sanskar Jaiswal d32470ee95 gitrepo: use absolute refs when ref name is provided
Use `commit.AbsoluteReference()` to show the full reference when
`.spec.ref.name` is provided. For eg: `refs/heads/main@sha1:<SHA>`.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2023-03-02 16:52:43 +01:00
Hidde Beydals 5b2321f946
Merge pull request #1040 from fluxcd/update-go-1.20
Update Go to 1.20
2023-03-02 16:44:55 +01:00
Hidde Beydals 9509b62f40
helm/repository: address invalid test
Common mistake
(https://github.com/golang/go/wiki/CommonMistakes#using-goroutines-on-loop-iterator-variables),
but due to update now properly found by `go vet`.

In addition to making the test cases work in general.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-02 16:14:01 +01:00
Hidde Beydals 459f266dd2
Update tonistiigi/xx to 1.2.1
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-02 15:22:30 +01:00
Hidde Beydals 8dd9d2d7e8
Update Go to 1.20
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-02 15:20:36 +01:00
Hidde Beydals 3e0d08132c
Merge pull request #1038 from fluxcd/release-v0.35.2
Release v0.35.2
2023-02-23 13:25:34 +01:00
Hidde Beydals 70a44bd187 Release v0.35.2
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-23 12:55:48 +01:00
Hidde Beydals 9982dba4d5
Merge pull request #1037 from fluxcd/update-deps
Update dependencies
2023-02-23 12:43:41 +01:00
Hidde Beydals ba91b6ddf8 api: update dependencies
- golang.org/x/next to v0.7.0
- golang.org/x/text to v0.7.0

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-23 12:24:00 +01:00
Hidde Beydals 371025b197 Update dependencies
- github.com/distribution/distribution/v3 to v3.0.0-20230223072852-e5d5810851d1
- github.com/fluxcd/pkg/oci to v0.20.0
- github.com/fluxcd/pkg/sourceignore to v0.3.2
- github.com/google/go-containerregistry/pkg/authn/k8schain to v0.0.0-20230217043738-4a0e0af4bf95
- github.com/minio/minio-go/v7 to v7.0.49
- github.com/onsi/gomega to v1.27.1
- github.com/sigstore/sigstore to v1.5.2
- k8s.io/utils to v0.0.0-20230220204549-a5ecb0141aa5

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-23 12:05:40 +01:00
Hidde Beydals b951cbb621
Merge pull request #1035 from fluxcd/helm-index-digest-rev
helm: only use Digest to calculcate index revision
2023-02-23 11:29:36 +01:00
Hidde Beydals c712fede57 internal/helm: del deprecated ChartRepo#Revision
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-22 23:35:21 +01:00
Hidde Beydals 76c4bb78bd helmrepo: only log recovery msg on actual recovery
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-22 23:35:21 +01:00
Hidde Beydals c0a1099719 helm: only use Digest to calculcate index revision
In #1001 bits around the Helm repository reconciliation logic were
rewritten, mostly based on the documented behavior instead of the
actual code. This resulted in the reintroduction of a YAML marshal of
the (sorted) index YAML instead of reliance of just the checksum of the
file.

This to take situations into account in which a repository would e.g.
provide a new random order on every generation. However, this approach
is (extremely) expensive as the marshal goes through a JSON -> YAML
loop, eating lots of RAM in the process.

As the further (silently) introduced behavior has not resulted in any
reported issues, I deem this approach safe and better than e.g.
encoding to just JSON which would still require a substantial amount of
memory.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-22 23:33:59 +01:00
Hidde Beydals 568b9324ce
Merge pull request #1033 from fluxcd/set-output-deprecation
build: convert ::set-output to $GITHUB_OUTPUT
2023-02-20 11:25:52 +01:00
Hidde Beydals 7ee3c2c3e9 build: convert ::set-output to $GITHUB_OUTPUT
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-17 14:10:19 +01:00
Hidde Beydals 514b2b86ef
Merge pull request #1032 from fluxcd/release-v0.35.1
Release v0.35.1
2023-02-17 09:16:18 +01:00
Hidde Beydals 1a648232a4 Release v0.35.1
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-17 00:01:31 +01:00
Hidde Beydals 7abdb55682
Merge pull request #1031 from fluxcd/omitempty-digest
api: omit empty Digest in Artifact
2023-02-16 22:52:03 +01:00
Hidde Beydals 440f1d599c api: omit empty Digest in Artifact
While we initially decided against it, this otherwise causes the regexp
validator to error on an empty field when it goes through a YAML -> JSON
encode loop (even when marked with `+optional`).

This is not actually a viable path the controller could take, as the
controller trying to update the Artifact with an older version of the
API package would omit the `Digest` field (because it does not exist
in that version), while a newer version of the controller would always
include the field (because we produce it for all kinds). While in cases
where the controller would be backed by a Persistent Volume (and a
partial status update is made), the validation rule would not be
triggered because the field is not part of the patch.

However, for sake of correctness, we still issue a patch.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-16 21:57:03 +01:00
Hidde Beydals 0f91a3298d
Merge pull request #1029 from fluxcd/release-v0.35.0
Release v0.35.0
2023-02-16 16:45:36 +01:00
Hidde Beydals a99a34005a Release v0.35.0
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-16 16:18:07 +01:00
Hidde Beydals b30096e37d
Merge pull request #1030 from fluxcd/dependabot/go_modules/github.com/containerd/containerd-1.6.18
build(deps): bump github.com/containerd/containerd from 1.6.15 to 1.6.18
2023-02-16 16:07:35 +01:00
dependabot[bot] 93acd4abec
build(deps): bump github.com/containerd/containerd from 1.6.15 to 1.6.18
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.6.15 to 1.6.18.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.6.15...v1.6.18)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-16 14:28:26 +00:00
Hidde Beydals 9cb04d29be
Merge pull request #1026 from aryan9600/git-refname
add support for checking out to Git refs
2023-02-16 13:21:20 +01:00
Sanskar Jaiswal c3511cc834 add support for checking out to Git refs
Add a new field `.spec.ref.name` which points to a Git reference which
enables checking out to a particular commit pointed to by the specified
reference.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2023-02-16 17:33:11 +05:30
Hidde Beydals 1de3b13562
Merge pull request #1028 from fluxcd/update-deps
Update dependencies
2023-02-16 12:37:55 +01:00
Hidde Beydals a640dcb971 Update dependencies
- github.com/distribution/distribution/v3 to v3.0.0-20230214150026-36d8c594d7aa
- github.com/fluxcd/pkg/git to v0.10.0
- github.com/fluxcd/pkg/git/gogit to v0.7.1
- github.com/fluxcd/pkg/gittestserver to v0.8.1
- github.com/fluxcd/pkg/helmtestserver to v0.11.1
- github.com/fluxcd/pkg/oci to v0.19.1
- github.com/fluxcd/pkg/runtime to v0.29.0
- github.com/fluxcd/pkg/sourceignore to v0.3.1
- github.com/fluxcd/pkg/ssh to v0.7.1
- github.com/fluxcd/pkg/version to v0.2.1

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-16 12:18:41 +01:00
Hidde Beydals 7fe19031d7
Merge pull request #1015 from somtochiama/helm-repo-url
Fix: Normalize helm repository url with query params properly
2023-02-15 15:45:47 +01:00
Somtochi Onyekwere 6f0384c50e Normalize path in url
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-02-15 03:54:18 +01:00
Hidde Beydals a8fc26c2a5
Merge pull request #1025 from fluxcd/update-deps
Update dependencies
2023-02-14 17:23:27 +01:00
Hidde Beydals c10f2132d3 crds: update with controller-gen v0.11.1
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-14 16:17:48 +01:00
Hidde Beydals 714842e770 Update controller API build tooling
- Update both to their latest versions
- Ensure version variable is actually taken into account again...

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-14 16:05:26 +01:00
Hidde Beydals ecd2544bbe Update dependencies
- github.com/Azure/azure-sdk-for-go/sdk/azcore to v1.3.1
- github.com/Azure/azure-sdk-for-go/sdk/storage/azblob to v1.0.0
- helm.sh/helm/v3 v3.11.1
- k8s.io/utils v0.0.0-20230209194617-a36077c30491
- sigs.k8s.io/controller-runtime v0.14.4
- github.com/distribution/distribution/v3 to v3.0.0-20230131081513-cf87e8d07e8d
- github.com/docker/cli to v23.0.1+incompatible
- github.com/fluxcd/pkg/oci to v0.19.0
- github.com/google/go-containerregistry/pkg/authn/k8schain to v0.0.0-20230209165335-3624968304fd
- github.com/minio/minio-go/v7 to v7.0.48
- google.golang.org/api to v0.110.0
- helm.sh/helm/v3 to v3.11.1
- k8s.io/utils to v0.0.0-20230209194617-a36077c30491
- sigs.k8s.io/controller-runtime to v0.14.4

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-14 16:04:44 +01:00
Hidde Beydals c4d6b70ccd api: update dependencies
- sigs.k8s.io/controller-runtime to v0.14.4
- Unpin golang.org/x/text from v0.4.0

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-14 16:04:44 +01:00
Hidde Beydals 2bd0b41da6
Merge pull request #1020 from fluxcd/default-mode-archive-files
Apply default permission mode to all files/dirs in an artifact archive
2023-02-14 15:19:23 +01:00
Max Jonas Werner bfa61d9ed0 Apply default permission mode to all files/dirs in an artifact archive
Files: 0644
Directories: 0755

closes #1019

Signed-off-by: Max Jonas Werner <max@e13.dev>
2023-02-14 14:44:25 +01:00
Hidde Beydals e24ce868d1
Merge pull request #1001 from fluxcd/artifact-digest
RFC-0005: introduction of Digest and change of Revision format
2023-02-14 14:42:21 +01:00
Hidde Beydals 9283894bbe Use MetaDigestKey from event API
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-14 12:48:36 +01:00
Hidde Beydals f53bfd1dc1 Use Artifact.Path for HelmRepository index cache
Resolving it to a local path does not make it more unique, while
resulting in longer keys and a lot of safejoin calls.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-14 12:48:36 +01:00
Hidde Beydals d62f4dc0c6 misc: order imports and align digest aliases
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-14 12:48:36 +01:00
Hidde Beydals eb4a38e421 spec: show RFC-0005 format and digest in examples
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-14 12:48:36 +01:00
Hidde Beydals ccad35971c Allow config using `--artifact-digest-algo`
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-14 12:48:36 +01:00
Hidde Beydals 0aaeeee5e9 controllers: RFC-0005 fmt for HelmRepository rev
This includes changes to the `ChartRepository`, to allow calculating
the revision and digest and tidy things.

In addition, the responsibility of caching the `IndexFile` has been
moved to the reconcilers. As this allowed to remove a lot of
complexities within the `ChartRepository`, and prevented passing on
the cache in general.

Change `HelmRepository`'s Revision to digest

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-14 12:48:36 +01:00
Hidde Beydals f00aeae09a controllers: use TransformLegacyRevision helper
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-14 12:48:36 +01:00
Hidde Beydals eaa4a4ff31 api: introduce TransformLegacyRevision helper
This allows consumers to better handle the transition to the new
RFC-0005 format ("/" -> "@" separation).

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-14 12:48:36 +01:00
Hidde Beydals 469c9387ee controllers: make OCIRepository compat with RFC-0005
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-14 12:48:36 +01:00
Hidde Beydals 909ece4092 helm: use digest lib for checksum calculation
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-14 12:48:36 +01:00
Hidde Beydals b89b049bf1 controllers: make HelmChart compat with RFC-0005
This ensures the revision is correctly parsed for `Bucket` and
`GitRepository` sources from which a chart is built, either in the
legacy or new RFC-0005 format.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-14 12:48:36 +01:00
Hidde Beydals fe8bc43f84 controllers: use RFC-0005 format for Git revision
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-14 12:48:36 +01:00