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

Running odo registry from a directory containing invalid devfile errors out #6971

Closed
valaparthvi opened this issue Jul 17, 2023 · 1 comment · Fixed by #7063
Closed

Running odo registry from a directory containing invalid devfile errors out #6971

valaparthvi opened this issue Jul 17, 2023 · 1 comment · Fixed by #7063
Assignees
Labels
area/registry Issues or PRs related to Devfile registries kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@valaparthvi
Copy link
Contributor

valaparthvi commented Jul 17, 2023

/kind bug

What versions of software are you using?

Operating System:
Linux

Output of odo version:

odo v3.12.0 (a1204660c)

Server: https://127.0.0.1:6443
Kubernetes: v1.26.6+k3s1
Podman Client: 4.4.4

How did you run odo exactly?

  1. Get a directory containing devfile.
  2. Modify the devfile to be invalid.
  3. Run odo registry

Actual behavior

➜  express-sample git:(main) ✗ odo registry                           
 ✗  failed to parse the devfile /home/pvala/code/docs.rancherdesktop.io/assets/express-sample/devfile.yaml: failed to populateAndParseDevfile: invalid devfile schema. errors :
- commands.6.composite.group.kind: commands.6.composite.group.kind must be one of the following: "build", "run", "test", "debug"
- components.1: Must validate one and only one schema (oneOf)
- components.1: container is required
- components.1: Additional property image is not allowed

Expected behavior

odo registry is not dependent on the current devfile.yaml, it should not fail.

Any logs, error output, etc?

$ odo registry -v 9                      
I0717 14:50:17.462503   23856 implem.go:114] The path for preference file is /home/pvala/.odo/preference.yaml
I0717 14:50:17.462552   23856 segment.go:264] Checking telemetry enable status
I0717 14:50:17.462555   23856 segment.go:294] Sending telemetry enabled by preference
I0717 14:50:17.462595   23856 util.go:780] HTTPGetRequest: https://raw.githubusercontent.com/redhat-developer/odo/main/build/VERSION
I0717 14:50:17.462677   23856 util.go:801] Response will be cached in /tmp/odohttpcache for 1h0m0s
I0717 14:50:17.462794   23856 util.go:814] Cached response used.
I0717 14:50:17.463494   23856 implem.go:114] The path for preference file is /home/pvala/.odo/preference.yaml
I0717 14:50:17.463541   23856 context.go:172] absolute devfile path: '/home/pvala/code/docs.rancherdesktop.io/assets/express-sample/devfile.yaml'
I0717 14:50:17.463545   23856 context.go:113] absolute devfile path: '/home/pvala/code/docs.rancherdesktop.io/assets/express-sample/devfile.yaml'
I0717 14:50:17.463734   23856 content.go:48] converted devfile YAML to JSON
I0717 14:50:17.463773   23856 apiVersion.go:60] devfile schemaVersion: '2.1.0'
I0717 14:50:17.463779   23856 helper.go:56] devfile apiVersion '2.1.0' is supported
I0717 14:50:17.464927   23856 implem.go:114] The path for preference file is /home/pvala/.odo/preference.yaml
I0717 14:50:17.464960   23856 segment.go:264] Checking telemetry enable status
I0717 14:50:17.464963   23856 segment.go:294] Sending telemetry enabled by preference
 ✗  failed to parse the devfile /home/pvala/code/docs.rancherdesktop.io/assets/express-sample/devfile.yaml: failed to populateAndParseDevfile: invalid devfile schema. errors :
- commands.6.composite.group.kind: commands.6.composite.group.kind must be one of the following: "build", "run", "test", "debug"
- components.1: Must validate one and only one schema (oneOf)
- components.1: container is required
- components.1: Additional property image is not allowed

Acceptance criteria

  • All commands not using Devfile should not fail, even if a Devfile in the local directory is wrong (alizer, version, registry, etc)
  • Integration tests for all these commands
@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 17, 2023
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. label Jul 17, 2023
@rm3l rm3l added area/registry Issues or PRs related to Devfile registries and removed needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. labels Jul 17, 2023
@rm3l
Copy link
Member

rm3l commented Jul 17, 2023

Thanks for reporting this issue.

This seems related to #6683

We need to be consistent and review places where a valid Devfile is not mandatory.

@feloy feloy self-assigned this Sep 1, 2023
@feloy feloy moved this to In Review 👀 in odo Project Sep 1, 2023
@rm3l rm3l added this to the v3.15.0 🚀 milestone Sep 1, 2023
@github-project-automation github-project-automation bot moved this from In Review 👀 to Done ✅ in odo Project Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/registry Issues or PRs related to Devfile registries kind/bug Categorizes issue or PR as related to a bug.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants