Skip to content

Commit 8d23f40

Browse files
committed
Cover signingKey round-trip in export tests
Extends the existing TestExport 'image update' case with a signingKey block on the seeded ImageUpdateAutomation, asserting the new field survives the kubeClient.Get + serialize path. Parallels how the existing fixture exercises every other field on the resource. Also patches the embedded CRD source under manifests/bases/image- automation-controller/ to inject the signingKey.type schema property into both v1 and v1beta2. The patch is transitional and should be removed once the image-automation-controller release bundle includes the new type field natively. Signed-off-by: Hidde Beydals <hidde@hhh.computer>
1 parent d7a6c0c commit 8d23f40

4 files changed

Lines changed: 36 additions & 0 deletions

File tree

cmd/flux/testdata/export/image-update.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ spec:
1010
author:
1111
email: fluxcdbot@users.noreply.github.com
1212
name: fluxcdbot
13+
signingKey:
14+
secretRef:
15+
name: my-signing-key
16+
type: ssh
1317
interval: 1m0s
1418
sourceRef:
1519
kind: GitRepository

cmd/flux/testdata/export/objects.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ spec:
6767
email: fluxcdbot@users.noreply.github.com
6868
name: fluxcdbot
6969
messageTemplate: '{{range .Updated.Images}}{{println .}}{{end}}'
70+
signingKey:
71+
secretRef:
72+
name: my-signing-key
73+
type: ssh
7074
update:
7175
path: ./clusters/my-cluster
7276
strategy: Setters
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
- op: add
2+
path: /spec/versions/0/schema/openAPIV3Schema/properties/spec/properties/git/properties/commit/properties/signingKey/properties/type
3+
value:
4+
default: gpg
5+
description: |-
6+
Type selects the signing-key format expected in the referenced
7+
Secret. Defaults to 'gpg'.
8+
enum:
9+
- gpg
10+
- ssh
11+
type: string
12+
- op: add
13+
path: /spec/versions/1/schema/openAPIV3Schema/properties/spec/properties/git/properties/commit/properties/signingKey/properties/type
14+
value:
15+
default: gpg
16+
description: |-
17+
Type selects the signing-key format expected in the referenced
18+
Secret. Defaults to 'gpg'.
19+
enum:
20+
- gpg
21+
- ssh
22+
type: string

manifests/bases/image-automation-controller/kustomization.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ patches:
1313
kind: Deployment
1414
name: image-automation-controller
1515
path: patch.yaml
16+
- target:
17+
group: apiextensions.k8s.io
18+
version: v1
19+
kind: CustomResourceDefinition
20+
name: imageupdateautomations.image.toolkit.fluxcd.io
21+
path: crd-signing-key-type-patch.yaml

0 commit comments

Comments
 (0)