ChristofferNissen / helmper

Import Helm Charts to OCI registries, optionally with vulnerability patching
https://christoffernissen.github.io/helmper/
Apache License 2.0
140 stars 5 forks source link

[feat] add feature to import user defined images #49

Closed ChristofferNissen closed 3 months ago

ChristofferNissen commented 3 months ago

Add option to define extra images to be included in import flow

Images are defined in helmper.yaml

images:
- ref: docker.io/library/helloworld:latest
- ref: docker.io/library/redis:latest
  patch: false

Closes #39

Introduce flag to let the user decide if they want to take values from user defined values.yaml during Helmper Image parsing.

parser:
  useCustomValues: false

This flag is intended to allow users to overwrite certain images if they know that the correct image is not in the default chart values. One example is Cilium, which has the following section to define cilium-operator:

operator:
  # -- Enable the cilium-operator component (required).
  enabled: true
  # -- Roll out cilium-operator pods automatically when configmap is updated.
  rollOutPods: false
  # -- cilium-operator image.
  image:
    # @schema
    # type: [null, string]
    # @schema
    override: ~
    repository: "quay.io/cilium/operator"
    tag: "v1.16.0-rc.0"
    # operator-generic-digest
    genericDigest: "sha256:78b9951cd6d92e7c954b9d7d2791cf52c83895441147deec3906c03363fd1169"
    # operator-azure-digest
    azureDigest: "sha256:388192c967442fbfa791e152df1bfa55ff0d2ebcdbc57bb4b3f52c58dd8eb64e"
    # operator-aws-digest
    awsDigest: "sha256:4724f2420488e73a2191a80ab190ab0efe6f2ca15f4b552d1f2ee1870bb8b0c2"
    # operator-alibabacloud-digest
    alibabacloudDigest: "sha256:b5e2ee8de5345bfaee60d279ec5e010c724d33c9f6a66b58c29d5500300caf56"
    useDigest: true
    pullPolicy: "IfNotPresent"
    suffix: ""

This results in Helmper imports quay.io/cilium/operator but the deployment actually uses quay.io/cilium/operator-generic (due to helpers file on helm template)

With this flag, users can overwrite the image from a values.yaml

operator:
  image:
    repository: "quay.io/cilium/operator-generic"

Closes #50