Commit Graph

2716 Commits

Author SHA1 Message Date
cappyzawa 041aa6c993
[RFC-0010] Add multi-tenant workload identity support for AWS Bucket
Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-08-15 02:36:04 +09:00
Matheus Pimenta 48da00dba2
Merge pull request #1870 from cappyzawa/remove-tlsconfig-servername-pinning
Remove ServerName pinning from TLS config
2025-08-14 15:21:35 +01:00
cappyzawa 683719d33c
Remove ServerName pinning from TLS config
Remove ServerName pinning functionality that can cause TLS
verification failures in production environments with redirects,
proxies, and multi-host scenarios.

The Go standard library automatically handles SNI and hostname
verification based on the actual connection target, providing
better compatibility and security than fixed ServerName values.

Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-08-14 22:52:50 +09:00
Stefan Prodan cd5eebfb32
Merge pull request #1860 from abhijith-darshan/feat/gh_app_tls
Add support for mTLS to GitHub App transport
2025-08-14 10:22:23 +03:00
abhijith-darshan 46522f9815
(chore): adds tls config for GitHub App auth
this commit ensures that if ca.crt or caFile is available in the github app secret, a tls config with user provided certs is appended to system cert pool and passed to the underlying http transport

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): update target URL for TLSConfigFromSecret

this commit ensures that the target URL for runtime/secrets.TLSConfigFromSecret has the scheme and host

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): adds test scenarios

this commit adds test scenarios for mTLS GitHub app in reconcile source auth strategy

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): use runtime/secrets authMethods

this commit ensures that GitHubApp secret resolution happens via pkg/runtime/secrets

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): update docs

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): adds github app data check

this commit ensures that when provider is github and no github app data is present in the secret, it will error out with invalid configuration

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): removes getProxyOpts helper func

this commit removes the helper method getProxyOpts and uses the standardized pkg/runtime/secrets APIs to get proxy options.

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): removes getProxyOpts test

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): improves test coverage

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): do not stall on missing github app data

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>

(chore): adds a note on mTLS configuration in docs

This commit mentions in the docs that if tls.crt and tls.key is part of the secret then mutual TLS configuration will be automatically enabled and should be used optionally.

Signed-off-by: abhijith-darshan <abhijith.darshan@hotmail.com>
2025-08-12 23:32:12 +02:00
Matheus Pimenta bd6d090ef0
Merge pull request #1865 from fluxcd/fix-stalled-errors
Fix GitRepository controller stalling when it shouldn't
2025-08-12 14:53:01 +01:00
Matheus Pimenta 1f4fc2fe87
Fix GitRepository controller stalling when it shouldn't
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-08-12 14:34:12 +01:00
Stefan Prodan a84403c95b
Merge pull request #1864 from fluxcd/refactor-pkg
Refactor pkg structure
2025-08-12 15:31:30 +03:00
Stefan Prodan 9e789f6d9a
Extract storage operations to a dedicated package
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2025-08-12 14:57:15 +03:00
Stefan Prodan ac8ec2e32a
Refactor bucket pkg structure
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2025-08-12 14:43:17 +03:00
Matheus Pimenta d69d743e75
Merge pull request #1862 from cappyzawa/feat/bucket-workload-identity-gcp
[RFC-0010] Add multi-tenant workload identity support for GCP Bucket
2025-08-12 08:37:42 +01:00
cappyzawa 3733163358
[RFC-0010] Add multi-tenant workload identity support for GCP Bucket
Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-08-12 07:58:39 +09:00
Stefan Prodan 1469073055
Merge pull request #1861 from fluxcd/remove-v1beta1-api
Remove deprecated APIs in group `source.toolkit.fluxcd.io/v1beta1`
2025-08-11 17:54:32 +03:00
Stefan Prodan ca43631480
Remove deprecated APIs in group `source.toolkit.fluxcd.io/v1beta1`
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2025-08-08 15:09:11 +03:00
Stefan Prodan c2b572bae0
Merge pull request #1852 from cappyzawa/feat/bucket-controller-runtime-secrets-migration
Migrate Bucket controller to runtime/secrets
2025-07-31 18:58:56 +03:00
cappyzawa 9463bcf0ee
Fix missing namespace in Helm Repository Controller secret error
Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-07-31 22:05:37 +09:00
cappyzawa 4b18040e22
Fix missing namespace in OCI Repository Controller secret error
Include namespace in secret error message for better debugging context.
The secret name was already present in the error, but namespace information
was missing, making it harder to identify which secret in which namespace
was not found.

Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-07-31 22:05:37 +09:00
cappyzawa 3caf8f1db9
Migrate Bucket controller to runtime/secrets
Replaces internal credential management with runtime/secrets package
to standardize authentication, proxy configuration, and TLS handling
across controllers. This migration eliminates code duplication by
leveraging shared utilities and improves maintainability through
consistent error handling patterns.

The refactoring splits the large reconcileSource method into focused
helper functions for better separation of concerns.

Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-07-31 22:05:37 +09:00
Matheus Pimenta 44098cfd2f
Merge pull request #1857 from cappyzawa/docs/mtls-documentation-unification
docs: unify mTLS authentication section titles
2025-07-31 14:02:27 +01:00
cappyzawa a65166578d
docs: unify mTLS authentication section titles
Update HelmRepository, OCIRepository, and Bucket documentation to use
"Mutual TLS Authentication" section titles instead of "Cert secret
reference". This improves discoverability of mTLS capabilities and
follows GitRepository's established pattern.

The previous generic titles obscured mutual TLS functionality, causing
users to miss this important security feature. Updated descriptions
explicitly mention mutual TLS authentication while maintaining all
existing YAML examples and technical accuracy.

Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-07-30 23:03:51 +09:00
Matheus Pimenta 93b9048706
Merge pull request #1856 from cappyzawa/feat/helm-oci-controllers-runtime-secrets-v078
Add WithSystemCertPool for CA compatibility
2025-07-30 04:37:55 +01:00
cappyzawa ba14962c1f
Add WithSystemCertPool for CA compatibility
Update pkg/runtime dependency from v0.76.0 to v0.78.0 and add
WithSystemCertPool() options to maintain backward compatibility
with the existing extend approach (system CAs + user CA).

This ensures source-controller continues to work with both system
and user-provided CA certificates, maintaining the same behavior
as before the pkg/runtime/secrets API changes.

Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-07-30 11:39:11 +09:00
Matheus Pimenta c43a3393a0
Merge pull request #1855 from cappyzawa/feat/helm-oci-controllers-runtime-secrets-v076
Enforce TLS certificate verification in Helm/OCI Repository controllers
2025-07-29 14:41:06 +01:00
cappyzawa 4b1ace618a
Enforce TLS certificate verification in Helm/OCI Repository controllers
Remove the insecure parameter from TLS configuration function calls to prevent
InsecureSkipVerify from being set when using certificate-based authentication.
This ensures TLS certificate verification is always performed when certificates
are provided, aligning with our security policy.

Updated pkg/runtime to v0.76.0 which no longer accepts the insecure parameter
in TLS configuration functions. For OCIRepository, maintain backward compatibility
by handling the specific case where no certificate is provided and insecure is
explicitly set to true. This is the only allowed exception in Flux controllers.

Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-07-29 02:42:22 +09:00
Matheus Pimenta a0b4969dc9
Merge pull request #1851 from cappyzawa/feat/oci-repository-runtime-secrets-migration
Migrate OCIRepository controller to runtime/secrets
2025-07-21 18:58:14 +01:00
cappyzawa b2993a76bc
Fix missing TLS ServerName in HelmRepository
Add ServerName configuration to TLS config in HelmRepository client
options to ensure proper SNI (Server Name Indication) support for
virtual hosting environments. This addresses the regression introduced
when migrating from internal/tls to runtime/secrets, where ServerName
was not being set automatically.

Without ServerName, TLS handshakes fail with certificate mismatch
errors when connecting to Helm repositories using virtual hosting
where multiple repositories are hosted on the same IP address.

Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-07-22 00:39:59 +09:00
cappyzawa 74242e5d8a
Migrate OCIRepository controller to runtime/secrets
Migrates the OCIRepository controller's authentication handling from
internal implementations to the unified runtime/secrets API package.

The migration moves TLS configuration from internal/tls to
runtime/secrets.TLSConfigFromSecretRef and ServiceAccount processing
to secrets.PullSecretsFromServiceAccountRef, providing consistent
authentication handling across all source-controller components.

This change eliminates duplicate secret fetching logic and aligns
the OCIRepository controller with the standardized authentication
patterns used by other controllers in the GitOps Toolkit.

Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-07-22 00:39:59 +09:00
Matheus Pimenta 173a1cccc5
Merge pull request #1849 from cappyzawa/feat/helm-repository-runtime-secrets-migration
Migrate HelmRepository to runtime/secrets
2025-07-18 13:40:13 +01:00
cappyzawa 9950f56d26
migrate HelmRepository to AuthMethodsFromSecret API
This commit upgrades pkg/runtime to v0.73.0 and adopts the unified
AuthMethodsFromSecret API for HelmRepository authentication handling.
The change replaces complex manual authentication detection with a
single API call and improves error handling consistency.

Breaking Changes:
- TLS certificate validation is now strictly enforced. Invalid CA
  certificates will cause authentication failures even for public
  repositories, where they were previously ignored.
- Empty TLS certificate secrets now trigger validation errors instead
  of being silently ignored. This affects certSecretRef with empty
  Data map - previously ignored, now causes proper error.

Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-07-18 21:29:37 +09:00
cappyzawa 274a6699cc
refactor: improve HelmRepository controller test structure for runtime/secrets migration
Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-07-18 03:37:02 +09:00
Stefan Prodan 114a702490
Merge pull request #1844 from fluxcd/dependabot/go_modules/github.com/go-viper/mapstructure/v2-2.3.0
build(deps): bump github.com/go-viper/mapstructure/v2 from 2.2.1 to 2.3.0
2025-07-15 01:11:39 +03:00
dependabot[bot] 8c951e3019
build(deps): bump github.com/go-viper/mapstructure/v2
Bumps [github.com/go-viper/mapstructure/v2](https://github.com/go-viper/mapstructure) from 2.2.1 to 2.3.0.
- [Release notes](https://github.com/go-viper/mapstructure/releases)
- [Changelog](https://github.com/go-viper/mapstructure/blob/main/CHANGELOG.md)
- [Commits](https://github.com/go-viper/mapstructure/compare/v2.2.1...v2.3.0)

---
updated-dependencies:
- dependency-name: github.com/go-viper/mapstructure/v2
  dependency-version: 2.3.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-14 21:10:27 +00:00
Stefan Prodan 508f4ff38d
Merge pull request #1850 from fluxcd/upgrade-deps
Upgrade Kubernetes to 1.33.2
2025-07-15 00:08:34 +03:00
Matheus Pimenta e3abd39417
Upgrade Kubernetes to 1.33.2
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-07-14 18:33:46 +01:00
Stefan Prodan 21e3a02f99
Merge pull request #1848 from cappyzawa/refactor/transport-to-pkg
refactor: replace internal/transport with pkg/http/transport
2025-07-09 14:18:21 +03:00
cappyzawa d5920fee85
refactor: replace internal/transport with pkg/http/transport
Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-07-09 19:28:36 +09:00
Matheus Pimenta 8f77ed4981
Merge pull request #1808 from TerryHowe/harden-blob-test
fix: blob test cores if no error
2025-07-01 14:34:26 +01:00
Terry Howe 9c8d8c95e2
fix: blob test cores if no error
Co-authored-by: Matheus Pimenta <matheuscscp@gmail.com>
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2025-06-30 05:57:55 -06:00
Matheus Pimenta 32967c32c3
Merge pull request #1843 from fluxcd/pick-changelog-v1.6.2
Add changelog entry for v1.6.2
2025-06-27 11:21:54 +01:00
Matheus Pimenta 5ff9de8bb9
Add changelog entry for v1.6.2
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
(cherry picked from commit 55b45275a1)
2025-06-27 11:04:25 +01:00
Stefan Prodan 4dec4c28c0
Merge pull request #1839 from fluxcd/fix-ssh-host-key-sha2
Fix: Prioritize sha2-512 and sha2-256 for ssh-rsa host keys
2025-06-27 11:44:19 +03:00
Stefan Prodan 07ab3461dc
Fix: Prioritize sha2-512 and sha2-256 for ssh-rsa host keys
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2025-06-27 11:26:54 +03:00
Matheus Pimenta e37bd89d5e
Merge pull request #1835 from cappyzawa/refactor/simplify-oci-auth-error-handling
refactor: cleanup GetArtifactRegistryCredentials error handling
2025-06-21 14:32:50 +01:00
cappyzawa 738fb2b3a8
refactor: simplify OCI auth error handling
Update fluxcd/pkg/auth to v0.18.0 and remove unnecessary authenticator
nil check in Helm OCI repository authentication.

With fluxcd/pkg/auth v0.18.0, GetArtifactRegistryCredentials() returns
valid authenticator when error is nil, making the nil check redundant.

Signed-off-by: cappyzawa <cappyzawa@gmail.com>
2025-06-21 22:21:51 +09:00
Matheus Pimenta 97c995b8c8
Merge pull request #1833 from fluxcd/pick-changelog-v1.6.1
Add changelog entry for v1.6.1
2025-06-13 17:21:04 +01:00
Matheus Pimenta bcc0b84bd4
Add changelog entry for v1.6.1
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
(cherry picked from commit 7922d124e7)
2025-06-13 17:11:57 +01:00
Matheus Pimenta a5e476fce3
Merge pull request #1829 from fluxcd/fix-host-keys
Fix `knownhosts key mismatch` regression bug
2025-06-12 18:54:35 +01:00
Matheus Pimenta 5d5943fff0
Upgrade dependencies
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-06-12 18:02:44 +01:00
Matheus Pimenta 829b6a2104
Merge pull request #1825 from fluxcd/upgrade-auth
Upgrade dependencies
2025-06-09 17:43:41 +01:00
Matheus Pimenta 575d936c9b
Upgrade dependencies
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-06-09 17:07:52 +01:00