Skip to content

[feature] InjectPodAnnotationsΒ #14

@elithrar

Description

@elithrar

Provide a way to inject annotations into a Pod on admission:

  • Accept a map[string]func(*corev1.Pod) string argument so that the user can build names based on the Pod attributes (ObjectMeta, PodSpec, etc)
  • Use https://github.com/evanphx/json-patch for testing: take a Pod, serialize, apply the patch, and deserialize again to verify the injected annotations were applied.
  • Add a sample MutatingWebhookConfiguration to demonstrate usage.

Alternatively we could just provide a metav1.ObjectMeta to the user/caller, which might be sufficient for any dynamic annotation generation & more stable (w.r.t. API changes).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions