Skip to content
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

problem in detecting server port in application.yaml unlike application.properties where it detect the server port when k8s:resources #2909

Closed
AhmdFahad opened this issue Apr 14, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@AhmdFahad
Copy link

Describe the bug

here when it create kubernetes manifest it did`n detect the port

image

unlike in application.properties it detect the port

image

Eclipse JKube version

1.16.2

Component

Kubernetes Maven Plugin

Apache Maven version

other (please specify in additional context)

Gradle version

None

Steps to reproduce

mvn clean install k8s:resource

Expected behavior

.

Runtime

Kubernetes (vanilla), other (please specify in additional context)

Kubernetes API Server version

other (please specify in additional context)

Environment

Windows

Eclipse JKube Logs

No response

Sample Reproducer Project

No response

Additional context

No response

@AhmdFahad AhmdFahad added the bug Something isn't working label Apr 14, 2024
@rohanKanojia
Copy link
Member

@AhmdFahad : Hello, do you think your problem is related to #2832 ? Did you run mvn package before running k8s:resource?

@AhmdFahad
Copy link
Author

yes i did ,
mvn clean install k8s:resource

@arsenalzp
Copy link
Contributor

yes i did , mvn clean install k8s:resource

You can check presence of application.properties in target/classes directory. I guess this issue is related to issue I'm working for.

@AhmdFahad
Copy link
Author

here is the target/classes/application.yaml in target class
image

and here is target/classes/application.properties
image

and every time i switch the application file extension i clean and build the project
using maven mvn clean install k8s:resoruce

@AhmdFahad
Copy link
Author

It seems like the issue is related to the .yaml extension. But when I used .yml, it worked well.

@AhmdFahad
Copy link
Author

here is the file of type .yaml
here when i was using the .yaml it was not detect the port server port
but when i used the .yml it works properly
image

and here is the .yml

image

@AhmdFahad
Copy link
Author

I think I've understood what the problem is. I hope it gets resolved soon. I'll go ahead and close this ticket, and thank you for your assistance

@rohanKanojia
Copy link
Member

@AhmdFahad : What does spring documentation advise? Is it yml or yaml?

@AhmdFahad
Copy link
Author

@rohanKanojia , In fact, I'm not entirely sure what the preference is, but in the documentation, YAML is referenced 45 times compared to YML, which is only mentioned 17 times.

https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#features.spring-application

image

image

look at that quoted from Documentation **No matter what you set in the environment, Spring Boot always loads application.properties as described above. By default, if YAML is used, then files with the ‘.yaml’ and ‘.yml’ extension are also added to the list.**

This is what I couldn't reach, but if you have the knowledge, I hope you can share it with me.

@AhmdFahad
Copy link
Author

AhmdFahad commented Apr 15, 2024

image
in the profile section ,it was using the .yaml

@rohanKanojia
Copy link
Member

@AhmdFahad : I think problem is here in our code:

https://github.com/eclipse/jkube/blob/794e115ebf94b78d1f3753c8513d0b4d75264a61/jkube-kit/common/src/main/java/org/eclipse/jkube/kit/common/util/SpringBootUtil.java#L68-L69

We only consider for application.yml / application.properties. We should update it for application.yaml as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants