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

odo should not require metadata.name in devfile #5821

Closed
2 tasks
kadel opened this issue Jun 13, 2022 · 2 comments · Fixed by #6015
Closed
2 tasks

odo should not require metadata.name in devfile #5821

kadel opened this issue Jun 13, 2022 · 2 comments · Fixed by #6015
Assignees
Labels
kind/user-story An issue of user-story kind priority/Medium Nice to have issue. Getting it done before priority changes would be great.

Comments

@kadel
Copy link
Member

kadel commented Jun 13, 2022

User Story

  • As an odo user I have created a devfile without metadata section (devfile spec defines that whole metadata section as optional)
  • I want to be able to use such devfile with odo
  • This makes sense as if I have devfile inside my project repo metadata is not much use for me

Acceptance Criteria

  • if there is no metadata.name defined in devfile, use alizer to evaluate the component name
  • do all necessary sanitation to directory name before using it as a devfile name (length, allowed characters etc...)

/kind user-story

example

commands:
- exec:
    commandLine: npm install
    component: runtime
    group:
      isDefault: true
      kind: build
    workingDir: ${PROJECT_SOURCE}
  id: install
- exec:
    commandLine: npm start
    component: runtime
    group:
      isDefault: true
      kind: run
    workingDir: ${PROJECT_SOURCE}
  id: run
- exec:
    commandLine: npm run debug
    component: runtime
    group:
      isDefault: true
      kind: debug
    workingDir: ${PROJECT_SOURCE}
  id: debug
- exec:
    commandLine: npm test
    component: runtime
    group:
      isDefault: true
      kind: test
    workingDir: ${PROJECT_SOURCE}
  id: test
components:
- container:
    endpoints:
    - name: http-3000
      targetPort: 3000
    image: registry.access.redhat.com/ubi8/nodejs-14:latest
    memoryLimit: 1024Mi
    mountSources: true
  name: runtime
schemaVersion: 2.0.0

current behavior

 odo dev   
  __
 /  \__     Developing using the  Devfile
 \__/  \    Namespace: asdf
 /  \__/    odo version: v3.0.0-alpha3
 \__/

↪ Deploying to the cluster in developer mode
 ✗  Waiting for Kubernetes resources 
Cleaning resources, please wait
failed to delete inner loop resources: failed to get the resource "Deployment" name for component ""; cause: namespacing: component name cannot be blank ✗  failed to create the component: component name "" is not valid, component name should conform the following requirements: 
- Contain at most 63 characters
- Contain only lowercase alphanumeric characters or ‘-’
- Start with an alphanumeric character
- End with an alphanumeric character
- Must not contain all numeric values
@openshift-ci openshift-ci bot added the triage/needs-information Indicates an issue needs more information in order to work on it. label Jun 13, 2022
@kadel kadel added this to the v3.0.0-beta2 milestone Jun 14, 2022
@kadel kadel added priority/Medium Nice to have issue. Getting it done before priority changes would be great. kind/user-story An issue of user-story kind and removed triage/needs-information Indicates an issue needs more information in order to work on it. labels Jun 17, 2022
@kadel kadel removed this from the v3.0.0-beta2 milestone Jun 22, 2022
@kadel kadel removed their assignment Jun 23, 2022
@valaparthvi
Copy link
Contributor

The fix for this issue should also include adding a common(central) way of obtaining the metadata name.

@valaparthvi
Copy link
Contributor

Dependent on #5847

@cdrage cdrage moved this to In Progress in odo v3-beta2 Aug 4, 2022
@rm3l rm3l moved this from In Progress to For review in odo v3-beta2 Aug 29, 2022
Repository owner moved this from For review to Done in odo v3-beta2 Aug 30, 2022
@rm3l rm3l added the v3 label Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/user-story An issue of user-story kind priority/Medium Nice to have issue. Getting it done before priority changes would be great.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants