cdk8s-core icon indicating copy to clipboard operation
cdk8s-core copied to clipboard

Yaml Comments

Open Alwin-Stockinger opened this issue 1 year ago • 1 comments

Description of the feature or enhancement:

Make it possible to set comments that are rendered to specific yaml fields, something like:

metadata: {
  name: "awesome-deployment",
  nameComment:  "This is an awesome deployment"
}

should output

metadata:
  name: "awesome-deployment"  #This is an awesome deployment

Use Case:

Flux has a feature that allows you to automate image update. To enable this you have to mark the field with a yaml comment e.g.

apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
  name: podinfo
  namespace: default
spec:
  values:
    image:
      repository: ghcr.io/stefanprodan/podinfo # {"$imagepolicy": "flux-system:podinfo:name"}
      tag: 5.0.0  # {"$imagepolicy": "flux-system:podinfo:tag"}

See https://fluxcd.io/flux/guides/image-update/#configure-image-update-for-custom-resources for explanation

Proposed Solution:

Something like mentioned above in the description.

This is a :rocket: Feature Request

Alwin-Stockinger avatar Feb 12 '24 08:02 Alwin-Stockinger