forked from kubeflow/kubeflow
-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
Proposal
Based on discussion in PR #663, there are two potential improvements to the formatKeyName function in components/odh-notebook-controller/controllers/notebook_runtime.go:
1. Move .json suffix addition up in the call chain
Currently, the .json suffix is added within the formatKeyName function. The proposal is to:
- Remove the
.jsonsuffix fromformatKeyName - Add it at the call site:
data[formattedName + ".json"] = metadataParsed
2. Rename function for better reusability
Rename formatKeyName to sanitizeName to make it more generic and potentially reusable in other parts of the codebase.
Benefits
- Separation of concerns: the sanitization logic is separate from the specific
.jsonsuffix requirement - Better reusability: a generic
sanitizeNamefunction could be used elsewhere - Clearer intent: the function name would better reflect its generic sanitization purpose
References
- Original discussion: Improve formatKeyName function to handle all invalid ConfigMap key characters #663 (comment)
- Related PR: Improve formatKeyName function to handle all invalid ConfigMap key characters #663
Requested by: @jstourac
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels