From 622a6563ebdeba80f209e40e63efec88daec1c29 Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Tue, 10 Dec 2024 15:04:39 +0100 Subject: [PATCH] feat(directives): optional `images` for `kustomize-set-image` Signed-off-by: Hidde Beydals --- .../directives/schemas/kustomize-set-image-config.json | 4 +--- internal/directives/zz_config_types.go | 7 +++++-- ui/src/gen/directives/kustomize-set-image-config.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/internal/directives/schemas/kustomize-set-image-config.json b/internal/directives/schemas/kustomize-set-image-config.json index aa2a44ba3..6074d117a 100644 --- a/internal/directives/schemas/kustomize-set-image-config.json +++ b/internal/directives/schemas/kustomize-set-image-config.json @@ -12,12 +12,10 @@ }, "images": { "type": "array", - "description": "Images is a list of container images to set or update in the Kustomization file.", - "minItems": 1, + "description": "Images is a list of container images to set or update in the Kustomization file. When left unspecified, all images from the Freight collection will be set in the Kustomization file. Unless there is an ambiguous image name (for example, due to two Warehouses subscribing to the same repository)q, which requires manual configuration.", "items": { "type": "object", "additionalProperties": false, - "required": ["image"], "properties": { "digest": { "type": "string", diff --git a/internal/directives/zz_config_types.go b/internal/directives/zz_config_types.go index 2d8812f47..5537de73b 100644 --- a/internal/directives/zz_config_types.go +++ b/internal/directives/zz_config_types.go @@ -378,7 +378,10 @@ type Helm struct { } type KustomizeSetImageConfig struct { - // Images is a list of container images to set or update in the Kustomization file. + // Images is a list of container images to set or update in the Kustomization file. When + // left unspecified, all images from the Freight collection will be set in the Kustomization + // file. Unless there is an ambiguous image name (for example, due to two Warehouses + // subscribing to the same repository), which requires manual configuration. Images []KustomizeSetImageConfigImage `json:"images"` // Path to the directory containing the Kustomization file. Path string `json:"path"` @@ -391,7 +394,7 @@ type KustomizeSetImageConfigImage struct { FromOrigin *ChartFromOrigin `json:"fromOrigin,omitempty"` // Image name of the repository from which to pick the version. This is the image name Kargo // is subscribed to, and produces Freight for. - Image string `json:"image"` + Image string `json:"image,omitempty"` // Name of the image (as defined in the Kustomization file). Name string `json:"name,omitempty"` // NewName for the image. This can be used to rename the container image name in the diff --git a/ui/src/gen/directives/kustomize-set-image-config.json b/ui/src/gen/directives/kustomize-set-image-config.json index 8146ef8d0..9a7dd7f6d 100644 --- a/ui/src/gen/directives/kustomize-set-image-config.json +++ b/ui/src/gen/directives/kustomize-set-image-config.json @@ -11,7 +11,7 @@ }, "images": { "type": "array", - "description": "Images is a list of container images to set or update in the Kustomization file.", + "description": "Images is a list of container images to set or update in the Kustomization file. When left unspecified, all images from the Freight collection will be set in the Kustomization file. Unless there is an ambiguous image name (for example, due to two Warehouses subscribing to the same repository), which requires manual configuration.", "items": { "type": "object", "additionalProperties": false,