Commit Graph

291 Commits

Author SHA1 Message Date
zhaque44 bb4671cc0e set NewDigester back
Signed-off-by: zhaque44 <haque.zubair@gmail.com>
2025-05-08 19:19:08 -05:00
zhaque44 374e4ba495 rm unecessary scenarios
Signed-off-by: zhaque44 <haque.zubair@gmail.com>
2025-05-08 19:08:42 -05:00
zhaque44 15bbf61c50 fix new digester
Signed-off-by: zhaque44 <haque.zubair@gmail.com>
2025-05-08 19:05:06 -05:00
zhaque44 53578d8920 chore: Enhance Digester test coverage with edge case scenarios
Signed-off-by: zhaque44 <haque.zubair@gmail.com>
2025-05-08 18:54:05 -05:00
Matheus Pimenta e128d3b795
[RFC-0010] Introduce object-level workload identity for container registry APIs
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-05-07 18:33:59 +01:00
Matheus Pimenta 2dde6bf536
Upgrade fluxcd/pkg cache, auth, git and gogit
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-05-03 15:47:39 +01:00
Stefan Prodan 3c7812d387
Update to Kubernetes 1.33.0 and Go 1.24.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2025-04-28 14:10:47 +03:00
Dipti Pai 61f9eb28fc Sparse Checkout Directories in GitRepositories.
- Add `.spec.sparseCheckout` and `.status.observedSparseCheckout` fields to `GitRepository`.
    - Add controller support to send the sparse checkout directories to go-git via pkg methods.
    - Use `.status/observedSparseCheckout` to detect drift in configuration.
    - Trim leading "./" in directory paths.
    - Validate spec configuration by checking directories specified in spec exist in the cloned repository after successful checkout
    - Add tests for testing the observed sparse checkout behavior.
    - Add docs describing the new fields.

Signed-off-by: Dipti Pai <diptipai89@outlook.com>
2025-04-23 09:30:10 -07:00
Stefan Prodan b549fec2e7
Add tests for Git mutual TLS
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2025-04-22 10:28:00 +03:00
Stefan Prodan 2a839f8769
Renew testdata TLS certs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2025-04-22 10:12:10 +03:00
Dipti Pai 560dc5bc5f Rename references to pkg/auth/github to pkg/git/github
Signed-off-by: Dipti Pai <diptipai89@outlook.com>
2025-03-13 13:53:18 -07:00
Matheus Pimenta 9593041b53
Introduce token cache and use it for GitHub App tokens
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-03-12 14:45:48 +00:00
zhaque44 7a89359d27 add cache exp test & cache delete test
Signed-off-by: zhaque44 <haque.zubair@gmail.com>
2025-03-01 21:00:39 -06:00
Sunny 1ed845928b gitrepo: Use new reason for provider misconfig
Introduce InvalidProviderConfigurationReason for Git provider github
related misconfiguration.

Add github provider related tests to check the status conditions reason.

Rearrange and modify a test case for getAuthOpts() for provider test
where a referred secret doesn't exist. This scenario is not specific to
any provider.

Signed-off-by: Sunny <github@darkowlzz.space>
2024-12-19 21:01:44 +00:00
Dipti Pai 9556a639c6 [RFC-007] Implement GitHub app authentication for git repositories.
- API change to add new `github` provider field in `GitRepository` spec.
- Controller change to use the GitHub authentication information specified in `.spec.secretRef` to create the auth options to authenticate to git repositories when the `provider` field is set to `github`,
- Tests for new `github` provider field
- Updated docs to use GitHub Apps for authentication in source-controller.

Signed-off-by: Dipti Pai <diptipai89@outlook.com>
2024-12-19 23:28:10 +05:30
hasithsen 2b320409de feat: Remove deprecated object metrics from controllers fluxcd/flux2#5083
Signed-off-by: hasithsen <sen.hasith@gmail.com>
2024-12-12 00:02:25 +05:30
Sunny db42b07914 GitRepo: Remove provider default value from API
For backwards compatibility, remove the default value for GitRepository
provider. An empty provider value will still be considered as the
default provider.

Signed-off-by: Sunny <github@darkowlzz.space>
2024-09-26 15:13:29 +00:00
Dipti Pai 48417bdc8b Enable Azure OIDC for Azure DevOps Respository
- Add a new provider field to GitRepository API spec which can be set to azure to enable passwordless authentication to Azure DevOps repositories.

- API docs for new provider field and guidance to setup Azure environment with workload identity.

- Controller changes to set the provider options in git authoptions to fetch credential while cloning the repository.

- Add unit tests for testing provider

Signed-off-by: Dipti Pai <diptipai89@outlook.com>
2024-09-13 13:41:18 -07:00
Stefan Prodan e3992568f5
OCIRepository: Configure proxy for OIDC auth
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-09-10 18:54:32 +03:00
Stefan Prodan 225a452092
Update tests for notation 1.2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-09-04 09:42:41 +03:00
Stefan Prodan 36a4889ea2
Alias Bucket providers from v1beta2 to v1
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-08-27 17:16:14 +03:00
Stefan Prodan 5be0c53729
Promote Bucket API to v1
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-08-23 13:25:57 +03:00
Matheus Pimenta 02d492bc43 Introduce Bucket provider constants with the common part as a prefix
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2024-08-22 14:48:53 -03:00
Matheus Pimenta 10ac11314d Add LDAP provider for Bucket STS API
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2024-08-22 08:41:23 -03:00
Matheus Pimenta 03a118a94c Add proxy support for OCIRepository API
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2024-08-15 10:29:57 -03:00
Stefan Prodan 93ad04b6c8
Update dependencies to Kubernetes v1.31.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-08-14 21:40:29 +03:00
Matheus Pimenta b6bd2abe2d Add proxy support for Azure buckets
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2024-08-09 22:17:06 +01:00
Matheus Pimenta 31ed900a90 Add proxy support for GCS buckets
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2024-08-09 19:05:10 +01:00
Matheus Pimenta 7536ab4b02 Add support for AWS STS endpoint in the Bucket API
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2024-08-08 16:35:01 +01:00
ricardo.bartels@telekom.de a65f6fda92 mitigate issue with chart validation in Helm 3.14 #1515
Signed-off-by: ricardo.bartels@telekom.de <ricardo.bartels@telekom.de>
2024-07-19 20:07:29 +02:00
Matheus Pimenta 8d19782683 Improve invalid proxy error message for Bucket API
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2024-07-16 09:57:31 +01:00
Matheus Pimenta d941101697 Fix HelmChart local dependency resolution for name-based path
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2024-07-10 12:09:59 +01:00
Florian Forster 277e5c1d55
Prefer `%s` over `%v` when formatting errors.
Signed-off-by: Florian Forster <fforster@gitlab.com>
2024-07-05 15:55:33 +02:00
Florian Forster fa3022443c
fix: Print `strings.Builder` by calling `String()` explicitly.
The `String()` method is only defined for the pointer receiver.

Signed-off-by: Florian Forster <fforster@gitlab.com>
2024-07-05 15:55:32 +02:00
Florian Forster 8be37ef1d2
Fix incorrect use of format strings with the `conditions` package.
Many of the functions in the `conditions` package accept a format string and
(optional) arguments, just like `fmt.Printf` and friends.

In many places, the code passed an error message as the format string, causing
it to be interpreted by the `fmt` package. This leads to issues when the
message contains percent signs, e.g. URL-encoded values.

Consider the following code:

```go
// internal/controller/ocirepository_controller.go
revision, err := r.getRevision(ref, opts)
if err != nil {
	e := serror.NewGeneric(
		fmt.Errorf("failed to determine artifact digest: %w", err),
		ociv1.OCIPullFailedReason,
	)
	conditions.MarkTrue(obj, sourcev1.FetchFailedCondition, e.Reason, e.Err.Error())
	return sreconcile.ResultEmpty, e
}
```

Since `getRevision()` includes the URL in the error message and the error
message is used as a format string, the resulting condition reads:

```
failed to determine artifact digest: GET https://gitlab.com/jwt/auth?scope=repository%!A(MISSING)fforster%!F(MISSING)<REDACTED>%!F(MISSING)k8s-resource-manifests%!A(MISSING)pull&service=container_registry: DENIED: access forbidden
```

This adds an explicit format string and shortens `e.Error()` and
`e.Err.Error()` to `e`, which yields the same output.

To the best of my knowledge, Go is safe from format string attacks. I **don't**
think this is a security vulnerability, but I'm also not a security expert.

Signed-off-by: Florian Forster <fforster@gitlab.com>
2024-07-05 15:55:31 +02:00
Matheus Pimenta 4d9c87cf3f Add support for .spec.proxySecretRef for generic provider of Bucket API
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2024-07-03 15:10:47 +01:00
Soule BA b310a851c7
Use the transport pool
If implemented, A transport from the pool with safe defaults will be used when creating an oci registry client.
This will enable using the proxy configuration.

Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-06-14 08:50:33 +02:00
Matheus Pimenta bc16734391 Add .certSecretRef for Bucket API
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2024-05-15 19:44:05 +01:00
Stefan Prodan 31c4df4a8d
Deprecate v1beta1 APIs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-05-02 19:40:15 +03:00
Stefan Prodan 0a7f66b0e3
docs: Add API spec for Helm v1
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-05-02 16:19:48 +03:00
Stefan Prodan f85bc174e6
Promote Helm APIs to v1 (GA)
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-05-02 16:04:27 +03:00
Robin Breathe 1e82cec48d
chore: address feedback
Signed-off-by: Robin Breathe <robin@isometry.net>
2024-05-02 12:10:05 +02:00
Robin Breathe 9b57d3bc52
chore: update tests
Signed-off-by: Robin Breathe <robin@isometry.net>
2024-05-02 08:21:23 +02:00
Paulo Canilho bf97748339
feat: resolved values files are persisted to and retrieved from the [HelmChart.Status.ObservedValuesFiles] field
Signed-off-by: Paulo Canilho <paulo.canilho@nexthink.com>
2024-05-01 08:01:42 +02:00
Robin Breathe b84ab9e698
feat(HelmChartSpec): optionally ignore missing valuesFiles
Signed-off-by: Robin Breathe <robin@isometry.net>
2024-05-01 08:01:41 +02:00
Soule BA b30404fff1
Bind cached helm index to the maximum index size
Signed-off-by: Soule BA <bah.soule@gmail.com>
2024-04-22 17:02:33 +02:00
Austin Abro ab6d560002
allow insecure registry login
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>

only add loginoptinsecure when already logging in

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>

fix tests, move registry login options

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>

cleaner code

Signed-off-by: Austin Abro <austinabro321@gmail.com>

change localhost to 127.0.0.1 in insecure suite test path

Signed-off-by: Austin Abro <austinabro321@gmail.com>

let myself run tests

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>

allow myself to run tests

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>

clearer error message in test

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>

update test to reflect new behavior

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>

undo test config changes

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>

remove extra whitespace

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
2024-04-18 13:12:18 +00:00
Stefan Prodan 4d29266821
Update dependencies to cosign v2.2.4
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-04-11 08:08:02 +03:00
Jagpreet Singh Tamber 5854dbee73
Sanitize URLs for bucket fetch error messages.
Co-authored-by: Jagpreet Singh Tamber <jagpreetstamber@gmail.com>
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-04-04 15:22:21 +03:00
Stefan Prodan 76b38f4a8e
Generate unique names for notation secrets
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-04-03 10:14:19 +03:00