api: introduce `Digest` field to `Artifact`

As discussed in RFC-0005, this introduces a `Digest` field to the
`Artifact` in favor of the now deprecated `Checksum`.

Signed-off-by: Hidde Beydals <hello@hidde.co>
This commit is contained in:
Hidde Beydals 2022-11-07 12:30:01 +00:00
parent d18988e81a
commit 964b2d3f00
7 changed files with 58 additions and 9 deletions

View File

@ -43,8 +43,14 @@ type Artifact struct {
Revision string `json:"revision"` Revision string `json:"revision"`
// Checksum is the SHA256 checksum of the Artifact file. // Checksum is the SHA256 checksum of the Artifact file.
// Deprecated: use Artifact.Digest instead.
// +optional // +optional
Checksum string `json:"checksum"` Checksum string `json:"checksum,omitempty"`
// Digest is the digest of the file in the form of '<algorithm>:<checksum>'.
// +optional
// +kubebuilder:validation:Pattern="^[a-z0-9]+(?:[.+_-][a-z0-9]+)*:[a-zA-Z0-9=_-]+$"
Digest string `json:"digest"`
// LastUpdateTime is the timestamp corresponding to the last update of the // LastUpdateTime is the timestamp corresponding to the last update of the
// Artifact. // Artifact.

View File

@ -377,7 +377,12 @@ spec:
description: Artifact represents the last successful Bucket reconciliation. description: Artifact represents the last successful Bucket reconciliation.
properties: properties:
checksum: checksum:
description: Checksum is the SHA256 checksum of the Artifact file. description: 'Checksum is the SHA256 checksum of the Artifact
file. Deprecated: use Artifact.Digest instead.'
type: string
digest:
description: Digest is the digest of the file in the form of '<algorithm>:<checksum>'.
pattern: ^[a-z0-9]+(?:[.+_-][a-z0-9]+)*:[a-zA-Z0-9=_-]+$
type: string type: string
lastUpdateTime: lastUpdateTime:
description: LastUpdateTime is the timestamp corresponding to description: LastUpdateTime is the timestamp corresponding to

View File

@ -554,7 +554,12 @@ spec:
reconciliation. reconciliation.
properties: properties:
checksum: checksum:
description: Checksum is the SHA256 checksum of the Artifact file. description: 'Checksum is the SHA256 checksum of the Artifact
file. Deprecated: use Artifact.Digest instead.'
type: string
digest:
description: Digest is the digest of the file in the form of '<algorithm>:<checksum>'.
pattern: ^[a-z0-9]+(?:[.+_-][a-z0-9]+)*:[a-zA-Z0-9=_-]+$
type: string type: string
lastUpdateTime: lastUpdateTime:
description: LastUpdateTime is the timestamp corresponding to description: LastUpdateTime is the timestamp corresponding to
@ -676,8 +681,13 @@ spec:
description: Artifact represents the output of a Source reconciliation. description: Artifact represents the output of a Source reconciliation.
properties: properties:
checksum: checksum:
description: Checksum is the SHA256 checksum of the Artifact description: 'Checksum is the SHA256 checksum of the Artifact
file. file. Deprecated: use Artifact.Digest instead.'
type: string
digest:
description: Digest is the digest of the file in the form of
'<algorithm>:<checksum>'.
pattern: ^[a-z0-9]+(?:[.+_-][a-z0-9]+)*:[a-zA-Z0-9=_-]+$
type: string type: string
lastUpdateTime: lastUpdateTime:
description: LastUpdateTime is the timestamp corresponding to description: LastUpdateTime is the timestamp corresponding to

View File

@ -452,7 +452,12 @@ spec:
reconciliation. reconciliation.
properties: properties:
checksum: checksum:
description: Checksum is the SHA256 checksum of the Artifact file. description: 'Checksum is the SHA256 checksum of the Artifact
file. Deprecated: use Artifact.Digest instead.'
type: string
digest:
description: Digest is the digest of the file in the form of '<algorithm>:<checksum>'.
pattern: ^[a-z0-9]+(?:[.+_-][a-z0-9]+)*:[a-zA-Z0-9=_-]+$
type: string type: string
lastUpdateTime: lastUpdateTime:
description: LastUpdateTime is the timestamp corresponding to description: LastUpdateTime is the timestamp corresponding to

View File

@ -369,7 +369,12 @@ spec:
reconciliation. reconciliation.
properties: properties:
checksum: checksum:
description: Checksum is the SHA256 checksum of the Artifact file. description: 'Checksum is the SHA256 checksum of the Artifact
file. Deprecated: use Artifact.Digest instead.'
type: string
digest:
description: Digest is the digest of the file in the form of '<algorithm>:<checksum>'.
pattern: ^[a-z0-9]+(?:[.+_-][a-z0-9]+)*:[a-zA-Z0-9=_-]+$
type: string type: string
lastUpdateTime: lastUpdateTime:
description: LastUpdateTime is the timestamp corresponding to description: LastUpdateTime is the timestamp corresponding to

View File

@ -195,7 +195,12 @@ spec:
OCI Repository sync. OCI Repository sync.
properties: properties:
checksum: checksum:
description: Checksum is the SHA256 checksum of the Artifact file. description: 'Checksum is the SHA256 checksum of the Artifact
file. Deprecated: use Artifact.Digest instead.'
type: string
digest:
description: Digest is the digest of the file in the form of '<algorithm>:<checksum>'.
pattern: ^[a-z0-9]+(?:[.+_-][a-z0-9]+)*:[a-zA-Z0-9=_-]+$
type: string type: string
lastUpdateTime: lastUpdateTime:
description: LastUpdateTime is the timestamp corresponding to description: LastUpdateTime is the timestamp corresponding to

View File

@ -1253,7 +1253,20 @@ string
</td> </td>
<td> <td>
<em>(Optional)</em> <em>(Optional)</em>
<p>Checksum is the SHA256 checksum of the Artifact file.</p> <p>Checksum is the SHA256 checksum of the Artifact file.
Deprecated: use Artifact.Digest instead.</p>
</td>
</tr>
<tr>
<td>
<code>digest</code><br>
<em>
string
</em>
</td>
<td>
<em>(Optional)</em>
<p>Digest is the digest of the file in the form of &lsquo;<algorithm>:<checksum>&rsquo;.</p>
</td> </td>
</tr> </tr>
<tr> <tr>