Skip to content

Conversation

@volodymyrZotov
Copy link
Contributor

✨ Summary

K8s throws an error if data key in k8s secret doesn't match [-._a-zA-Z0-9]+ regexp. (IsConfigMap method).

The empty string "" keys are considered invalid as well.

In the current implementation formatSecretDataName will return empty string if the key (field or url label) contains invalid characters, for example (#### or " "). Therefore it tries to add the entry into k8s secret.data with key as empty string. This leads operator to throw an error.

This PR fixes this behaviour, and if formatSecretDataName returns empty string (aka label was in the format that k8s doesn't support), operator will print the message in the log and skip adding the entry (field, url or file) into k8s secret.

🔗 Resolves: #243

✅ Checklist

  • 🖊️ Commits are signed
  • 🧪 Tests added/updated: (See the Testing Guide for when to use each type and how to run them)
    • 🔹 Unit
    • 🔸 Integration
    • 🌐 E2E (Connect)
    • 🔑 E2E (Service Account)
  • 📚 Docs updated (if behavior changed)

🕵️ Review Notes & ⚠️ Risks

Copy link
Contributor

@JillRegan JillRegan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix! 🙏

@volodymyrZotov volodymyrZotov merged commit 1b924b2 into main Jan 22, 2026
7 checks passed
@volodymyrZotov volodymyrZotov deleted the vzt/empty-url-label-fix branch January 22, 2026 20:21
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.

Empty URL labels cause secret creation to fail

3 participants