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 rewrite should preserve "unknown" properties of 'metadata' (and other optional properties?) per devfile schema #3968

Closed
scottkurz opened this issue Sep 16, 2020 · 4 comments · Fixed by #3987
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@scottkurz
Copy link
Contributor

/kind bug

Per devfile spec schema:
https://devfile.github.io/devfile/_attachments/api-reference.html

the 'metadata' properties are optional.

Currently, in 2.0.0-beta-1, the "unknown" properties will be lost during the rewrite that happens, for example, in odo url create ...

What versions of software are you using?

Operating System: Win 10

Output of odo version: 2.0.0-beta-1

How did you run odo exactly?

With a devfile like: https://github.com/OpenLiberty/application-stack/blob/master/dev/devfile.yaml

schemaVersion: 2.0.0
metadata:
  name: java-openliberty
  version: 0.1.4-rc2
  description: Java application stack using Open Liberty runtime
  alpha.build-dockerfile: "https://raw.githubusercontent.com/OpenLiberty/application-stack/master/dev/Dockerfile"
  alpha.deployment-manifest: "https://raw.githubusercontent.com/OpenLiberty/application-stack/master/dev/app-deploy.yaml"

if I do odo url create --port 9080 , the devfile will be updated/rewritten but the "alpha.build-dockerfile" and "alpha.deployment-manifest" metadata properties will be lost.

Actual behavior

Expected behavior

Expect these to be preserved.

I just skimmed the devfile spec and didn't see any other examples of optional properties, but not that familiar still.

Any logs, error output, etc?

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 16, 2020
@yangcao77
Copy link
Contributor

/assign

@dharmit
Copy link
Member

dharmit commented Sep 23, 2020

@scottkurz @yangcao77 please pardon my lack of knowledge as far as devfile schema is concerned. I looked at the PR #3987 but what's got me confused is that why does odo url create command have to modify the devfile. My understanding is that odo url create should refer the devfile, create a URL, and store the URL info in .odo/env/env.yaml.

The PR likely fixes the issue at hands, but I'm confused if modifying devfile is the right thing to do for odo url create command. I could be totally wrong so please correct me if that's the case. 😄

cc @mik-dass

@mik-dass
Copy link
Contributor

The discussion in the PR #3665 might help. It was creating a lot of confusion, so we decided to move the URLs to one place and store cluster specific data like host and others in the env for each URL.

@scottkurz
Copy link
Contributor Author

@scottkurz @yangcao77 please pardon my lack of knowledge as far as devfile schema is concerned. I looked at the PR #3987 but what's got me confused is that why does odo url create command have to modify the devfile. My understanding is that odo url create should refer the devfile, create a URL, and store the URL info in .odo/env/env.yaml.

I'm still getting up to speed here myself, (was wondering the same thing) but, I changed the java-openliberty devfile so that, by default, odo url create won't have any changes to make to the devfile when targeting Open Shift:

https://github.com/odo-devfiles/registry/blob/50901a75d0bfb830c9fa1cab45a2424fef034d2d/devfiles/java-openliberty/devfile.yaml#L21-L26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants