Commit Graph

1139 Commits

Author SHA1 Message Date
Sunny a0ea2481bb Add gomega matcher for artifact
Signed-off-by: Sunny <darkowlzz@protonmail.com>

Co-authored-by: Hidde Beydals <hello@hidde.co>
2022-02-15 15:40:57 +05:30
Sunny 83bea36618 Move Artifact conditions to conditions
Also, introduce FetchFailedCondition for generic fetch failures.

Signed-off-by: Sunny <darkowlzz@protonmail.com>

Co-authored-by: Hidde Beydals <hello@hidde.co>
2022-02-15 15:40:57 +05:30
Sunny 378affcba8 Use new events and metrics helpers in main.go
Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-02-15 15:40:57 +05:30
Sunny 59de336929 source: Add `GetRequeueAfter`
The problem with `GetInterval()` was that the returned type was of
`metav1.Duration`, while almost anywhere it was used, a type of
`time.Duration` was requested. The result of this was that we had to
call `GetInterval().Duration` all the time, which would become a bit
cumbersome after awhile.

To prevent this, we introduce a new `GetRequeueAfter() time.Duration`
method, which both results the right type, and bears a name that is
easier to remember where the value is used most; while setting the
`Result.RequeueAfter` during reconcile operations.

The introduction of this method deprecates `GetInterval()`, which
should be removed in a future MINOR release.

Signed-off-by: Sunny <darkowlzz@protonmail.com>

Co-authored-by: Hidde Beydals <hello@hidde.co>
2022-02-15 15:40:57 +05:30
Hidde Beydals 6bf1385e4c Introduce `artifactSet` to replace `hasArtifactUpdated`
NOTE: Remove `hasArtifactUpdated` in the future once it's no longer
used.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-02-15 15:40:57 +05:30
Hidde Beydals 6ee2b95345 Implement new runtime interfaces, prepare testenv
This commit ensures all API objects implement the interfaces used by
the runtime package to work with conditions, etc., and prepares the
test suite to work with the `pkg/runtime/testenv` wrapper.

Changes are made in a backwards compatible way (that being: the
existing code can still be build and works as expected), but without
proper dependency boundaries. The result of this is that the API
package temporary depends on the runtime package, which is resolved
when all reconcilers have been refactored and the API package does
no longer contain condition modifying functions.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-02-15 15:40:57 +05:30
Hidde Beydals 7788cac642 Introduce more explicit Condition types
This commit introduces new Condition types to the v1beta1 API,
facilitating easier observation of (potentially) problematic state for
end-users.

- `ArtifactUnavailableCondition`: indicates there is no artifact
  available for the resource. This Condition should be set by the
  reconciler as soon as it observes the absence of an artifact for a
  source.
- `CheckoutFailedCondition`: indicates a transient or persistent
  checkout failure. This Condition should be set by the reconciler as
  soon as it observes a Git checkout failure, including any
  prerequisites like the unavailability of the referenced Secret used
  for authentication. It should be deleted as soon as a successful
  checkout has been observed again.
- `SourceVerifiedCondition`: indicates the integrity of the source has
  been verified. The Condition should be set to True or False by the
  reconciler based on the result of the integrity check.
  If there is no verification mode and/or secret configured, the
  Condition should be removed.
- `IncludeUnavailableCondition`: indicates one of the referenced
  includes is not available. This Condition should for example be set
  by the reconciler when the include does not exist, or does not have
  an artifact. If the includes become available, it should be deleted.
- `ArtifactOutdatedCondition`: indicates the current artifact of the
  source is outdated. This Condition should for example be set by the
  reconciler when it notices there is a newer revision for an artifact,
  or the previously included artifacts differ from the current available
  ones. The Condition should be removed after writing a new artifact
  to the storage.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-02-15 15:40:57 +05:30
Hidde Beydals 78a63acd55 Switch to v1beta2 API package
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-02-15 15:40:57 +05:30
Sunny 0aa660b75a Introduce v1beta2 API package
This commit introduces a v1beta2 API package for the staged breaking
changes around conditions and general usage of the API objects.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-02-15 15:40:57 +05:30
Sunny 69ae21be63
Merge pull request #579 from fluxcd/git-commit-msg-url
pkg/git: Include commit message and URL in checkout error
2022-02-14 21:57:21 +05:30
Sunny 649d33ca37
pkg/git: Include commit message and URL in error
go-git: Include the commit message in the returned commit object.
libgit2: Set the URL in the checkout error.

Add new method Commit.ShortMessage() for returning short commit
message.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-02-14 21:34:27 +05:30
Hidde Beydals af0226b90c
Merge pull request #577 from pjbgf/fix-fuzz 2022-02-14 15:46:18 +01: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
Stefan Prodan 3fc70ff658
Merge pull request #574 from pjbgf/fix-push
Validate LIBGIT2 args are set correctly
2022-02-09 18:55:37 +02: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
Hidde Beydals 657f80bf6c
Merge pull request #572 from pjbgf/new-fuzz 2022-02-09 11:39:55 +01:00
Paulo Gomes cd6d33c101
Increase gingko timeout to 60s
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-02-08 17:49:51 +00:00
Paulo Gomes d8da814d2e
Initial fuzzing tests
This PR refactors and supersedes: https://github.com/fluxcd/source-controller/pull/443

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
Co-authored-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
Co-authored-by: AdamKorcz <adam@adalogics.com>
2022-02-08 17:49:34 +00:00
Hidde Beydals e0d034440a
Merge pull request #562 from pjbgf/test-alpine 2022-02-08 13:21:33 +01:00
Paulo Gomes 80e1d243e6
Upgrade to libgit2-1.1.1-6
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-02-08 10:51:20 +00:00
Paulo Gomes c5e2e5e30b
Add make test execution for macos-10.15
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-02-07 18:36:18 +00:00
Paulo Gomes fa00ec8fc7
Migrate from deprecated ginkgo async testing
https://github.com/onsi/ginkgo/blob/ver2/docs/MIGRATING_TO_V2.md\#removed-async-testing

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-02-07 15:08:03 +00:00
Paulo Gomes 21e71c3750
Set u+w to envtest folders
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-02-07 13:00:58 +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
Stefan Prodan ddc6cfeba0
Merge pull request #571 from fluxcd/release-v0.21.2
Release v0.21.2
2022-02-07 12:12:23 +02:00
Stefan Prodan e3e9deb3fd
Release v0.21.2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-02-07 11:50:32 +02:00
Stefan Prodan 5aec67b7f1
Merge pull request #570 from fluxcd/default-timeout
Increase default timeout to 60s
2022-02-07 11:43:55 +02:00
Stefan Prodan fb45c9caf6
Increase default timeout to 60s
Increase the default timeout from 20s to 60s for Git repository cloning and Bucket download

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-02-07 10:29:43 +02:00
Hidde Beydals f1e69d1f26
Merge pull request #563 from fluxcd/release-0.21.1 2022-01-27 11:51:58 +01:00
Hidde Beydals 01946f22a3 Release v0.21.1
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-01-27 11:16:21 +01:00
Hidde Beydals 93c636e42c
Merge pull request #561 from pjbgf/fix-host 2022-01-26 18:56:29 +01:00
Paulo Gomes 9479d04779
Fix host mismatch in libgit2
Depending on libgit2 version or from its dependencies, the hostname may or may not contain ports

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-01-26 17:25:18 +00:00
Stefan Prodan 4aad17445b
Merge pull request #553 from fluxcd/release-0.21.0
Release v0.21.0
2022-01-26 16:24:59 +02:00
Stefan Prodan 2049246adf
Release v0.21.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-26 15:38:10 +02:00
Hidde Beydals 1441af5853
Merge pull request #560 from pjbgf/pin-alpine 2022-01-26 14:36:36 +01: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
Stefan Prodan c37562775f
Merge pull request #558 from pjbgf/musl-tool-chain
Statically build using musl toolchain and target alpine
2022-01-26 14:39:07 +02: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 1c2ee2907a
Merge pull request #555 from yiannistri/dev-docs
Update dev docs
2022-01-25 17:49:35 +02:00
Yiannis ba2299307d Update dev docs
Signed-off-by: Yiannis <yiannis.triantafyllopoulos@gmail.com>
2022-01-25 15:09:47 +00:00
Stefan Prodan ce594e92ab
Merge pull request #556 from mvoitko/fix/missing-port-protocol-in-manager-config
Fix the missing protocol for the first port in manager config
2022-01-25 10:45:04 +02:00
Maksym Voitko 44836641a8 Fix the missing protocol for the first port in manager config
Signed-off-by: Maksym Voitko <max.voitko@gmail.com>
2022-01-25 00:43:35 +02:00
Stefan Prodan e25d191b89
Merge pull request #554 from fluxcd/update-git2go-v31.7.6
Update git2go to v31.7.6
2022-01-21 13:36:45 +02:00
Sunny c40e6829ec
Update git2go to v31.7.6
Keeping the git2go version the same as in image-automation-controller.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-01-21 16:39:16 +05:30
Stefan Prodan e1655b6b47
Merge pull request #551 from souleb/token-permissions
Add Permissions to github Workflows
2022-01-20 20:06:29 +02:00
Soule BA 53fa1f9e3e
Add Permissions to github Workflows
Imrove GITHUB_TOKEN permissions in the workflows.

Signed-off-by: Soule BA <soule@weave.works>
2022-01-20 18:01:49 +01:00
Hidde Beydals d1ab4d7c8e
Merge pull request #543 from bigkevmcd/include-directories 2022-01-20 16:05:31 +01:00
Kevin McDermott c397ff902b Ensure that directories are included.
This avoids skipping the directories when generating the archive
tarball.

This makes it easier to scan directory trees.

Signed-off-by: Kevin McDermott <kevin@weave.works>

Ensure that directories are included.

This avoids skipping the directories when generating the archive
tarball.

This makes it easier to scan directory trees.

Signed-off-by: Kevin McDermott <kevin@weave.works>
2022-01-20 13:58:44 +00:00