Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improper input validation #81

Closed
Assignees
everettraven
Labels
kind/bugCategorizes issue or PR as related to a bug.
@metacosm

Description

@metacosm

Bug Report

It's currently possible to generate code that will not compile because of invalid characters in the package name. Currently, the package name is derived from the provided domain name during theinit command. However, it's feasible to use a valid domain name that will result in an invalid Java package name (for example:foo-bar.com).

What did you do?

operator-sdk init --plugins quarkus --domain foo-bar.com --project-name foo, followed by acreate api call will result in invalid code:

Failed to execute goal io.quarkus:quarkus-maven-plugin:2.7.5.Final:dev (default-cli) on project foo: Unable to execute mojo: Compilation failure:[ERROR] /tmp/src/main/java/com/foo-bar/FooReconciler.java:[1,16] ';' expected[ERROR] /tmp/src/main/java/com/foo-bar/Foo.java:[1,16] ';' expected[ERROR] /tmp/src/main/java/com/foo-bar/FooStatus.java:[1,16] ';' expected[ERROR] /tmp/src/main/java/com/foo-bar/FooSpec.java:[1,16] ';' expected

This happens because- is not an accepted character in Java package names.

Possible solution

The domain name should be sanitized to ensure valid Java package names are derived from it. If sanitization occurred, a message should be output to the user.

Alternatively, it should be possible for a user to override the package name using a command line option

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp