Skip to content

Commit b8f9d6e

Browse files
committed
helmrepo: add .spec.certSecretRef for specifying TLS auth data
Add `.spec.certSecretRef` to HelmRepository for specifying TLS auth data in a secret using the `certFile`, `caFile` and `keyFile` keys. Mark support for these keys in the secret specified in `.spec.secretRef` as deprecated. Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
1 parent 7f40be7 commit b8f9d6e

File tree

4 files changed

+67
-8
lines changed

4 files changed

+67
-8
lines changed

api/v1beta2/helmrepository_types.go

+9-2
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,18 @@ type HelmRepositorySpec struct {
5151
// for the HelmRepository.
5252
// For HTTP/S basic auth the secret must contain 'username' and 'password'
5353
// fields.
54-
// For TLS the secret must contain a 'certFile' and 'keyFile', and/or
55-
// 'caFile' fields.
54+
// Support for TLS auth using the 'certFile' and 'keyFile', and/or 'caFile'
55+
// keys is deprecated. Please use `.spec.certSecretRef` instead.
5656
// +optional
5757
SecretRef *meta.LocalObjectReference `json:"secretRef,omitempty"`
5858

59+
// CertSecretRef specifies the Secret containing the TLS authentication
60+
// data. The secret must contain a 'certFile' and 'keyFile', and/or 'caFile'
61+
// fields. It takes precedence over the values specified in the Secret
62+
// referred to by `.spec.secretRef`.
63+
// +optional
64+
CertSecretRef *meta.LocalObjectReference `json:"certSecretRef,omitempty"`
65+
5966
// PassCredentials allows the credentials from the SecretRef to be passed
6067
// on to a host that does not match the host as defined in URL.
6168
// This may be required if the host of the advertised chart URLs in the

api/v1beta2/zz_generated.deepcopy.go

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/source.toolkit.fluxcd.io_helmrepositories.yaml

+15-2
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,18 @@ spec:
296296
required:
297297
- namespaceSelectors
298298
type: object
299+
certSecretRef:
300+
description: CertSecretRef specifies the Secret containing the TLS
301+
authentication data. The secret must contain a 'certFile' and 'keyFile',
302+
and/or 'caFile' fields. It takes precedence over the values specified
303+
in the Secret referred to by `.spec.secretRef`.
304+
properties:
305+
name:
306+
description: Name of the referent.
307+
type: string
308+
required:
309+
- name
310+
type: object
299311
interval:
300312
description: Interval at which to check the URL for updates.
301313
pattern: ^([0-9]+(\.[0-9]+)?(ms|s|m|h))+$
@@ -323,8 +335,9 @@ spec:
323335
secretRef:
324336
description: SecretRef specifies the Secret containing authentication
325337
credentials for the HelmRepository. For HTTP/S basic auth the secret
326-
must contain 'username' and 'password' fields. For TLS the secret
327-
must contain a 'certFile' and 'keyFile', and/or 'caFile' fields.
338+
must contain 'username' and 'password' fields. Support for TLS auth
339+
using the 'certFile' and 'keyFile', and/or 'caFile' keys is deprecated.
340+
Please use `.spec.certSecretRef` instead.
328341
properties:
329342
name:
330343
description: Name of the referent.

docs/api/v1beta2/source.md

+38-4
Original file line numberDiff line numberDiff line change
@@ -792,8 +792,25 @@ github.com/fluxcd/pkg/apis/meta.LocalObjectReference
792792
for the HelmRepository.
793793
For HTTP/S basic auth the secret must contain &lsquo;username&rsquo; and &lsquo;password&rsquo;
794794
fields.
795-
For TLS the secret must contain a &lsquo;certFile&rsquo; and &lsquo;keyFile&rsquo;, and/or
796-
&lsquo;caFile&rsquo; fields.</p>
795+
Support for TLS auth using the &lsquo;certFile&rsquo; and &lsquo;keyFile&rsquo;, and/or &lsquo;caFile&rsquo;
796+
keys is deprecated. Please use <code>.spec.certSecretRef</code> instead.</p>
797+
</td>
798+
</tr>
799+
<tr>
800+
<td>
801+
<code>certSecretRef</code><br>
802+
<em>
803+
<a href="https://pkg.go.dev/github.com/fluxcd/pkg/apis/meta#LocalObjectReference">
804+
github.com/fluxcd/pkg/apis/meta.LocalObjectReference
805+
</a>
806+
</em>
807+
</td>
808+
<td>
809+
<em>(Optional)</em>
810+
<p>CertSecretRef specifies the Secret containing the TLS authentication
811+
data. The secret must contain a &lsquo;certFile&rsquo; and &lsquo;keyFile&rsquo;, and/or &lsquo;caFile&rsquo;
812+
fields. It takes precedence over the values specified in the Secret
813+
referred to by <code>.spec.secretRef</code>.</p>
797814
</td>
798815
</tr>
799816
<tr>
@@ -2459,8 +2476,25 @@ github.com/fluxcd/pkg/apis/meta.LocalObjectReference
24592476
for the HelmRepository.
24602477
For HTTP/S basic auth the secret must contain &lsquo;username&rsquo; and &lsquo;password&rsquo;
24612478
fields.
2462-
For TLS the secret must contain a &lsquo;certFile&rsquo; and &lsquo;keyFile&rsquo;, and/or
2463-
&lsquo;caFile&rsquo; fields.</p>
2479+
Support for TLS auth using the &lsquo;certFile&rsquo; and &lsquo;keyFile&rsquo;, and/or &lsquo;caFile&rsquo;
2480+
keys is deprecated. Please use <code>.spec.certSecretRef</code> instead.</p>
2481+
</td>
2482+
</tr>
2483+
<tr>
2484+
<td>
2485+
<code>certSecretRef</code><br>
2486+
<em>
2487+
<a href="https://pkg.go.dev/github.com/fluxcd/pkg/apis/meta#LocalObjectReference">
2488+
github.com/fluxcd/pkg/apis/meta.LocalObjectReference
2489+
</a>
2490+
</em>
2491+
</td>
2492+
<td>
2493+
<em>(Optional)</em>
2494+
<p>CertSecretRef specifies the Secret containing the TLS authentication
2495+
data. The secret must contain a &lsquo;certFile&rsquo; and &lsquo;keyFile&rsquo;, and/or &lsquo;caFile&rsquo;
2496+
fields. It takes precedence over the values specified in the Secret
2497+
referred to by <code>.spec.secretRef</code>.</p>
24642498
</td>
24652499
</tr>
24662500
<tr>

0 commit comments

Comments
 (0)