Skip to content

bugfix: add domain sanitation #82

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

Merged

Conversation

everettraven
Copy link
Collaborator

adds sanitization of the domain so that legal java packages can be created. Adds a flag to
disable to the logic if necessary

fixes #81

Signed-off-by: Bryce Palmer [email protected]

adds sanitization of the domain so that legal java packages can be created. Adds a flag to
disable to the logic if necessary

fixes operator-framework#81

Signed-off-by: Bryce Palmer <[email protected]>
@everettraven everettraven changed the title bugfix: add domain sanitization bugfix: add domain sanitation Apr 22, 2022
@metacosm
Copy link
Collaborator

Instead of deactivating the sanitation, it might be better to only sanitize the package name and leave the domain name intact. Presumably, the domain name shouldn't change, only the package name.

@everettraven
Copy link
Collaborator Author

Instead of deactivating the sanitation, it might be better to only sanitize the package name and leave the domain name intact. Presumably, the domain name shouldn't change, only the package name.

That makes sense. I will make some changes to reflect this. Thanks @metacosm for pointing this out!

@everettraven
Copy link
Collaborator Author

As of commit 8b73706 this should now only sanitize the package name and leave the domain unchanged

@@ -62,19 +62,19 @@ func (s *apiScaffolder) Scaffold() error {
var createAPITemplates []machinery.Builder
createAPITemplates = append(createAPITemplates,
&model.Model{
Package: util.ReverseDomain(s.config.GetDomain()),
Package: util.ReverseDomain(util.SanitizeDomain(s.config.GetDomain())),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not relevant to the current PR but maybe it'd make sense to compute these (and the class name) only once.

Copy link
Member

@jmrodri jmrodri left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 3, 2022
@jmrodri jmrodri merged commit 06357b6 into operator-framework:main May 3, 2022
@everettraven everettraven deleted the bug/pkg-name-sanitization branch May 3, 2022 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improper input validation
3 participants