Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE]: Allow downstream templating of the annotations based on the annotated resource #13

Open
shanduur opened this issue Sep 29, 2024 · 0 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.

Comments

@shanduur
Copy link
Contributor

shanduur commented Sep 29, 2024

Is your feature request related to a problem? Please describe.

Currently, the annotations propagated by Scribe are static and do not adapt to the context of the resources they are applied to. This can be limiting when dealing with dynamic annotations that need to reflect the specific attributes of each resource (e.g., resource name, namespace).

Describe the solution you'd like.

I would like the ability to use templating within annotations so that the values can be dynamically populated based on the annotated resource's metadata or spec fields. For example, annotations could make use of Go templating syntax to reference metadata fields, such as the resource's name.

Example:

apiVersion: v1
kind: Namespace
metadata:
  name: example
  annotations:
    # annotations below will be propagated to all resources
    # observed by the scribe controller - e.g. Deployments
    scribe.anza-labs.dev/annotations: |
      app.kubernetes.io/name={{ .metadata.name }}

Result:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: example-deployment
  annotations:
    app.kubernetes.io/name: example-deployment

Describe alternatives you've considered.

N/A

Additional Information

No response

@shanduur shanduur added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. labels Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

1 participant