Commit Graph

1502 Commits

Author SHA1 Message Date
Paulo Gomes cea9ea9142
libgit2: improve subtransport logging
Debugging connection issues can be extremely difficult, even more so at scale or when
concurrent connections are required to trigger specific issues.

Changes:
- Add a correlation identifier for each reconciliation, which allows for greater traceability when
going through all the reconciliation operations - including at transport level.
- Add transportType to segregate HTTP and SSH transport logging.
- SSH operations are now enriched with addr containing server address, and HTTP url.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-06-13 07:35:12 +01:00
Paulo Gomes 7a797e3b57
Merge pull request #781 from aryan9600/fix-enabled
libgit2: fix managed transport enabled flag updation
2022-06-10 14:28:04 +01:00
Sanskar Jaiswal 590aa325b0 libgit2: fix managed transport enabled flag updation
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-06-10 18:12:58 +05:30
Sunny f6a389ce57
Merge pull request #777 from aryan9600/refactor-tests
libgit2: refactor tests to use managed and unmanaged transport cleanly
2022-06-09 22:42:18 +05:30
Sanskar Jaiswal 45ee564e27 assert state of managed transport acc for each test
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-06-09 22:21:10 +05:30
Sanskar Jaiswal 4ce31319ee libgit2: refactor tests to use managed and unmanaged transport cleanly
Refactors libgit2 checkout tests to test managed and unmanaged
transport by making sure the tests requiring unmanaged transport are run
before, any tests that require managed transport (since disabling
managed transport isn't possible). This is done via arranging the tests
carefully in alphabetically sorted names, i.e. the tests with unmanaged
transport go in `checkout_test.go`, which forces golang to run the tests
in that file before any other tests.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-06-09 21:01:17 +05:30
Paulo Gomes 1faa547dad
Merge pull request #775 from pjbgf/leak-conns
libgit2: dispose connections in SubTransport.Close
2022-06-09 08:53:59 +01:00
Paulo Gomes bfa4e38b84
libgit2: dispose connections in SubTransport.Close
The average SubTransport lifecycle encompass two Actions calls. Previously,
it was attempted to share the same connection across both calls. That did
not work as some Git Servers do not support multiple sessions from the same
connection. The implementation was not fully transitioned into the
"one connection per action" model, which led to connection being leaked.

The transition to RW mutex was to avoid the unnecessary blocking in the
goroutine at the start of the second action call.

It is worth mentioning that now when the context is done,  the client level
resources (connection) will also be freed. This ensures that SSH connections
will not outlive the subtransport.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-06-08 19:39:50 +01:00
Stefan Prodan a00d0edcd7
Merge pull request #774 from fluxcd/release-v0.25.5
Release v0.25.5
2022-06-08 13:32:17 +03:00
Stefan Prodan b120c299a5
Release v0.25.5
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-06-08 13:15:41 +03:00
Paulo Gomes 6e44c8c4fb
Merge pull request #773 from pjbgf/update-deps
Update dependencies
2022-06-08 10:48:11 +01:00
Paulo Gomes ea7027ac54
Update dependencies
- github.com/fluxcd/pkg/apis/meta to version 0.14.2.
- github.com/fluxcd/pkg/runtime to version 0.16.2.
- google.golang.org/api to version 0.83.0.
- k8s.io/api to version 0.24.1.
- github.com/fluxcd/pkg/apis/meta to version 0.14.2.
- k8s.io/apimachinery to version 0.24.1.
- github.com/fluxcd/pkg/helmtestserver to version 0.7.4.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-06-08 10:19:05 +01:00
Paulo Gomes 5f9ce26bfa
Merge pull request #772 from pjbgf/redirect-logging
libgit2: Improve HTTP redirection observability
2022-06-08 10:01:16 +01:00
Paulo Gomes 23b337f6be
libgit2: Improve HTTP redirection observability
Git repositories may be redirected to different URLs
when they are accessed via HTTP. The two most obvious
scenarios are from HTTP to HTTPS and when the .git suffix
is missing.
By improving the logging on this process users can identify
changes required to their GitRepository objects.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-06-08 09:46:28 +01:00
Paulo Gomes d48f4b4800
Merge pull request #771 from aryan9600/fix-hostcallback
libgit2: fix ssh host key verification regression
2022-06-08 09:45:45 +01:00
Sanskar Jaiswal 47692530d7 libgit2: fix ssh host key verification regression
Earlier, host key verification could potentially fail if there were
multiple entries in the known_hosts file and if the intended encryption
algorithm wasn't the first entry. This happened because we used the same
hasher object to compute the sum of all the public keys present in the
known_hosts file, which led to invalid hashes, resulting in a mismatch
when compared with the hash of the advertised public key. This is fixed,
by not creating the hasher ourselves and instead delegating that to the
function actually doing the matching, ensuring that a new hasher is used
for each comparison.

Regression introduced in v0.25.0 and reported in
https://github.com/fluxcd/image-automation-controller/issues/378

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-06-08 13:59:32 +05:30
Stefan Prodan 2031c84961
Merge pull request #769 from souleb/fix-semver-string-compar
Fix sorting semver from OCI repository tags
2022-06-08 10:07:19 +03:00
Soule BA a163ea1dff
Fix sorting semver from OCI repository tags
If implemented this fix the issue where we previously did a string
ordering of matching semver versions when retrieving a list of tags from
an OCI registry.

Signed-off-by: Soule BA <soule@weave.works>
2022-06-07 22:20:36 +02:00
Paulo Gomes e55c0ceb5d
Merge pull request #767 from pjbgf/release-v0.25.4
Release v0.25.4
2022-06-07 16:20:41 +01:00
Paulo Gomes df91f87bae
Release v0.25.4
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-06-07 15:53:56 +01:00
Paulo Gomes 2ad59a5124
Merge pull request #766 from pjbgf/update-deps
Update dependencies
2022-06-07 15:45:29 +01:00
Paulo Gomes 7c9fb1dd25
Update dependencies
- github.com/distribution/distribution/v3 to version 3.0.0-20220526142353-ffbd94cbe269.
- github.com/docker/cli to version 20.10.17+incompatible.
- github.com/elazarl/goproxy to version 0.0.0-20220529153421-8ea89ba92021.
- github.com/fluxcd/pkg/gittestserver to version 0.5.4.
- github.com/fluxcd/pkg/helmtestserver to version 0.7.3.
- github.com/fluxcd/pkg/ssh to version 0.4.1.
- github.com/minio/minio-go/v7 to version 7.0.27.
- golang.org/x/crypto to version 0.0.0-20220525230936-793ad666bf5e.
- golang.org/x/net to version 0.0.0-20220607020251-c690dde0001d.
- golang.org/x/sync to version 0.0.0-20220601150217-0de741cfad7f.
- google.golang.org/api to version 0.82.0.
- github.com/containerd/containerd to version v1.6.6.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-06-07 15:29:06 +01:00
Paulo Gomes e70b365b1a
Merge pull request #765 from pjbgf/gitlab-dotgit-redirect
libgit2: fix gitlab redirection for HTTP
2022-06-07 15:28:44 +01:00
Paulo Gomes b764bdbeaa
libgit2: fix gitlab redirection for HTTP
Gitlab only supports HTTP redirection for GET operations,
and fails POST operations targeting a repository without
the .git suffix.

Fixes: https://github.com/fluxcd/image-automation-controller/issues/379
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-06-07 15:11:16 +01:00
Paulo Gomes 2a52056594
Merge pull request #764 from sympatheticmoose/patch-1
Update link to v1beta2 in the API spec
2022-06-07 11:00:31 +01:00
David Harris 175b70c887
bump link to API spec
Signed-off-by: David Harris <david.harris@weave.works>
2022-06-07 10:38:16 +01:00
Sunny 8c0a454efa
Merge pull request #763 from fluxcd/release-v0.25.3
Release v0.25.3
2022-06-06 17:47:57 +05:30
Sunny cfd2af681e
Release v0.25.3
Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-06-06 17:13:28 +05:30
Sunny b66ff927ae
Merge pull request #761 from souleb/fix-cache-regression
Fix repository cache regression
2022-06-06 17:05:51 +05:30
Soule BA 0d4d78fc6b
Fix repository cache regression
If implemented this make sure we don't unload an index before caching it
during a chart build phase.

Signed-off-by: Soule BA <soule@weave.works>
2022-06-06 13:15:10 +02:00
Stefan Prodan 9e3304144b
Merge pull request #756 from aryan9600/optimized-checkout-tag
Release v0.25.2
2022-06-03 16:39:51 +03:00
Sanskar Jaiswal fd56bcaa8e
Release v0.25.2
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-06-03 16:26:41 +03:00
Stefan Prodan ea1bab5a73
Merge pull request #759 from fluxcd/log-on-new-artifact
Log on new artifact and failure recovery
2022-06-03 16:15:17 +03:00
Stefan Prodan 2441f1f0e9
Log on new artifact and failure recovery
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-06-03 15:58:19 +03:00
Stefan Prodan b7281de889
Merge pull request #752 from SomtochiAma/azure-blob-doc
Add docs on managed identity for Azure Blob
2022-06-03 12:30:38 +03:00
Somtochi Onyekwere bb7aa14538 Add docs on managed identity for Azure Blob
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-06-03 10:05:31 +01:00
Hidde Beydals c10c03180d
Merge pull request #755 from aryan9600/optimized-checkout-tag 2022-06-03 10:56:11 +02:00
Sanskar Jaiswal c341ac3364 libgit2: return CheckoutTag with LastRevision
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-06-03 14:00:23 +05:30
Sunny a6536001eb
Merge pull request #754 from fluxcd/release-v0.25.1
Release v0.25.1
2022-06-03 02:41:11 +05:30
Sunny 34e59f3846
Release v0.25.1
Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-06-03 02:27:06 +05:30
Sunny c5a5707ede
Merge pull request #753 from fluxcd/libgit2-ssh-race-fixes
libgit2/managed: fix race conditions in ssh transport
2022-06-03 02:16:13 +05:30
Sunny 7f7490ebf0
libgit2/managed: fix race issues in ssh transport
Race conditions in ssh smart subtransport caused some goroutines to
panic, resulting in crashing the whole controller, mostly evident in
image-automation-controller CI runs. Panic recovery in the main thread
do not handle goroutine panics. So, the existing panic recovery code in
libgit2 Checkout() methods weren't able to handle it.

This change groups the fields in ssh smart subtransport that may be
accessed by multiple goroutines into a new struct with a mutex. Also
adds panic recovery in the created goroutine to handle any other
possible panics.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-06-03 01:45:18 +05:30
Hidde Beydals dc1037d962
Merge pull request #751 from aryan9600/chanelog-v0.25.0
Release v0.25.0
2022-06-01 13:19:17 +02:00
Sanskar Jaiswal 04e167cd01 Release v0.25.0
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-06-01 16:27:30 +05:30
Sunny 8a99fc7fe8
Merge pull request #750 from aryan9600/fix-checkout-branch
libgit2: fix checkout logic for CheckoutBranch
2022-06-01 14:36:22 +05:30
Sanskar Jaiswal ae27f9ec69 libgit2: fix checkout logic for CheckoutBranch
Use the target commit, to checkout tree and set the head to the desired
branch instead of doing a hard reset to the target commit.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-06-01 14:14:28 +05:30
Sunny c68c62ca12
Merge pull request #749 from fluxcd/docker-registry-host-mismatch
registry: repo URL and dockerconfig URL mismatch
2022-06-01 00:42:13 +05:30
Sunny f79fd034fd
registry: repo URL and dockerconfig URL mismatch
Registry login option should verify that the obtained dockerconfig
credentials are for the same host. When the helmrepo URL and the URL in
docker auth config don't match, the docker config store returns an
empty auth config, instead of failing. This results in accepting empty
username and password. The HelmRepo would appear to be ready in such
situation because the creds are empty, no login is attempted. But when
a HelmChart tries to use the login options, it'd fail.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-06-01 00:09:36 +05:30
Stefan Prodan fe31ff9e77
Merge pull request #748 from fluxcd/oci-helmrepo-refactor
OCI HelmRepo: handle status conditions in-line
2022-05-31 11:30:09 +03:00
Sunny 9fe287d912
helmrepo: rm stale condition when type switching
Remove stale condition from HelmRepo during garbage collection when a
type switch to OCI HelmRepo occurs. This ensures the OCI HelmRepo does
not have any conditions from the previous type.

Co-authored-by: Soule BA <soule@weave.works>
Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-05-31 03:53:33 +05:30