-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes extra newline from confs #557
Closed
auniyal61
wants to merge
2
commits into
openstack-k8s-operators:main
from
auniyal61:remove-extra-newlines-from-confs
+248
−14
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
modules/common/util/testdata/templates/testservice/config/bar.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[DEFAULT] | ||
state_path = /var/lib/nova | ||
|
||
|
||
debug=true | ||
|
||
compute_driver = libvirt.LibvirtDriver | ||
|
||
|
||
[oslo_concurrency] | ||
lock_path = /var/lib/nova/tmp |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so we could likely proceed with this version for now
however how i would approach this is as follows
1 defince a new interface with one function which is takes a string and returns a string to post_process the rendered file.
instead of adding a bool here we would add a map of file exteion to interface object
then we would loop over all the files in the template and if there is registered post processor for that exteion in the map we can apply it to that specific file
we could also have a sentenal value for a default handleler if we want but i think that is likely not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that is close to my suggestion/question 1 above. #557 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by hte way the key could be a regex instead of an extnetion allowing mapping the handler to either a file or set of files.
this would just be applied to the keys for the config map/serecte but that might be overkill.
its simple to do and reason about however so we might just want to do it now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep more or less
i think breaking up the templates and configmap logic ectra will be a lot more work
we can do that eventually but for now i think this would be a minimal change to the existing proposal that we can extend with minimal impact on other operators
and in the future if we want to do that larger refactor for 2/3 we still can
i would do that by introducing a new Struct by the way and keeping but deprecating the current one so we can avoid a hard switch over.
so for the short term i would vote for 1 and then see if we need to do 2/3 later