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 default registry migration/update #3298

Closed
1 task
maysunfaisal opened this issue Jun 3, 2020 · 15 comments
Closed
1 task

odo default registry migration/update #3298

maysunfaisal opened this issue Jun 3, 2020 · 15 comments
Labels
kind/user-story An issue of user-story kind lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.

Comments

@maysunfaisal
Copy link
Contributor

maysunfaisal commented Jun 3, 2020

/kind user-story

User Story

As a user I should be able to get the updated default registry whenever the default registries change in odo.

This was first noticed when adding the default devfile v2 registry https://github.com/elsony/devfile2-registry

Case 1: User does not have registries in preference. Automatically Updated!

No registries in preference:

$ cat ~/.odo/preference.yaml 
kind: Preference
apiversion: odo.dev/v1alpha1
OdoSettings:
  Experimental: true

Before adding a new default registry in odo:

$ odo registry list
NAME                         URL
CheDevfileRegistry           https://che-devfile-registry.openshift.io
DefaultDevfileRegistry       https://raw.githubusercontent.com/elsony/devfile-registry/master
DefaultDevfileV2Registry     https://raw.githubusercontent.com/elsony/devfile2-registry/master

After adding a new default registry DefaultDevfileV2Registry2222 in odo:

$ odo registry list
NAME                             URL
CheDevfileRegistry               https://che-devfile-registry.openshift.io
DefaultDevfileRegistry           https://raw.githubusercontent.com/elsony/devfile-registry/master
DefaultDevfileV2Registry2222     https://raw.githubusercontent.com/elsony/devfile2-registry/master

The change is picked up automatically 👍

Case 2: User does have registries in preference. Needs Manual Update!

Registries in preference:

$ cat ~/.odo/preference.yaml 
kind: Preference
apiversion: odo.dev/v1alpha1
OdoSettings:
  Experimental: true
  RegistryList:
  - Name: CheDevfileRegistry
    URL: https://che-devfile-registry.openshift.io
  - Name: DefaultDevfileRegistry
    URL: https://raw.githubusercontent.com/elsony/devfile-registry/master
  - Name: DefaultDevfileV2Registry2222
    URL: https://raw.githubusercontent.com/elsony/devfile2-registry/master
  - Name: maysunv2
    URL: https://raw.githubusercontent.com/maysunfaisal/devfile2-registry/master

Before adding a new default registry in odo:

$ odo registry list
NAME                             URL
CheDevfileRegistry               https://che-devfile-registry.openshift.io
DefaultDevfileRegistry           https://raw.githubusercontent.com/elsony/devfile-registry/master
DefaultDevfileV2Registry2222     https://raw.githubusercontent.com/elsony/devfile2-registry/master
maysunv2                         https://raw.githubusercontent.com/maysunfaisal/devfile2-registry/master

After adding a new default registry DefaultDevfileV2Registry3333 in odo:

$ odo registry list
NAME                             URL
CheDevfileRegistry               https://che-devfile-registry.openshift.io
DefaultDevfileRegistry           https://raw.githubusercontent.com/elsony/devfile-registry/master
DefaultDevfileV2Registry2222     https://raw.githubusercontent.com/elsony/devfile2-registry/master
maysunv2                         https://raw.githubusercontent.com/maysunfaisal/devfile2-registry/master

It still has the old registry. The change is not picked up automatically 👎

Workaround to update:

Delete the preference from home dir

$ rm -rf ~/.odo/

Set up new preference

$ odo preference set experimental true
Global preference was successfully updated

New default registry is now reflected

$ odo registry list
NAME                             URL
CheDevfileRegistry               https://che-devfile-registry.openshift.io
DefaultDevfileRegistry           https://raw.githubusercontent.com/elsony/devfile-registry/master
DefaultDevfileV2Registry3333     https://raw.githubusercontent.com/elsony/devfile2-registry/master

Acceptance Criteria

  • It should update the default registry automatically when odo changes its internal default

Links

@openshift-ci-robot openshift-ci-robot added the kind/user-story An issue of user-story kind label Jun 3, 2020
@johnmcollier
Copy link
Member

johnmcollier commented Jun 3, 2020

This one’s tricky because it can be hard to tell if a missing default registry is due to a new one being added in odo, or if the user chose to remove it. We don’t want to be adding back default registries that the user explicitly removed.

Maybe we need to consider not ever storing the default registries in the preferences.yaml (but still providing a way to disable them). Then we wouldn’t hit the issue of a user not getting new default registries?

@maysunfaisal WDYT?

@maysunfaisal
Copy link
Contributor Author

Not sure if we want to allow users to disable default but not storing default in preference.yaml is one way of solving this 🤔

@johnmcollier
Copy link
Member

We allow users today to remove/disable the default registries, don’t we?

@GeekArthur
Copy link
Contributor

Exactly, this one is tricky. We do have a mechanism to cover the cases below:

  1. User never uses dynamic feature -> add default registries to preference.yaml automatically
  2. User already use dynamic feature -> use the existing registries in preference.yaml directly

But we don't cover the case where users missing one new default registry for devfile v2 (either user doesn't have it or user has it but remove it), if we want to still use the same mechanism above for supporting migration we can provide a one time migration script/way to force user to only add the new devfile v2 registry, then we don't need to change the existing code base.

Another alternative is that we can merge devfile v1 registry and devfile v2 registry to let one GitHub repo hosts two registries, then we don't have this migration issue.

Regarding @johnmcollier 's question

We allow users today to remove/disable the default registries, don’t we?

Yes, we allow

@johnmcollier
Copy link
Member

johnmcollier commented Jun 3, 2020

Another alternative is that we can merge devfile v1 registry and devfile v2 registry to let one GitHub repo hosts two registries, then we don't have this migration issue.

Merging the devfile registries won't prevent the issue from occurring again if the default devfile registry URLs are changed (or new default ones are added)

@maysunfaisal
Copy link
Contributor Author

Btw, yes we allow delete on default registries. Ignore my prev comment regd it.

@GeekArthur
Copy link
Contributor

Another alternative is that we can merge devfile v1 registry and devfile v2 registry to let one GitHub repo hosts two registries, then we don't have this migration issue.

Merging the devfile registries won't prevent the issue from occurring again if the default devfile registry URLs are changed (or new default ones are added)

For that alternative, definitely there are some limitations. If want to make it work, we have to always use the same URL and only provide one default registry. All changes will be made on upstream/GitHub side such as creating separate folders to host v1 and v1 devfiles under one GitHub repo, and no new default registry can be added in the future.

@kadel
Copy link
Member

kadel commented Jun 4, 2020

Maybe we need to consider not ever storing the default registries in the preferences.yaml (but still providing a way to disable them). Then we wouldn’t hit the issue of a user not getting new default registries?

I think that this might be a good way forward. We would just have a preference that would indicate if the default registry should be used or not, but the actual URL would be in the code.
But default the default registry would be used, and optionally user could do something like odo preference set UseDefaultRegistry false to disable it.

To migrate existing users to this new approach, we could simply delete DefaultDevfileRegistry entry from the preference if it exists.

BTW: I've forked @elsony's devfile v2 registry into https://github.com/odo-devfiles/registry we could start using that to avoid using personal github namespaces.

@kadel
Copy link
Member

kadel commented Jun 4, 2020

There is already another issue related to this. #3249
We might want to merge discussion into one single issue.

@GeekArthur
Copy link
Contributor

Maybe we need to consider not ever storing the default registries in the preferences.yaml (but still providing a way to disable them). Then we wouldn’t hit the issue of a user not getting new default registries?

I think that this might be a good way forward. We would just have a preference that would indicate if the default registry should be used or not, but the actual URL would be in the code.
But default the default registry would be used, and optionally user could do something like odo preference set UseDefaultRegistry false to disable it.

To migrate existing users to this new approach, we could simply delete DefaultDevfileRegistry entry from the preference if it exists.

BTW: I've forked @elsony's devfile v2 registry into https://github.com/odo-devfiles/registry we could start using that to avoid using personal github namespaces.

This is a good approach, one disadvantage I can think of is that user couldn't remove specific default registry as we don't store the URL on disk, IIUC we only provide option to let user enable/disable all default registries.

@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 24, 2020
@openshift-bot
Copy link

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci-robot openshift-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Nov 23, 2020
@kadel
Copy link
Member

kadel commented Nov 23, 2020

/remove-lifecycle rotten
/lifecycle frozen

this is still valid

@openshift-ci-robot openshift-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Nov 23, 2020
@rm3l rm3l added this to odo Project Oct 3, 2022
@rm3l rm3l moved this to To Do 📝 in odo Project Oct 3, 2022
@rm3l rm3l removed the status in odo Project Oct 3, 2022
@kadel
Copy link
Member

kadel commented Feb 6, 2023

This is no longer valid in odo v3.

/close

@openshift-ci openshift-ci bot closed this as completed Feb 6, 2023
@openshift-ci
Copy link

openshift-ci bot commented Feb 6, 2023

@kadel: Closing this issue.

In response to this:

This is no longer valid in odo v3.

/close

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.

@github-project-automation github-project-automation bot moved this to Done ✅ in odo Project Feb 6, 2023
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 lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
Archived in project
Development

No branches or pull requests

7 participants