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
Add runtime label based on metadata:language/projectType #6112
Add runtime label based on metadata:language/projectType #6112
Conversation
✅ Deploy Preview for odo-docusaurus-preview canceled.
|
if runtime != "" { | ||
labels[openshiftRunTimeLabel] = runtime | ||
} |
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.
This is an OpenShift specific label, isn't it? It does not make sense to add it to resources that might be deployed in a K8s cluster. Can we ensure it's only added if the cluster is OC?
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'm not sure it is what has been discussed. @kadel WDYT?
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.
This is just a label. Yes, it is OpenShift specific, but there is no harm in always applying this. It might be even better, as there might be another tooling that could eventually leverage that.
And the only OpenShift specific is it's name, functionality wise there is nothing that should tie this only to openshift
e046590
to
a9de64d
Compare
pkg/component/component.go
Outdated
if metadata.Language != "" { | ||
return metadata.Language | ||
} | ||
return metadata.ProjectType |
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 know we already discussed about using the language first and then the project type, but after quickly testing on Dev Sandbox, I think we should use the project type first.
The Deployment I created manually in Dev Sandbox has the following label: app.openshift.io/runtime=nodejs
, but the one created by odo
has app.openshift.io/runtime=javascript
, and the right icon is not showing up in Topology View.
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.
What is the behaviour with Java projects?
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.
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.
Same point for a SpringBoot app: we currently have the same icon as Quarkus for the language (Java). But if I set the label to the project type (spring
) defined in the Devfile, then we have a more specific icon for this component:
This is why I was thinking about using the project type first instead.
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 we never will be able to reliably cover all the cases. If we use projectType then there will be a problem with java-maven
. I guess we just need to check what approach works for most of the cases.
I'm ok if we go with projectTyp
a9de64d
to
6e50b8f
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Thanks for the new changes. /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rm3l The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Tested and works well 👍 Thanks @feloy /lgtm |
Flaky test
/override ci/prow/v4.10-integration-e2e |
@feloy: Overrode contexts on behalf of feloy: ci/prow/v4.10-integration-e2e In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
…loper#6112) * Add runtime label based on metadata:language/projectType * Add integration tests for odo dev * odo deploy integration test * Reverse priority between pojectType and language
What type of PR is this:
/kind feature
What does this PR do / why we need it:
Which issue(s) this PR fixes:
Fixes #6044
PR acceptance criteria:
Unit test
Integration test
Documentation
How to test changes / Special notes to the reviewer: