Commit Graph

1036 Commits

Author SHA1 Message Date
Hidde Beydals 869c7960e3 Update github.com/libgit2/git2go to v31.6.1
This commit updates `github.com/libgit2/git2go` to `v31.6.1` (with
`libgit2` `1.1.1`), and changes the container image build process so
that it makes use of `ghcr.io/hiddeco/golang-with-libgit2`.

This image provides a pre-build dynamic `libgit2` dependency linked
against OpenSSL and LibSSH2 (without gcrypt), and a set of cross-compile
build tools (see
[rationale](https://github.com/hiddeco/golang-with-libgit2#rationale) and
[usage](https://github.co/hiddeco/golang-with-libgit2#usage) for more
detailed information).

The linked set of dependency should solve most known issues around
unsupport private key types, but does not resolve the issues with ECDSA*
and ED25519 hostkeys yet. Solving this requires a newer version of
`libgit2` (`>=1.2.0`), which currently does not seem to work properly
with `git2go/v32`.

Some small changes have been made to the `libgit2` package to address
(future) deprecations.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-10-14 13:48:15 -05:00
pa250194 f797fbfdf0 Added Logger to closing GCP client
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-10-14 09:52:11 -05:00
pa250194 f62571bcec Added log for GCP provider auth error
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-10-14 09:41:19 -05:00
pa250194 0c0a76d7fa Merge branch 'gcp-bucket-provider' of https://github.com/pa250194/source-controller into gcp-bucket-provider 2021-10-14 09:39:14 -05:00
pa250194 116906cca4 Fixed spelling and capitalization
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-10-14 10:16:53 +01:00
pa250194 751243ce50 Refactor comments and method names
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-10-14 10:16:11 +01:00
pa250194 02102de2c7 Removed resumable downloads
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-10-14 10:16:11 +01:00
pa250194 57ef719f74 Updated docs to include GCP provider instructions
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-10-14 10:16:11 +01:00
pa250194 b02a7625ea Added more tests and cleaned up GCP provider logic
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-10-14 10:16:11 +01:00
pa250194 a46b0f54b8 Added Tests to GCP provider
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-10-14 10:16:11 +01:00
pa250194 1fae4f61c1 Tests for GCP Bucket Provider
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-10-14 10:16:11 +01:00
pa250194 57b54c8592 Service Account Key Authentication to GCP Provider
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-10-14 10:16:11 +01:00
pa250194 2cc48fefb1 Added initial testing for new GCP provider
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-10-14 10:16:11 +01:00
pa250194 a600528729 Added Comments for reconcileWithGCP and reconcileWithMinio
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-10-14 10:16:11 +01:00
pa250194 572eed74e5 Add Support for GCP storage with workload identity
Added Support for Google Cloud Storage with Workload Identity as
Source Provider. This enables the use of GCP without enabling S3
compatible access.

Signed-off-by: pa250194 <pa250194@ncr.com>
2021-10-14 10:16:11 +01:00
pa250194 69fffa0d27 Fixed spelling and capitalization
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-10-12 11:50:06 -05:00
pa250194 911ecc64b8 Update go.sum
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-10-11 08:30:25 -05:00
Joe Alagoa ad65ddd830
Merge branch 'main' into gcp-bucket-provider 2021-10-08 17:34:38 -05:00
Hidde Beydals d9f19a83ef
Merge pull request #449 from fluxcd/libgit2-1.1.1-1
Update fluxcd/golang-with-libgit2 to 1.1.1-1
2021-10-08 16:33:27 +02:00
Hidde Beydals 2ffd15a548 Update fluxcd/golang-with-libgit2 to 1.1.1-1
This includes a tiny fix for Darwin to ensure the generated `.pc`
file includes the right paths.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-10-08 15:50:55 +02:00
Hidde Beydals 6cf20fb721
Merge pull request #448 from fluxcd/fix-api-docs
Fix generation of API documentation
2021-10-08 13:36:05 +02:00
Hidde Beydals 4a4c7e5cb3 Fix generation of API documentation
The version was accidentally set to an invalid version, causing the
API documentation generation to fail.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-10-08 13:15:17 +02:00
Hidde Beydals 64f0cf06c5
Merge pull request #447 from fluxcd/release-v0.16.0
Release v0.16.0
2021-10-08 12:18:43 +02:00
Hidde Beydals 7cc6124a4e Release v0.16.0
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-10-08 12:00:03 +02:00
Hidde Beydals d382eca383
Merge pull request #308 from arbourd/ignore-version
Add reconcile strategy for HelmCharts
2021-10-08 11:31:55 +02:00
Dylan Arbour 27c385b957 Add ReconcileStrategy to HelmChart
This commit adds a `ReconcileStrategy` field to the `HelmChart` resource, which
allows defining when a new chart should be packaged and/or published if it
originates from a `Bucket` or `GitRepository` resource.

The two available strategies are:

- `ChartVersion`: creates a new artifact when the version of the Helm chart as
  defined in the `Chart.yaml` from the Source is different from the current
  version.
- `Revision`: creates a new artifact when the revision of the Source is
  different from the current revision.

For the `Revision` strategy, the (checksum part of the) revision of the
artifact the chart originatesfrom is added as SemVer metadata.

A chart from a `GitRepository` with Artifact revision
`main/f0faacd5164a875ebdbd9e3fab778f49c5aadbbc` and a chart with e.g. SemVer
`0.1.0` will be published as `0.1.0+f0faacd5164a875ebdbd9e3fab778f49c5aadbbc`.

A chart from a `Bucket` with Artifact revision
`f0faacd5164a875ebdbd9e3fab778f49c5aadbbc` and a chart with e.g. SemVer `0.1.0`
will be published as `0.1.0+f0faacd5164a875ebdbd9e3fab778f49c5aadbbc`.

Signed-off-by: Dylan Arbour <arbourd@users.noreply.github.com>
2021-10-08 11:07:11 +02:00
Stefan Prodan c4cc0a7ccf
Merge pull request #446 from fluxcd/oci-cve-fix
Update containerd and runc to fix CVEs
2021-10-08 11:46:05 +03:00
Stefan Prodan 66f54ac422
Update containerd and runc to fix CVEs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-08 11:22:44 +03:00
Hidde Beydals eb167bc68d
Merge pull request #437 from fluxcd/update-libgit2
Update github.com/libgit2/git2go to v31.6.1
2021-10-08 10:04:23 +02:00
Hidde Beydals fa9a2d8512 CONTRIBUTING: include pkg-config as macOS dep
As this isn't available on Darwin by default, unlike on most Linux
distributions.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-10-08 09:40:02 +02:00
Hidde Beydals a871e0b527 Update Dockerfile used in tests as well
This ensures the Dockerfile used for testing is making use of the
same scratch image to compile `libgit2` as the actual application
image.

In a future iteration we should restructure our GitHub Action
workflows to re-use the application image, saving us an additional
Dockerfile and a duplicate build. Inspiration for this (which makes
use of a local registry for the duration of the build) can be found
at: https://github.com/fluxcd/golang-with-libgit2/blob/main/.github/workflows/build.yaml

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-10-08 09:38:20 +02:00
Hidde Beydals 9fd16d8e45 Switch to scratch based libgit2 container image
This moves the `libgit2` compilation to the image, to ensure it
can be build on builders that aren't backed by AMD64.

The image is structured in such a way that e.g. running nightly
builds targeting a different Go version, or targeting a different
OS vendor would be possible in the future via build arguments.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-10-08 09:38:20 +02:00
Hidde Beydals b87448864a Document libgit2 build behavior in CONTRIBUTING.md
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-10-04 15:36:43 +02:00
Hidde Beydals 029617cb49 Detect macOS produced libgit2.dylib on Darwin
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-10-04 15:36:43 +02:00
Hidde Beydals a5a90fd4f6 Allow libgit2 build to be enforced
This can be useful on machines where libgit2 is installed due to other
applications depending on it, but where the composition of this
installation does not properly work with the controller.

Reason the system version is still preferred, is because this lowers the
barrier for drive-by contributors, as a working set of (Git) dependencies
should only really be required if you are going to perform work in that
domain.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-10-04 15:36:43 +02:00
Hidde Beydals 981d91e363 Update base image to version with Darwin detection
To provide a better (contributing) experience to those with Apple
machines, as determining the correct paths there is a bit harder.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-10-01 19:08:59 +02:00
Hidde Beydals 0358ebc43d Change image to image under Flux organization
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-09-30 16:37:05 +02:00
Hidde Beydals 7a212b6570 Add `docker-buildx` target to `Makefile`
To allow building a multi-platform container image using `buildx`.

Various configuration flags allow for fine(r)-grain control over the
build process:

- `BASE_IMG`: FQDN of the base image that should be used, without a
  tag.
- `BASE_TAG: tag of the base image that should be used. Allows checksum
  sum to be included.
- `BUILDX_PLATFORMS`: platforms to target for the final container
  image.
- `BUILDX_ARGS`: additional `docker buildx build` arguments, e.g.
  `--push` to push the result to a (local) image registry.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-09-30 16:37:05 +02:00
Hidde Beydals d3c27c37f8 Update github.com/libgit2/git2go to v31.6.1
This commit updates `github.com/libgit2/git2go` to `v31.6.1` (with
`libgit2` `1.1.1`), and changes the container image build process so
that it makes use of `ghcr.io/hiddeco/golang-with-libgit2`.

This image provides a pre-build dynamic `libgit2` dependency linked
against OpenSSL and LibSSH2 (without gcrypt), and a set of cross-compile
build tools (see
[rationale](https://github.com/hiddeco/golang-with-libgit2#rationale) and
[usage](https://github.co/hiddeco/golang-with-libgit2#usage) for more
detailed information).

The linked set of dependency should solve most known issues around
unsupport private key types, but does not resolve the issues with ECDSA*
and ED25519 hostkeys yet. Solving this requires a newer version of
`libgit2` (`>=1.2.0`), which currently does not seem to work properly
with `git2go/v32`.

Some small changes have been made to the `libgit2` package to address
(future) deprecations.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-09-30 16:36:20 +02:00
pa250194 7c0d4c070e Refactor comments and method names
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-09-23 13:43:08 -05:00
pa250194 38be5ed111 Cleanup obsolete comments
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-09-23 12:40:55 -05:00
pa250194 057c65e939 Removed resumable downloads
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-09-23 12:39:00 -05:00
pa250194 0b971511ad Revert change to doc/api/source.md
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-09-16 12:30:58 -05:00
pa250194 a6be9c8a21 Updated docs to include GCP provider instructions
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-09-16 12:16:17 -05:00
pa250194 fa8c4ca096 Fix nil pointer dereference
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-09-16 09:57:27 -05:00
pa250194 6ff5970fe1 Added more tests and cleaned up GCP provider logic
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-09-16 09:49:56 -05:00
pa250194 c204f6a8ee Added Tests to GCP provider
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-09-16 09:49:56 -05:00
pa250194 eeb38bdf2c Tests for GCP Bucket Provider
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-09-16 09:49:56 -05:00
pa250194 0444c6e16d Service Account Key Authentication to GCP Provider
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-09-16 09:49:56 -05:00
pa250194 90395f426a Remove .DS_STORE file
Signed-off-by: pa250194 <pa250194@ncr.com>
2021-09-16 09:49:56 -05:00