Commit Graph

79 Commits

Author SHA1 Message Date
Hidde Beydals c7e7b61e34 Use libgit2 from "unstable" / "sid"
We received reports from users no longer being able to clone Git
repositories using libgit2 because of errors during the cloning
attempt: `error: Failed to authenticate SSH session: Unable to extract
public key from private key.`

After an extensive scavenger hunt I was able to pinpoint the issue to
`libssh2` being linked against `libgcrypt` instead of `openssl`. The
problem with this is that the libgcrypt backend in libssh2 contains
a hand written slimmed down ASN.1 parser to read out keys, while the
OpenSSL backend in libssh2 uses OpenSSL, which supports a lot more
formats (and more specifically, most PKCS* formats).

As Debian's bullseye/testing repository has been frozen, and a
backport has not been made available yet, fetching the dependency from
"unstable" seems to be the best option for now, as this has `libssh2`
available including OpenSSL.

Ref: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=668271

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-06-22 13:00:16 +02:00
Hidde Beydals 7e6b88e91c Use Debian instead of Alpine in container image
This commit changes the base image for the build and controller
container images to Debian slim.

Reason for this is that it has proven to be hard to produce working
executables for AMD64, ARM64 and ARMv7 at all times using Alpine,
due to them being dynamically linked and compiled using CGO, and
Alpine having constraints like musl that create an extra barrier,
especially in combination with our exotic set of dependency
constraints.

There are a number of trade-offs we have to live with by doing this,
not limited to:

* An increased build time, the full release pipeline used to take 25-35
  minutes, based on the images we have build for testing purposes this
  seems to have become 35-40 minutes.
* An increased image size of roughly two times the (compressed) size of
  the Alpine based image.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-06-17 16:12:33 +02:00
Hidde Beydals 827509e10f Use `binutils-gold` in builder image
There seems to have been a change in the dependencies that now causes
ARMv7 builds to fail:

```
    sigs.k8s.io/kustomize/kyaml/yaml/merge3=$WORK/b742/_pkg_.a
    sigs.k8s.io/kustomize/kyaml/yaml/internal/k8sgen/pkg/util/errors=$WORK/b678/_pkg_.a
    -importcfg $WORK/b001/importcfg.link -buildmode=exe
-buildid=YHfd11eGufJ7RVGSGz2z/H9JgY3lbjsdhQ8_r06Gz/HiYQEtSgCAIHJ7rrNYN6/YHfd11eGufJ7RVGSGz2z
-extld=gcc $WORK/b001/_pkg_.a
    exit status 1
    -c CGO_ENABLED=1 go build -x -o source-controller main.go]: exit
code: 2
```

After trying various things, including downgrading Go, using
packages from `edge`, using `gcc-go` to get a "grouped" version of
the dependencies, it seems that using `binutils-gold` solves the issue
and produces a working build for all our target architectures.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-06-09 12:59:20 +02:00
Hidde Beydals d3bcc6a66b Update Go to 1.16
This commit updates Go to 1.16, a required change because of the use of
`os.WriteFile` in one of the tests introduced by commit
b5004a93bc.

Normally _just_ this would not justify the change, but given the
introduction of breaking changes (and thereby forcing a MINOR update
anyway), and the various file{system, path} improvements introduced in
Go 1.16 like
[`filepath#WalkDir`](https://golang.org/pkg/path/filepath/#WalkDir),
going ahead with this should be fine.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-13 16:35:41 +02:00
Hidde Beydals 15ecae636a Use musl and libgit2 packages from v3.13 branch
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-10 22:28:14 +01:00
Stefan Prodan 9764598125
Update Alpine to v3.13
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-07 18:53:39 +02:00
Stefan Prodan a24cabb4b9
Fix controller group in Alpine
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-07 18:47:52 +02:00
Philip Laine be5f4cb206 Add newer musl version to second image layer
Signed-off-by: Philip Laine <philip.laine@gmail.com>
2020-12-12 13:11:48 +01:00
Hidde Beydals 3feda81109 Tweak `musl` and `libgit2{-dev}` dependencies
* Use semver tidles to deal with future patch releases
* Install just `libgit2` in runtime container
* Add TODO / explanation for `musl` `1.2.x` dependency

Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-12-10 00:05:58 +01:00
Philip Laine 7945f95180 Install musl edge version
Signed-off-by: Philip Laine <philip.laine@gmail.com>
2020-12-10 00:05:50 +01:00
Hidde Beydals 38e2e58c54 Use semver tidle range for `libgit2-dev` package
Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-12-09 17:00:17 +01:00
Philip Laine 2cb3754953 Add support for gitv2 servers
Signed-off-by: Philip Laine <philip.laine@xenit.se>
2020-12-02 20:18:29 +01:00
stefanprodan f16e5f041a Promote API to v1beta1 2020-09-30 16:11:00 +03:00
stefanprodan d927a1e4aa Publish amd64/arm64 images to GHCR 2020-09-04 13:41:50 +03:00
stefanprodan 4e243ca4de Add minimal nsswitch.conf 2020-08-31 15:21:48 +03:00
Hidde Beydals b75d613f3a Make api package dedicated module
As other controllers depend on source-controller because of the API
package, but this pulls in obsolete dependencies for the controllers.
By publishing the API package as a dedicated module while
using a (local) replace for the project itself, this should be
prevented.
2020-08-17 17:20:11 +02:00
stefanprodan e65e2f0623 Make git package public 2020-07-20 13:10:18 +03:00
stefanprodan 7e2fe14efa Upgrade CRDs to apiextensions.k8s.io/v1 2020-07-20 12:21:34 +03:00
stefanprodan af2cb9c23e Release v0.0.1-beta.2 2020-06-10 11:09:36 +03:00
Hidde Beydals 9498e7dba4 Remove all obsolete packages from Docker image 2020-06-06 19:15:58 +02:00
Hidde Beydals 9ad75d6e52 Remove tar from Docker image 2020-06-06 19:15:57 +02:00
Hidde Beydals 078d0057a8 build: drop openssh-client 2020-05-03 23:07:27 +02:00
stefanprodan 62d3469ce1 build: install tar package 2020-04-28 20:18:58 +03:00
stefanprodan 4b465563b4 build: run controller as a non-root user 2020-04-24 10:14:45 +03:00
stefanprodan 131b9b8e33 Lock artifact on helm index download
- cleanup locks with GC
2020-04-10 16:45:23 +03:00
Hidde Beydals 4d30a82ef4 Rename project to source-controller 2020-04-08 16:12:17 +03:00
stefanprodan 98901f2909 Expose git artifacts inside the cluster 2020-04-07 10:49:57 +03:00
stefanprodan d2b0653c34 Setup build and deploy manifests 2020-04-06 20:37:53 +03:00
stefanprodan 92b7b1fe43 Scaffold repository controllers 2020-04-05 12:34:29 +03:00