Commit Graph

84 Commits

Author SHA1 Message Date
Paulo Gomes 0d3c97cc87
build: Upgrade to Go 1.18
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-07-06 17:07:13 +01:00
Paulo Gomes ecc1aae4d5
Update dependencies
- github.com/ProtonMail/go-crypto to version 0.0.0-20220623141421-5afb4c282135.
- github.com/fluxcd/source-controller to version 0.25.9.
- github.com/fluxcd/source-controller/api to version 0.25.9.
- github.com/google/go-containerregistry to version 0.10.0.
- golang.org/x/crypto to version 0.0.0-20220622213112-05595931fe9d.
- k8s.io/kube-openapi to version 0.0.0-20220627174259-011e075b9cb8.
- gopkg.in/yaml.v3 to version 3.0.1.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-06-30 10:22:04 +01:00
Sunny f8c74583ec
Update source-controller and image-reflector
Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-06-24 17:02:16 +05:30
Stefan Prodan 34413b041f
Add finalizer to ImageUpdateAutomation resources
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-06-24 11:46:33 +03:00
Paulo Gomes ec89ad41b9
Update source-controller to v0.25.7
This version of source-controller introduces a fix for the
SSH connections leak issue reported at:
https://github.com/fluxcd/image-automation-controller/issues/334

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-06-22 15:55:50 +05:30
Paulo Gomes 60ce019a73
Update github.com/fluxcd/source-controller v0.25.5
- github.com/fluxcd/source-controller to version 0.25.5.
- github.com/fluxcd/source-controller/api to version 0.25.5.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-06-08 11:41:22 +01:00
Paulo Gomes f53d1971c6
Update dependencies
- github.com/fluxcd/pkg/apis/meta to version 0.14.2.
- github.com/fluxcd/pkg/runtime to version 0.16.2.
- k8s.io/api to version 0.24.1.
- k8s.io/apimachinery to version 0.24.1.
- k8s.io/client-go to version 0.24.1.
- k8s.io/kube-openapi to version 0.0.0-20220603121420-31174f50af60.
- github.com/fluxcd/image-reflector-controller/api to version 0.19.1.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-06-08 11:19:25 +01:00
Paulo Gomes 690ec1265e
Update dependencies
- fluxcd/source-controller to v0.25.4
- fluxcd/source-controller/api to v0.25.4
- github.com/containerd/containerd to v1.6.6

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-06-07 16:42:18 +01:00
Stefan Prodan 47db3f572d
Update source-controller/api to v0.25.2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-06-03 16:42:09 +03:00
Sunny 9e560841c2
Update source-controller with libgit2 race fixes
Also, removes the panic recovery code added in cloneInto() as the
underlying Checkout() in SC already has a panic handler. The issues were
due to goroutine panicking, which are now handled in the SC libgit
managed transport.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-06-03 02:59:05 +05:30
Paulo Gomes ebc40b2d88
Fix regression on push branches
Fixes regression in which IAC will fail to update push branch
when the push branch already exists and checkout branch is
ahead.

The reconciliation errors with: 'cannot push because a reference
that you are trying to update on the remote contains commits
that are not present locally.'

Regression introduced on #330.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-06-01 21:49:04 +03:00
Paulo Gomes 1171efe37d
Update dependencies
- fluxcd/pkg/apis/meta v0.14.1
- fluxcd/pkg/runtime v0.16.1
- github.com/ProtonMail/go-crypto 0.0.0-20220517143526-88bb52951d5b
- github.com/fluxcd/pkg/gittestserver 0.5.4
- github.com/fluxcd/pkg/ssh 0.4.0
- github.com/google/go-containerregistry 0.9.0
- golang.org/x/crypto 0.0.0-20220525230936-793ad666bf5e
- sigs.k8s.io/kustomize/kyaml 0.13.7
- gopkg.in/yaml.v3 v3.0.0

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-05-26 19:34:00 +01:00
Hidde Beydals df9ecc5321 api: update dependencies
- github.com/fluxcd/pkg/apis/meta to v0.13.0
- github.com/fluxcd/source-controller/api to v0.24.4
- k8s.io/apimachinery to v0.23.6

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-05-03 18:58:06 +02:00
Paulo Gomes 1c1fb05509
Update source-controller/api to v0.24.0
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-04-19 13:01:11 +01:00
Stefan Prodan 4d04ad9668
Update dependencies
- k8s.io/* v0.23.5
- sigs.k8s.io/kustomize/kyaml v0.13.6
- github.com/google/go-containerregistry v0.8.0
- github.com/fluxcd/pkg/runtime v0.14.1

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-04-15 16:54:11 +03:00
Sunny 6d812e9e54
Update dependencies
Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-03-30 22:29:39 +05:30
Hidde Beydals e674ce0cfc Update source-controller to v0.22.2
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-03-23 20:47:47 +01:00
Hidde Beydals 629dc00776 Implement `meta.ObjectWithConditions` interfaces
Follow up on #325 to fully implement new tooling requirements. By
implementing the interfaces, the `conditions` package can now be used.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-03-22 15:24:18 +01:00
Sunny 146a86865c Use new standardized runtime and meta package
Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-03-21 12:45:55 +01:00
Stefan Prodan 72d0be7c0c
Update source-controller packages to 0.21.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-26 17:18:38 +02:00
Sanskar Jaiswal 3de51e7a1e add support for cross-namespace sourceRef in ImageUpdateAutomation
ImageUpdateAutomation objects can now refer to GitRepository objects in other
namespaces. Implemented by switching sourceRef from a SourceReference to a
dependency.CrossNamespaceDependencyReference.

Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
2022-01-25 14:21:37 +05:30
Sebastian Bernheim 447a15be23
Set default observedGeneration to -1
Sets a default value of -1 for the observedGeneration field of the
ImageUpdateAutomations type status.observedGeneration attribute.
This ensures that tools like kstatus do not consider the resource to be
in a Ready state prematurely because the generation and
observedGeneration attributes are briefly initialized with 0 values.

Signed-off-by: Sebastian Bernheim <sebastian@weave.works>
2022-01-21 17:56:08 -05:00
Aurel Canciu 24594ebf20
Update flux pkg components
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2022-01-07 16:53:29 +01:00
Aurel Canciu 8312c64e93
Update Go to v1.17
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2022-01-06 12:19:46 +01:00
Hidde Beydals 9ae9f64272 Update source-controller to v0.19.0
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-11-23 13:36:54 +01:00
Stefan Prodan 1471796252
Update controller-runtime to v0.10.2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-11-22 16:58:18 +02:00
Sunny b299a9db59 Pass context to libgit2.RemoteCallbacks
Pass cancellable context to libgit2.RemoteCallbacks to be able to cancel
the remote operations when the context is cancelled.
For git clone, fetch and push, a context is created with the timeout of
the target GitRepository.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2021-11-04 18:36:13 +05:30
Hidde Beydals fbccec2878 Bump source-controller API dependency in API
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-10-28 16:11:27 +02:00
Hidde Beydals a3e9f69bd5 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 16:27:58 +02:00
Stefan Prodan 5cf4c4a5a6
Update dependencies
- k8s.io/* v0.21.3
- controller-runtime v0.9.5
- source-controller/api v0.15.4
- image-reflector-controller/api v0.11.1

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-08-05 17:27:25 +03:00
Michael Bridgen 5b9631327f Graduate v1alpha2 API to v1beta1
This does the following:

 - copies the type definitions from v1alpha2 to v1beta1
 - changes the "stored" version to v1beta1
 - gives the CRD a conversion strategy of None, meaning just rewrite the version
 - switches the controller to use v1beta1
 - moves the generated documentation to v1beta1

This effectively rebadges the v1alpha2 version of this part of the
image API to v1beta1. The v1alpha2 version is left in place; there are
no conversion issues, as with v1alpha1->v1alpha2. The CRD specifies
that converting between v1alpha2 and v1beta1 just means changing the
version (i.e., the schema and semantics are the same).

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-06-28 11:26:59 +01:00
Stefan Prodan 8b3c4420bb
Update source-controller to v0.15.2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-06-22 15:49:10 +03:00
Hidde Beydals 1dd6eabac2 Remove duplicate declaration
To not confuse the documentation generator.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-06-10 15:04:40 +02:00
Hidde Beydals c0bcae4f8c Update dependencies
- Go 1.16
- `sigs.k8s.io/controller-runtime` to `v0.9.0`
- `fluxcd/source-controller` to `v0.14.0`
- `fluxcd/pkg/*` to packages compatible with Go 1.16 and
   controller-runtime v0.9.0

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-06-10 10:40:28 +02:00
Stefan Prodan eabcc43614
Update go-git to v5.4.2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-06-02 13:26:18 +03:00
Hidde Beydals aad03ca025 Update source-controller/api to v0.13.0
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-05-26 15:04:20 +02:00
Stefan Prodan c71ea97d62
Release v0.9.1
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-05-06 16:26:03 +03:00
Stefan Prodan 9e7111be0f
Update source-controller/api to v0.12.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-22 10:59:47 +03:00
Stefan Prodan 833b50fdee
Move to ImagePolicy v1alpha2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-22 10:03:22 +03:00
Michael Bridgen 1c33a2d45f Generate docs for v1alpha2
This switches the API doc generation from v1alpha1, to v1alpha2.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-04-13 11:01:45 +01:00
Michael Bridgen ebb2d6abea Use sourcev1.GitRepositoryRef
This changes the API so that the checkout field has a ref, the same as
GItRepository. This means you can check out a branch or a tag or a
particular commit. Most of these won't work unless you supply a branch
to push to as well.

An addtional change is that you can leave out the checkout altogether,
and the ref will default to that given in the GitRepository, or its
default. In the latter case, again you will need to provide a push
branch.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-04-13 11:01:42 +01:00
Michael Bridgen b28c5ccc04 Split author email and name into separate fields
This is a bit neater to read and write, and since I'm making breaking
changes anyway.

The name is now optional; an email is enough.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-04-13 10:50:01 +01:00
Michael Bridgen cd8a2e97b8 Flip the controller and tests to API v1alpha2
This finishes the v1alpha2 API, and rewrites everything needed so that
the controller supports it and the tests pass. For the most part, that
is just changing the location of fields. However, there's a few
notable extras:

 - check that the `sourceRef` is a git repo (that's the default), and
   that a `.spec.git` is supplied;

 - change a test that blindly patched an update object, so that it
   first gets the object it's patching. Previously, it succeeded
   because it was OK to patch everything to empty strings, but that's
   no longer the case since SourceReference.Kind is an enum.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-04-13 10:45:58 +01:00
Michael Bridgen f28a0c40ff Add v1alpha2 API version
This adds a v1alpha2 API, without changing the controller or tests to
use it (yet). The new API has roughly the desired shape, per
https://github.com/fluxcd/flux2/discussions/1124, but supporting only
things that the controller supports now.

It's necessary to give the v1alpha1 type a `storageversion` marker so
that 1. code generation keeps working, and 2. tests still work, since
they still expect v1alphav1 types. v1alpha1 will be removed once the
controller and tests are ported to v1alpha2.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-04-13 10:30:51 +01:00
LWJ d1cfabf793 Fix nil pointer dereference and minor refactor
Signed-off-by: LWJ <lwjames1996@gmail.com>
2021-03-29 18:16:37 +01:00
LWJ b668e99a91 SigningKey modifications to align process with SOPS
Signed-off-by: LWJ <lwjames1996@gmail.com>
2021-03-24 21:54:31 +00:00
LWJ 4aa56f1013 Add SigningKey to CommitSpec
Signed-off-by: LWJ <lwjames1996@gmail.com>
2021-03-24 21:54:31 +00:00
Stefan Prodan 2e53745a03
Allow specifying the path for manifests updates
- Add optional `path` field to `spec.update`, defaults to the git repo root
- Restrict updates to the specified `spec.update.path`

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-16 11:58:21 +02:00
Stefan Prodan 4661519e64
Update dependencies
- sigs.k8s.io/kustomize/kyaml v0.10.15
- sigs.k8s.io/controller-runtime v0.8.2

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-12 12:07:27 +02:00
Michael Bridgen 97c7510d2e Add PushSpec to image update automation type
Signed-off-by: Michael Bridgen <michael@weave.works>
2021-03-04 17:35:58 +00:00