Skip to content

Commit

Permalink
SigningKey modifications to align process with SOPS
Browse files Browse the repository at this point in the history
  • Loading branch information
lwj committed Mar 24, 2021
1 parent 71fe1a5 commit b703129
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions api/v1alpha1/imageupdateautomation_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ type ImageUpdateAutomationStatus struct {

// SigningKey references a Kubernetes secret that contains a GPG keypair
type SigningKey struct {
// SecretRef holds the name to a secret that contains a 'value' key
// with the ASCII Armored file (.asc) containing the GPG signing
// SecretRef holds the name to a secret that contains a 'git.asc' key
// corresponding to the ASCII Armored file containing the GPG signing
// keypair as the value. It must be in the same namespace as the
// ImageUpdateAutomation.
// +required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ spec:
properties:
secretRef:
description: SecretRef holds the name to a secret that contains
a 'value' key with the ASCII Armored file (.asc) containing
the GPG signing keypair as the value. It must be in the
same namespace as the ImageUpdateAutomation.
a 'git.asc' key corresponding to the ASCII Armored file
containing the GPG signing keypair as the value. It must
be in the same namespace as the ImageUpdateAutomation.
properties:
name:
description: Name of the referent
Expand Down
4 changes: 2 additions & 2 deletions controllers/imageupdateautomation_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,9 @@ func (r *ImageUpdateAutomationReconciler) getSigningEntity(ctx context.Context,
}

// get data from secret
data, ok := secret.Data["value"]
data, ok := secret.Data["git.asc"]
if !ok {
return nil, fmt.Errorf("signing key secret '%s' does not contain a 'value' key", secretName)
return nil, fmt.Errorf("signing key secret '%s' does not contain a 'git.asc' key", secretName)
}

// read entity from secret value
Expand Down
7 changes: 5 additions & 2 deletions docs/api/image-automation.md
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ starting point, if it doesn&rsquo;t already exist.</p>
(<em>Appears on:</em>
<a href="#image.toolkit.fluxcd.io/v1alpha1.CommitSpec">CommitSpec</a>)
</p>
<p>SigningKey references a Kubernetes secret that contains a GPG file</p>
<p>SigningKey references a Kubernetes secret that contains a GPG keypair</p>
<div class="md-typeset__scrollwrap">
<div class="md-typeset__table">
<table>
Expand All @@ -543,7 +543,10 @@ github.com/fluxcd/pkg/apis/meta.LocalObjectReference
</em>
</td>
<td>
<p>SecretRef holds the name to a secret that contains a &lsquo;value&rsquo; key with the GPG file as the value. It must be in the same namespace as the ImageUpdateAutomation.</p>
<p>SecretRef holds the name to a secret that contains a &lsquo;git.asc&rsquo; key
corresponding to the ASCII Armored file containing the GPG signing
keypair as the value. It must be in the same namespace as the
ImageUpdateAutomation.</p>
</td>
</tr>
</tbody>
Expand Down

0 comments on commit b703129

Please sign in to comment.