Commit Graph

1527 Commits

Author SHA1 Message Date
Somtochi Onyekwere 35a7ea1efa Remove trailing slash
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-06-29 11:05:08 +01:00
Sunny 3dcb142076
Merge pull request #795 from aryan9600/release-v0.25.8
Release v0.25.8
2022-06-24 16:34:48 +05:30
Sanskar Jaiswal 3896911adb
Release v0.25.8
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-06-24 16:12:04 +05:30
Stefan Prodan 60cf11a0d1
Merge pull request #796 from fluxcd/libgit2-req-incomplete-auth-test
libgit2/managed/http: test for incomplete creds
2022-06-24 13:16:47 +03:00
Sunny 7325430bc9
libgit2/managed/http: test for incomplete creds
Add test for createClientRequest() where the credentials are incomplete.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-06-23 15:31:46 +05:30
Hidde Beydals bc28ad5d1b
Merge pull request #794 from aryan9600/fix-bitbucket-auth 2022-06-23 11:44:59 +02:00
Sanskar Jaiswal 7a708ac6d2 set request auth if both username and password are non empty
BitBucket servers don't accept a username with an empty password, so a
secret with no http auth creds will result in a 401, since we
fall back to "git" for the username and used to set basic auth with that
username without a password.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-06-23 14:44:57 +05:30
Sunny 7c07b7a03f
Merge pull request #789 from fluxcd/release-v0.25.7
Release v0.25.7
2022-06-22 15:51:10 +05:30
Sunny 56ae4d247c
Release v0.25.7
Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-06-22 15:23:26 +05:30
Sunny ea516d8037
Merge pull request #783 from pjbgf/known_hosts_error
libgit2: improve known_hosts error messages
2022-06-22 14:54:03 +05:30
Paulo Gomes b490a6aae8 libgit2: improve known_hosts error messages
Known hosts can be a difficult problem to troubleshoot.
To make it easier for end users, the generic message has
now been changed with a much more user friendly one.

Now if a known_host is not set, an error message will be
returned, instead of it simply being ignored.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-06-21 20:01:29 +05:30
Sunny 22951347dd
Merge pull request #785 from fluxcd/mutexless
libgit2: remove deadlock
2022-06-21 19:51:23 +05:30
Sunny a530c5dee2
libgit2/ssh: Embed connection fields in Subtransport
The connection type was created to group the connection related fields
and use mutex to prevent race conditions. Since that's no longer the
case, this puts back those fields in sshSmartSubtransport.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-06-21 17:55:21 +05:30
Paulo Gomes 09fae634df
libgit2: remove deadlock
Some scenarios may lead to deadlocks, specially
in image automation controller.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-06-16 13:54:38 +01:00
Paulo Gomes 812f6e49dd
Merge pull request #784 from pjbgf/release-v0.25.6
Release v0.25.6
2022-06-14 18:03:04 +01:00
Paulo Gomes 305df79bc1
Release v0.25.6
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-06-14 15:44:03 +01:00
Paulo Gomes 0a993a8770
Merge pull request #615 from fluxcd/go-test-race
build: enable `-race` for `go test`
2022-06-14 15:14:01 +01:00
Paulo Gomes 230774cc80
build: disable go test -race for arm64
Race detection is not working properly in our arm64 runners.
It has been tested against both M1 and linux arm64 machines
and in both cases the results were aligned with the other
platforms.

By disabling this we can ensure race detection is being
enforced on the other platforms, and we can later review
this position.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-06-14 11:33:36 +01:00
Paulo Gomes f1799dcb6b
git: fix reconcileSource_authStrategy
Co-authored-by: Sunny <darkowlzz@protonmail.com>
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-06-14 09:25:54 +01:00
Paulo Gomes a7ffb8c8aa
git: Update proxy tests
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-06-14 09:25:53 +01:00
Sunny d72a189e88
internal/helm/getter: remove transport reuse test
Since the transport reuse is dependent on the garbage collection, the
result is inconsistent. It fails frequently when running the tests with
the go race detector. Remove the test.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-06-14 09:25:52 +01:00
Sunny d38086bd72
Fix race condition in git proxy tests
The variable used to store the information about proxied request was
being written to in the proxy server request handler and read for
assertion at the end of the test.
Replace the boolean variable with an atomic counter to count the number
of requests proxied, preventing the race condition.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-06-14 09:25:52 +01:00
Hidde Beydals 7a5f0ccd89
build: enable `-race` for `go test`
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-06-14 09:25:51 +01:00
Paulo Gomes 19292d468c
Merge pull request #778 from pjbgf/improved-logging
libgit2: add contextual logging to subtransports
2022-06-14 09:22:23 +01:00
Paulo Gomes 42dcb87345
Add reconcileID to all reconcilers
GitRepository introduced correlation ID to improve
transport level logging. This change aligns the other
reconcilers to the same approach.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-06-14 08:59:44 +01:00
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