Commit Graph

79 Commits

Author SHA1 Message Date
Stefan Prodan 827f579b14
Update dependencies to Go 1.22 and Kubernetes 1.29.3
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-04-02 16:52:10 +03:00
Hidde Beydals ccae76f3ea
build: update Alpine to 3.19
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-12-11 09:18:21 +01:00
Stefan Prodan bfa59f5563
Update `tonistiigi/xx` to v1.3.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-11-21 10:17:12 +02:00
Stefan Prodan 2feec3198b
Build with Go 1.21
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-11-20 17:20:08 +02:00
Devin Buhl 24ed99506f
Update Alpine to 3.18
This change would be nice to get in because MUSL finally implements TCP DNS requests as a fallback.

https://www.alpinelinux.org/posts/Alpine-3.18.0-released.html

Signed-off-by: Devin Buhl <onedr0p@users.noreply.github.com>
2023-05-10 09:25:35 -04:00
Sunny e16d6ebde8 Move controllers to internal/controller
Make the controller implementations private.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-05-03 15:35:45 +05:30
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
Stefan Prodan 83a40d156b
Update Alpine to 3.17
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-01-27 16:26:47 +02:00
Paulo Gomes 5ffa6a5a68
libgit2: Remove references to libgit2 from code
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-12-12 15:34:28 +00:00
Paulo Gomes feab080f50
Remove nsswitch.conf creation
Since 11-11-2022, the alpine:3.16 includes that file on its
base image. More information can be found at:
https://git.alpinelinux.org/aports/commit/?id=348653a9ba0701e8e968b3344e72313a9ef334e4

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-11-14 17:49:31 +00:00
Paulo Gomes d25ed0c8c4
build: Bump golang-with-libgit2 to v0.4.0
The new version uses libgit2 1.5.0 and requires git2go/v34.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-10-26 14:06:14 +01:00
Paulo Gomes 1ab76264de
Bump libgit2 image to v0.3.0
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-09-29 06:55:18 +01:00
Stefan Prodan ca3496e758
Build with Go 1.19
- Update Go to 1.19 in CI
- Use Go 1.19 in base image
- Update controller-gen v0.8.0 and regenerate manifests

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-09-28 15:35:26 +03:00
Paulo Gomes f51f9d3305
Remove MUSL and enable threadless libgit2 support
Use of MUSL was a temporary solution to mitigate cross-platform
issues while building openssl and libssh2. Since Unmanaged transport has
been deprecated, openssl and libssh2 dependencies are no longer required
and by extension MUSL.

Enables libgit2 threadless support and provides a regression assurance
for fluxcd/image-automation-controller#339.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-07-31 18:38:27 +01:00
Philip Laine b47d468e8f
Upgrade to go 1.18
Signed-off-by: Philip Laine <philip.laine@gmail.com>
2022-07-27 19:02:13 +03:00
Sanskar Jaiswal bd37bc3161 build: bump tonistiigi/xx version
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-07-26 15:10:46 +05:30
Sanskar Jaiswal 536bacbea3 libgit2: upgrade to golang-with-libgit2 v0.1.4
Upgrade to golang-with-libgit2 v0.1.4 and use libgit2 which is compiled
without being linked to libssh2 and openssl.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-07-26 15:10:29 +05:30
Paulo Gomes aeaeec881e
Update libgit2 to v1.3.2
Updates golang-with-libgit2-all to v0.1.2 which contains libgit2-1.3.2.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-07-14 12:24:26 +01:00
Paulo Gomes afd02d3cfc
build: provenance and tampering checks for libgit2
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-07-13 10:10:42 +01:00
Paulo Gomes 02f5b94baf
Update to golang-with-libgit2-all image
This dependency now releases two different images, one
containing the entire dependency chain for libgit2, and
another containing just the library itself. The latter
will be later used once Managed Transport is completely
removed from source controller.

As part of this update, the image now follows a new tag
format which is semver based and starts at 0.1.0.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-07-08 09:39:06 +01:00
Stefan Prodan dca27ad850
Update Alpine to v3.16
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-05-27 10:59:41 +03: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 8429708997
Upgrade libgit2 to libgit2-1.3.0-2
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-02-16 11:39:11 +00:00
Paulo Gomes 03c56e79a0
Download libgit2 libraries for fuzzing
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-02-11 12:30:46 +00:00
Paulo Gomes fcb62eedc7
Validate LIBGIT2 args are set correctly
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-02-09 15:52:46 +00:00
Paulo Gomes 60c98b5471
Update libgit2 to 1.1.1-6
Fix issues developing in amd64, arm64 and apple silicon

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-02-07 13:00:57 +00:00
Paulo Gomes 62928217a0
Optimise cross compilation time
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-02-07 13:00:56 +00:00
Paulo Gomes 990b4a361b
Use static libraries from built image
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-02-07 13:00:55 +00:00
Paulo Gomes ac3870c80b
Pin target image to alpine:3.15
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-01-26 13:06:22 +00:00
Paulo Gomes d163ebae14
Statically build using musl toolchain and target alpine
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-01-26 12:11:49 +00:00
Stefan Prodan b992afd2c7
Publish SBOM and sign release artifacts
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-20 13:49:36 +02:00
Paulo Gomes 9ba76a1f94
Enforce runAsNonRoot
BREAKING CHANGE: the controller container is now executed under 65534:65534 (userid:groupid). This change may break deployments that hard-coded the user name 'controller' in their PodSecurityPolicy.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-01-19 14:57:26 +00:00
Paulo Gomes 7b04b44706
security: Drop capabilities and enable seccomp
Further restricts the SecurityContext that the controller runs under, by enabling the default seccomp profile and dropping all linux capabilities.
This was set at container-level to ensure backwards compatibility with
use cases in which sidecars are injected into the source-controller pod
without setting less restrictive settings.

BREAKING CHANGE: The use of new seccomp API requires Kubernetes 1.19.

Co-authored-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-01-19 14:57:25 +00:00
Paulo Gomes ec9e0f6197
Revert to controller user
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-01-13 10:16:16 +00:00
Paulo Gomes ab934579bb
Bump libgit2 dependencies to debian bookworm
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-01-13 10:16:15 +00:00
Paulo Gomes f371eb3035
Fix static build for armv7
Leverage libraries installed in base-debian11 (glibc, libssl and openssl)
therefore refrain from linking libc/libdl and ignore unresolved symbols
at build time.
Libssl had to be kept as the behaviour without it is not consistent across
all supported architectures.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-01-13 10:16:11 +00:00
Paulo Gomes 0c9078c5d1
Bump LIBGIT2_TAG to libgit2-1.1.1-2
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-01-13 10:16:09 +00:00
Paulo Gomes 97d7a6ad22
Use gcr.io/distroless/base-debian11
The statically linked binary has lingering dependencing to glibc, which
leads to errors at runtime when using distroless/static. One key culprit is libnss,
which is not available in static form through package managers.

In order to support distroless/static, glibc would have to be recompiled using
the --enable-static-nss flag, and the resulting libnss_{dns,files}.a would need
to be linked during the build process.

Due to the unnecessary complexity mentioned above, distroless/base is being used
instead.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-01-13 10:16:04 +00:00
Paulo Gomes 6ab959d6fb
Add copyright attributions
Adds an initial ATTRIBUTIONS.md file containing the open source
components that source-controller depends on, and their copyright
information.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-01-13 10:16:03 +00:00
Paulo Gomes 7f886f0bcf
Statically build source-controller into distroless image
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-01-13 10:16:02 +00:00
Aurel Canciu e3d04b31bc
Update Go to v1.17
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2021-12-20 13:11:21 +01:00
Hidde Beydals dd091a00ae build: update tonistiigi/xx to v1.1.0
https://github.com/tonistiigi/xx/releases/tag/v1.1.0

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-12-10 12:25:14 +01:00
Hidde Beydals 16320c73f1 build: update Go to 1.16.12
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-12-10 12:24:34 +01: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 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 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