Skip to content

Commit 964b2d3

Browse files
committed
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 <[email protected]>
1 parent d18988e commit 964b2d3

7 files changed

+58
-9
lines changed

api/v1beta2/artifact_types.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,14 @@ type Artifact struct {
4343
Revision string `json:"revision"`
4444

4545
// Checksum is the SHA256 checksum of the Artifact file.
46+
// Deprecated: use Artifact.Digest instead.
4647
// +optional
47-
Checksum string `json:"checksum"`
48+
Checksum string `json:"checksum,omitempty"`
49+
50+
// Digest is the digest of the file in the form of '<algorithm>:<checksum>'.
51+
// +optional
52+
// +kubebuilder:validation:Pattern="^[a-z0-9]+(?:[.+_-][a-z0-9]+)*:[a-zA-Z0-9=_-]+$"
53+
Digest string `json:"digest"`
4854

4955
// LastUpdateTime is the timestamp corresponding to the last update of the
5056
// Artifact.

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,12 @@ spec:
377377
description: Artifact represents the last successful Bucket reconciliation.
378378
properties:
379379
checksum:
380-
description: Checksum is the SHA256 checksum of the Artifact file.
380+
description: 'Checksum is the SHA256 checksum of the Artifact
381+
file. Deprecated: use Artifact.Digest instead.'
382+
type: string
383+
digest:
384+
description: Digest is the digest of the file in the form of '<algorithm>:<checksum>'.
385+
pattern: ^[a-z0-9]+(?:[.+_-][a-z0-9]+)*:[a-zA-Z0-9=_-]+$
381386
type: string
382387
lastUpdateTime:
383388
description: LastUpdateTime is the timestamp corresponding to

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,12 @@ spec:
554554
reconciliation.
555555
properties:
556556
checksum:
557-
description: Checksum is the SHA256 checksum of the Artifact file.
557+
description: 'Checksum is the SHA256 checksum of the Artifact
558+
file. Deprecated: use Artifact.Digest instead.'
559+
type: string
560+
digest:
561+
description: Digest is the digest of the file in the form of '<algorithm>:<checksum>'.
562+
pattern: ^[a-z0-9]+(?:[.+_-][a-z0-9]+)*:[a-zA-Z0-9=_-]+$
558563
type: string
559564
lastUpdateTime:
560565
description: LastUpdateTime is the timestamp corresponding to
@@ -676,8 +681,13 @@ spec:
676681
description: Artifact represents the output of a Source reconciliation.
677682
properties:
678683
checksum:
679-
description: Checksum is the SHA256 checksum of the Artifact
680-
file.
684+
description: 'Checksum is the SHA256 checksum of the Artifact
685+
file. Deprecated: use Artifact.Digest instead.'
686+
type: string
687+
digest:
688+
description: Digest is the digest of the file in the form of
689+
'<algorithm>:<checksum>'.
690+
pattern: ^[a-z0-9]+(?:[.+_-][a-z0-9]+)*:[a-zA-Z0-9=_-]+$
681691
type: string
682692
lastUpdateTime:
683693
description: LastUpdateTime is the timestamp corresponding to

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,12 @@ spec:
452452
reconciliation.
453453
properties:
454454
checksum:
455-
description: Checksum is the SHA256 checksum of the Artifact file.
455+
description: 'Checksum is the SHA256 checksum of the Artifact
456+
file. Deprecated: use Artifact.Digest instead.'
457+
type: string
458+
digest:
459+
description: Digest is the digest of the file in the form of '<algorithm>:<checksum>'.
460+
pattern: ^[a-z0-9]+(?:[.+_-][a-z0-9]+)*:[a-zA-Z0-9=_-]+$
456461
type: string
457462
lastUpdateTime:
458463
description: LastUpdateTime is the timestamp corresponding to

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,12 @@ spec:
369369
reconciliation.
370370
properties:
371371
checksum:
372-
description: Checksum is the SHA256 checksum of the Artifact file.
372+
description: 'Checksum is the SHA256 checksum of the Artifact
373+
file. Deprecated: use Artifact.Digest instead.'
374+
type: string
375+
digest:
376+
description: Digest is the digest of the file in the form of '<algorithm>:<checksum>'.
377+
pattern: ^[a-z0-9]+(?:[.+_-][a-z0-9]+)*:[a-zA-Z0-9=_-]+$
373378
type: string
374379
lastUpdateTime:
375380
description: LastUpdateTime is the timestamp corresponding to

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,12 @@ spec:
195195
OCI Repository sync.
196196
properties:
197197
checksum:
198-
description: Checksum is the SHA256 checksum of the Artifact file.
198+
description: 'Checksum is the SHA256 checksum of the Artifact
199+
file. Deprecated: use Artifact.Digest instead.'
200+
type: string
201+
digest:
202+
description: Digest is the digest of the file in the form of '<algorithm>:<checksum>'.
203+
pattern: ^[a-z0-9]+(?:[.+_-][a-z0-9]+)*:[a-zA-Z0-9=_-]+$
199204
type: string
200205
lastUpdateTime:
201206
description: LastUpdateTime is the timestamp corresponding to

docs/api/source.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,20 @@ string
12531253
</td>
12541254
<td>
12551255
<em>(Optional)</em>
1256-
<p>Checksum is the SHA256 checksum of the Artifact file.</p>
1256+
<p>Checksum is the SHA256 checksum of the Artifact file.
1257+
Deprecated: use Artifact.Digest instead.</p>
1258+
</td>
1259+
</tr>
1260+
<tr>
1261+
<td>
1262+
<code>digest</code><br>
1263+
<em>
1264+
string
1265+
</em>
1266+
</td>
1267+
<td>
1268+
<em>(Optional)</em>
1269+
<p>Digest is the digest of the file in the form of &lsquo;<algorithm>:<checksum>&rsquo;.</p>
12571270
</td>
12581271
</tr>
12591272
<tr>

0 commit comments

Comments
 (0)