You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we are using kubernets extensions, when the quarkus.application.name has the value "k6-with-quarkus " (with whtespace) name the generated Kubernetes resources are wrong:
When you apply those resources into Kubernetes cluster, you get:
Error from server (Invalid): error when creating "target/kubernetes/kind.yml": Service "k6-with-quarkus " is invalid: [metadata.name: Invalid value: "k6-with-quarkus ": a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?'), metadata.labels: Invalid value: "k6-with-quarkus ": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?'), spec.selector: Invalid value: "k6-with-quarkus ": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')]
Error from server (Invalid): error when creating "target/kubernetes/kind.yml": Deployment.apps "k6-with-quarkus " is invalid: [metadata.name: Invalid value: "k6-with-quarkus ": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'), metadata.labels: Invalid value: "k6-with-quarkus ": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?'), spec.selector.matchLabels: Invalid value: "k6-with-quarkus ": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?'), spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/name":"k6-with-quarkus ", "app.kubernetes.io/version":"1.0.0-SNAPSHOT"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: invalid label selector]
And configure your quarkus.application.name with whitespace.
Output of uname -a or ver
No response
Output of java -version
No response
Quarkus version or git rev
No response
Build tool (ie. output of mvnw --version or gradlew --version)
No response
Additional information
We can solve this one handling the application name before creating KubernetesResourceMetadataBuildItem:
We can change the following code to remove this whitespace, because it is used for all Kubernetes related processors, but is necessary to pay attention to another consumers:
Describe the bug
When we are using kubernets extensions, when the
quarkus.application.name
has the value "k6-with-quarkus " (with whtespace) name the generated Kubernetes resources are wrong:When you apply those resources into Kubernetes cluster, you get:
Expected behavior
Actual behavior
How to Reproduce?
Install the following extensions:
And configure your
quarkus.application.name
with whitespace.Output of
uname -a
orver
No response
Output of
java -version
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
We can solve this one handling the application name before creating
KubernetesResourceMetadataBuildItem
:We can change the following code to remove this whitespace, because it is used for all Kubernetes related processors, but is necessary to pay attention to another consumers:
quarkus/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/ResourceNameUtil.java
Line 15 in ddfcbc5
The text was updated successfully, but these errors were encountered: