Feature 1635 - customizing service name with prefix, flag --prefix (-x)#1833
Feature 1635 - customizing service name with prefix, flag --prefix (-x)#1833sosan wants to merge 13 commits intokubernetes:mainfrom
Conversation
…a prefix to add the default used in naming services. Added the appendPrefixName function, which takes a pointer to a KomposeObject and an array of prefixes. It appends the first prefix from the array to each service name in the KomposeObject after ensuring consistency using the cleanPrefix function. The cleanPrefix function ensures the format of prefixes, preventing issues with leading or trailing dashes affecting resulting service names. Add unit tests for 'appendPrefixName' and 'cleanPrefix' Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
…a prefix to add the default used in naming services. Added the appendPrefixName function, which takes a pointer to a KomposeObject and an array of prefixes. It appends the first prefix from the array to each service name in the KomposeObject after ensuring consistency using the cleanPrefix function. The cleanPrefix function ensures the format of prefixes, preventing issues with leading or trailing dashes affecting resulting service names. Add unit tests for 'appendPrefixName' and 'cleanPrefix' Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
|
@TessaIO shouldn't we have this as a label instead? or do you think CLI parameter would be fine? |
Yeah just thinking about it again, I think I'm good for terminal / cli based prefixes being added, we could always customize the name individually via labels instead. |
… local variables (prefixArray) from array to string Changed to function name: prependPrefixName Renamed tests to explain better tests behavior Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
|
Updated cli Sounds like a good idea to me. That way, we can fine-tune the names individually using labels |
TessaIO
left a comment
There was a problem hiding this comment.
Small comments are left below.
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sosan, TessaIO The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
…nged container name :( tests e2e, tests use case from terminal to use prefix complete user_guide.md with prefix -x changed architecture.md to comment new version interface Loader
cdrage
left a comment
There was a problem hiding this comment.
If we are going to add prefix, we should also add suffix...
I do not believe we should have -x either. Prefix and suffix should honestly be fixed after generation. I am not opposed to having this merged in as there is an issue opened for it, but we should also add suffix too.
ok, roger that |
|
ping @cdrage |
| convertCmd.Flags().BoolVar(&GenerateNetworkPolicies, "generate-network-policies", false, "Specify whether to generate network policies or not") | ||
|
|
||
| convertCmd.Flags().BoolVar(&WithKomposeAnnotation, "with-kompose-annotation", true, "Add kompose annotations to generated resource") | ||
| convertCmd.Flags().StringVarP(&GlobalPrefixAdd, "prefix", "x", "", "Adds a custom prefix to service names") |
There was a problem hiding this comment.
Remove -x please. Are you able to add suffix to this PR as well?
There was a problem hiding this comment.
Sure. Add a suffix with flag? Labels?
There was a problem hiding this comment.
Just flag like how you did it with suffix
There was a problem hiding this comment.
Actually honestly.... I'm not entirely sure why we need this. Thoughts @TessaIO
I think we are adding way too many labels or flags for just suffix : prefix naming.
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
fixed UnaddressableFieldAssign to function addPrefixToServiceName Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
|
Hey sorry @sosan for some reason I didn't realize that we reached a conclusion on #1635 (comment) that we should actually close this PR, and I apologize the work you've put into this back and forth. Going forward I do not think we should be adding too many suffix and prefix / name customizations unless it's "generic", if someone wants to edit the entire There's too much work and labels / parameters to be added to make something small like this happen. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
The --prefix flag serves the purpose of allowing users to specify prefixes to be added to the names of services
Which issue(s) this PR fixes:
Feature #1635
Special notes for your reviewer:
I haven't had time to document the --prefix flag
documentation will be cooming soon in the following commits.