Skip to content

Commit eb4a38e

Browse files
committed
spec: show RFC-0005 format and digest in examples
Signed-off-by: Hidde Beydals <[email protected]>
1 parent ccad359 commit eb4a38e

File tree

5 files changed

+56
-32
lines changed

5 files changed

+56
-32
lines changed

docs/spec/v1beta2/buckets.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ In the above example:
4848
- A list of object keys and their [etags](https://en.wikipedia.org/wiki/HTTP_ETag)
4949
in the `.spec.bucketName` bucket is compiled, while filtering the keys using
5050
[default ignore rules](#default-exclusions).
51-
- The SHA256 sum of the list is used as Artifact revision, reported
52-
in-cluster in the `.status.artifact.revision` field.
51+
- The digest (algorithm defaults to SHA256) of the list is used as Artifact
52+
revision, reported in-cluster in the `.status.artifact.revision` field.
5353
- When the current Bucket revision differs from the latest calculated revision,
5454
all objects are fetched and archived.
5555
- The new Artifact is reported in the `.status.artifact` field.
@@ -71,7 +71,7 @@ control over.
7171

7272
```console
7373
NAME ENDPOINT AGE READY STATUS
74-
minio-bucket minio.example.com 34s True stored artifact for revision 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
74+
minio-bucket minio.example.com 34s True stored artifact for revision 'sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
7575
```
7676

7777
3. Run `kubectl describe bucket minio-bucket` to see the [Artifact](#artifact)
@@ -82,19 +82,21 @@ control over.
8282
Status:
8383
Artifact:
8484
Checksum: 72aa638abb455ca5f9ef4825b949fd2de4d4be0a74895bf7ed2338622cd12686
85+
Digest: sha256:72aa638abb455ca5f9ef4825b949fd2de4d4be0a74895bf7ed2338622cd12686
8586
Last Update Time: 2022-02-01T23:43:38Z
8687
Path: bucket/default/minio-bucket/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.tar.gz
87-
Revision: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
88+
Revision: sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
89+
Size: 38099
8890
URL: http://source-controller.source-system.svc.cluster.local./bucket/default/minio-bucket/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.tar.gz
8991
Conditions:
9092
Last Transition Time: 2022-02-01T23:43:38Z
91-
Message: stored artifact for revision 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
93+
Message: stored artifact for revision 'sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
9294
Observed Generation: 1
9395
Reason: Succeeded
9496
Status: True
9597
Type: Ready
9698
Last Transition Time: 2022-02-01T23:43:38Z
97-
Message: stored artifact for revision 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
99+
Message: stored artifact for revision 'sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
98100
Observed Generation: 1
99101
Reason: Succeeded
100102
Status: True
@@ -104,7 +106,7 @@ control over.
104106
Events:
105107
Type Reason Age From Message
106108
---- ------ ---- ---- -------
107-
Normal NewArtifact 82s source-controller fetched 16 files from 'example'
109+
Normal NewArtifact 82s source-controller stored artifact with 16 fetched files from 'example' bucket
108110
```
109111

110112
## Writing a Bucket spec
@@ -906,7 +908,7 @@ lists
906908
```console
907909
LAST SEEN TYPE REASON OBJECT MESSAGE
908910
2m30s Normal NewArtifact bucket/<bucket-name> fetched 16 files with revision from 'my-new-bucket'
909-
36s Normal ArtifactUpToDate bucket/<bucket-name> artifact up-to-date with remote revision: 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
911+
36s Normal ArtifactUpToDate bucket/<bucket-name> artifact up-to-date with remote revision: 'sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
910912
18s Warning BucketOperationFailed bucket/<bucket-name> bucket 'my-new-bucket' does not exist
911913
```
912914

@@ -936,9 +938,11 @@ metadata:
936938
status:
937939
artifact:
938940
checksum: cbec34947cc2f36dee8adcdd12ee62ca6a8a36699fc6e56f6220385ad5bd421a
941+
digest: sha256:cbec34947cc2f36dee8adcdd12ee62ca6a8a36699fc6e56f6220385ad5bd421a
939942
lastUpdateTime: "2022-01-28T10:30:30Z"
940943
path: bucket/<namespace>/<bucket-name>/c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2.tar.gz
941-
revision: c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2
944+
revision: sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2
945+
size: 38099
942946
url: http://source-controller.<namespace>.svc.cluster.local./bucket/<namespace>/<bucket-name>/c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2.tar.gz
943947
```
944948

docs/spec/v1beta2/gitrepositories.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ You can run this example by saving the manifest into `gitrepository.yaml`.
4949

5050
```console
5151
NAME URL AGE READY STATUS
52-
podinfo https://github.com/stefanprodan/podinfo 5s True stored artifact for revision 'master/132f4e719209eb10b9485302f8593fc0e680f4fc'
52+
podinfo https://github.com/stefanprodan/podinfo 5s True stored artifact for revision 'master@sha1:132f4e719209eb10b9485302f8593fc0e680f4fc'
5353
```
5454

5555
3. Run `kubectl describe gitrepository podinfo` to see the [Artifact](#artifact)
@@ -60,19 +60,21 @@ You can run this example by saving the manifest into `gitrepository.yaml`.
6060
Status:
6161
Artifact:
6262
Checksum: 95e386f421272710c4cedbbd8607dbbaa019d500e7a5a0b6720bc7bebefc7bf2
63+
Digest: sha256:95e386f421272710c4cedbbd8607dbbaa019d500e7a5a0b6720bc7bebefc7bf2
6364
Last Update Time: 2022-02-14T11:23:36Z
6465
Path: gitrepository/default/podinfo/132f4e719209eb10b9485302f8593fc0e680f4fc.tar.gz
65-
Revision: master/132f4e719209eb10b9485302f8593fc0e680f4fc
66+
Revision: master@sha1:132f4e719209eb10b9485302f8593fc0e680f4fc
67+
Size: 91318
6668
URL: http://source-controller.source-system.svc.cluster.local./gitrepository/default/podinfo/132f4e719209eb10b9485302f8593fc0e680f4fc.tar.gz
6769
Conditions:
6870
Last Transition Time: 2022-02-14T11:23:36Z
69-
Message: stored artifact for revision 'master/132f4e719209eb10b9485302f8593fc0e680f4fc'
71+
Message: stored artifact for revision 'master@sha1:132f4e719209eb10b9485302f8593fc0e680f4fc'
7072
Observed Generation: 1
7173
Reason: Succeeded
7274
Status: True
7375
Type: Ready
7476
Last Transition Time: 2022-02-14T11:23:36Z
75-
Message: stored artifact for revision 'master/132f4e719209eb10b9485302f8593fc0e680f4fc'
77+
Message: stored artifact for revision 'master@sha1:132f4e719209eb10b9485302f8593fc0e680f4fc'
7678
Observed Generation: 1
7779
Reason: Succeeded
7880
Status: True
@@ -670,7 +672,7 @@ lists
670672
```console
671673
LAST SEEN TYPE REASON OBJECT MESSAGE
672674
2m14s Normal NewArtifact gitrepository/<repository-name> stored artifact for commit 'Merge pull request #160 from stefanprodan/release-6.0.3'
673-
36s Normal ArtifactUpToDate gitrepository/<repository-name> artifact up-to-date with remote revision: 'master/132f4e719209eb10b9485302f8593fc0e680f4fc'
675+
36s Normal ArtifactUpToDate gitrepository/<repository-name> artifact up-to-date with remote revision: 'master@sha1:132f4e719209eb10b9485302f8593fc0e680f4fc'
674676
94s Warning GitOperationFailed gitrepository/<repository-name> failed to checkout and determine revision: unable to clone 'https://github.com/stefanprodan/podinfo': couldn't find remote ref "refs/heads/invalid"
675677
```
676678

@@ -700,9 +702,11 @@ metadata:
700702
status:
701703
artifact:
702704
checksum: e750c7a46724acaef8f8aa926259af30bbd9face2ae065ae8896ba5ee5ab832b
705+
digest: sha256:e750c7a46724acaef8f8aa926259af30bbd9face2ae065ae8896ba5ee5ab832b
703706
lastUpdateTime: "2022-01-29T06:59:23Z"
704707
path: gitrepository/<namespace>/<repository-name>/c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2.tar.gz
705-
revision: master/363a6a8fe6a7f13e05d34c163b0ef02a777da20a
708+
revision: master@sha1:363a6a8fe6a7f13e05d34c163b0ef02a777da20a
709+
size: 91318
706710
url: http://source-controller.<namespace>.svc.cluster.local./gitrepository/<namespace>/<repository-name>/363a6a8fe6a7f13e05d34c163b0ef02a777da20a.tar.gz
707711
```
708712

docs/spec/v1beta2/helmcharts.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,14 @@ helm-controller.
6565

6666
```console
6767
Status:
68-
Observed Source Artifact Revision: 83a3c595163a6ff0333e0154c790383b5be441b9db632cb36da11db1c4ece111
68+
Observed Source Artifact Revision: sha256:83a3c595163a6ff0333e0154c790383b5be441b9db632cb36da11db1c4ece111
6969
Artifact:
7070
Checksum: 6c3cc3b955bce1686036ae6822ee2ca0ef6ecb994e3f2d19eaf3ec03dcba84b3
71+
Digest: sha256:6c3cc3b955bce1686036ae6822ee2ca0ef6ecb994e3f2d19eaf3ec03dcba84b3
7172
Last Update Time: 2022-02-13T11:24:10Z
7273
Path: helmchart/default/podinfo/podinfo-5.2.1.tgz
7374
Revision: 5.2.1
75+
Size: 14166
7476
URL: http://source-controller.flux-system.svc.cluster.local./helmchart/default/podinfo/podinfo-5.2.1.tgz
7577
Conditions:
7678
Last Transition Time: 2022-02-13T11:24:10Z
@@ -555,9 +557,11 @@ metadata:
555557
status:
556558
artifact:
557559
checksum: e30b95a08787de69ffdad3c232d65cfb131b5b50c6fd44295f48a078fceaa44e
560+
digest: sha256:e30b95a08787de69ffdad3c232d65cfb131b5b50c6fd44295f48a078fceaa44e
558561
lastUpdateTime: "2022-02-10T18:53:47Z"
559562
path: helmchart/<source-namespace>/<chart-name>/<chart-name>-<chart-version>.tgz
560563
revision: 6.0.3
564+
size: 14166
561565
url: http://source-controller.flux-system.svc.cluster.local./helmchart/<source-namespace>/<chart-name>/<chart-name>-<chart-version>.tgz
562566
```
563567

@@ -576,9 +580,11 @@ metadata:
576580
status:
577581
artifact:
578582
checksum: ee68224ded207ebb18a8e9730cf3313fa6bc1f31e6d8d3943ab541113559bb52
583+
digest: sha256:ee68224ded207ebb18a8e9730cf3313fa6bc1f31e6d8d3943ab541113559bb52
579584
lastUpdateTime: "2022-02-28T08:07:12Z"
580585
path: helmchart/<source-namespace>/<chart-name>/<chart-name>-6.0.3+1.tgz
581586
revision: 6.0.3+1
587+
size: 14166
582588
url: http://source-controller.flux-system.svc.cluster.local./helmchart/<source-namespace>/<chart-name>/<chart-name>-6.0.3+1.tgz
583589
observedGeneration: 1
584590
...
@@ -600,9 +606,11 @@ metadata:
600606
status:
601607
artifact:
602608
checksum: 8d1f0ac3f4b0e8759a32180086f17ac87ca04e5d46c356e67f97e97616ef4718
609+
digest: sha256:8d1f0ac3f4b0e8759a32180086f17ac87ca04e5d46c356e67f97e97616ef4718
603610
lastUpdateTime: "2022-02-28T08:07:12Z"
604611
path: helmchart/<source-namespace>/<chart-name>/<chart-name>-6.0.3+4e5cbb7b97d0.tgz
605612
revision: 6.0.3+4e5cbb7b97d0
613+
size: 14166
606614
url: http://source-controller.flux-system.svc.cluster.local./helmchart/<source-namespace>/<chart-name>/<chart-name>-6.0.3+4e5cbb7b97d0.tgz
607615
```
608616

docs/spec/v1beta2/helmrepositories.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ In the above example:
3434
- The source-controller fetches the Helm repository index YAML every five
3535
minutes from `https://stefanprodan.github.io/podinfo`, indicated by the
3636
`.spec.interval` and `.spec.url` fields.
37-
- The SHA256 sum of the Helm repository index after stable sorting the entries
38-
is used as Artifact revision, reported in-cluster in the
39-
`.status.artifact.revision` field.
37+
- The digest (algorithm defaults to SHA256) of the Helm repository index after
38+
stable sorting the entries is used as Artifact revision, reported in-cluster
39+
in the `.status.artifact.revision` field.
4040
- When the current HelmRepository revision differs from the latest fetched
4141
revision, it is stored as a new Artifact.
4242
- The new Artifact is reported in the `.status.artifact` field.
@@ -53,7 +53,7 @@ You can run this example by saving the manifest into `helmrepository.yaml`.
5353

5454
```console
5555
NAME URL AGE READY STATUS
56-
podinfo https://stefanprodan.github.io/podinfo 4s True stored artifact for revision '83a3c595163a6ff0333e0154c790383b5be441b9db632cb36da11db1c4ece111'
56+
podinfo https://stefanprodan.github.io/podinfo 4s True stored artifact for revision 'sha256:83a3c595163a6ff0333e0154c790383b5be441b9db632cb36da11db1c4ece111'
5757
```
5858

5959
3. Run `kubectl describe helmrepository podinfo` to see the [Artifact](#artifact)
@@ -64,19 +64,21 @@ You can run this example by saving the manifest into `helmrepository.yaml`.
6464
Status:
6565
Artifact:
6666
Checksum: 83a3c595163a6ff0333e0154c790383b5be441b9db632cb36da11db1c4ece111
67+
Digest: sha256:83a3c595163a6ff0333e0154c790383b5be441b9db632cb36da11db1c4ece111
6768
Last Update Time: 2022-02-04T09:55:58Z
6869
Path: helmrepository/default/podinfo/index-83a3c595163a6ff0333e0154c790383b5be441b9db632cb36da11db1c4ece111.yaml
69-
Revision: 83a3c595163a6ff0333e0154c790383b5be441b9db632cb36da11db1c4ece111
70+
Revision: sha256:83a3c595163a6ff0333e0154c790383b5be441b9db632cb36da11db1c4ece111
71+
Size: 40898
7072
URL: http://source-controller.flux-system.svc.cluster.local./helmrepository/default/podinfo/index-83a3c595163a6ff0333e0154c790383b5be441b9db632cb36da11db1c4ece111.yaml
7173
Conditions:
7274
Last Transition Time: 2022-02-04T09:55:58Z
73-
Message: stored artifact for revision '83a3c595163a6ff0333e0154c790383b5be441b9db632cb36da11db1c4ece111'
75+
Message: stored artifact for revision 'sha256:83a3c595163a6ff0333e0154c790383b5be441b9db632cb36da11db1c4ece111'
7476
Observed Generation: 1
7577
Reason: Succeeded
7678
Status: True
7779
Type: Ready
7880
Last Transition Time: 2022-02-04T09:55:58Z
79-
Message: stored artifact for revision '83a3c595163a6ff0333e0154c790383b5be441b9db632cb36da11db1c4ece111'
81+
Message: stored artifact for revision 'sha256:83a3c595163a6ff0333e0154c790383b5be441b9db632cb36da11db1c4ece111'
8082
Observed Generation: 1
8183
Reason: Succeeded
8284
Status: True
@@ -609,7 +611,7 @@ lists
609611
LAST SEEN TYPE REASON OBJECT MESSAGE
610612
107s Warning Failed helmrepository/<repository-name> failed to construct Helm client: scheme "invalid" not supported
611613
7s Normal NewArtifact helmrepository/<repository-name> fetched index of size 30.88kB from 'https://stefanprodan.github.io/podinfo'
612-
3s Normal ArtifactUpToDate helmrepository/<repository-name> artifact up-to-date with remote revision: '83a3c595163a6ff0333e0154c790383b5be441b9db632cb36da11db1c4ece111'
614+
3s Normal ArtifactUpToDate helmrepository/<repository-name> artifact up-to-date with remote revision: 'sha256:83a3c595163a6ff0333e0154c790383b5be441b9db632cb36da11db1c4ece111'
613615
```
614616

615617
Besides being reported in Events, the reconciliation errors are also logged by
@@ -640,9 +642,11 @@ metadata:
640642
status:
641643
artifact:
642644
checksum: 83a3c595163a6ff0333e0154c790383b5be441b9db632cb36da11db1c4ece111
645+
digest: sha256:83a3c595163a6ff0333e0154c790383b5be441b9db632cb36da11db1c4ece111
643646
lastUpdateTime: "2022-02-04T09:55:58Z"
644647
path: helmrepository/<namespace>/<repository-name>/index-83a3c595163a6ff0333e0154c790383b5be441b9db632cb36da11db1c4ece111.yaml
645-
revision: 83a3c595163a6ff0333e0154c790383b5be441b9db632cb36da11db1c4ece111
648+
revision: sha256:83a3c595163a6ff0333e0154c790383b5be441b9db632cb36da11db1c4ece111
649+
size: 40898
646650
url: http://source-controller.flux-system.svc.cluster.local./helmrepository/<namespace>/<repository-name>/index-83a3c595163a6ff0333e0154c790383b5be441b9db632cb36da11db1c4ece111.yaml
647651
```
648652

0 commit comments

Comments
 (0)