Skip to content

Allow configuring additional annotations on the generated workload - #92

Draft
martin-briatka wants to merge 1 commit into
SAP:mainfrom
martin-briatka:feat/workload-annotations
Draft

martin-briatka wants to merge 1 commit into
SAP:mainfrom
martin-briatka:feat/workload-annotations

Conversation

@martin-briatka

@martin-briatka martin-briatka commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add a spec.annotations (map[string]string) field. The operator merges its entries onto the metadata of every generated StatefulSet (primary, replica and sentinel), so users can attach arbitrary annotations to the workload.

The merge is performed in the operator (a generator wrapper), not in the chart templates, so it is independent of the vendored chart — the same way TopologySpreadConstraints are already injected today. The field is empty by default, so existing deployments are unaffected.

spec:
  annotations:
    example.io/some-annotation: "value"

Changes

  • api/v1alpha1/types.go — Annotations map[string]string on ValkeySpec
  • internal/transformer/annotation_generator.go — generator wrapper that reads spec.annotations and merges them onto every generated StatefulSet's metadata
  • pkg/operator/operator.go — wrap the resource generator with the annotation generator
  • api/v1alpha1/zz_generated.deepcopy.go + crds/cache.cs.sap.com_valkeys.yaml — regenerated via make manifests generate

Testing

  • go build and go vet clean.

@martin-briatka
martin-briatka force-pushed the feat/workload-annotations branch 2 times, most recently from 30b2b84 to 03c8dcf Compare November 9, 2026 13:32
Add a spec.annotations (map[string]string) field. The operator merges its
entries onto the metadata of every generated StatefulSet. The merge is done
in the operator rather than in the chart templates, so it is independent of
the vendored chart. The field is empty by default, so existing deployments
are unaffected.
@martin-briatka
martin-briatka force-pushed the feat/workload-annotations branch from 03c8dcf to a430f76 Compare November 9, 2026 13:47

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant