Skip to content

Commit

Permalink
fix: registry migration (#4702)
Browse files Browse the repository at this point in the history
Signed-off-by: jingfu wang <jingfwan@redhat.com>
  • Loading branch information
GeekArthur authored May 10, 2021
1 parent cb77fa3 commit 7f998e4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/preference/preference.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ const (
// DefaultDevfileRegistryURL is the URL of default devfile registry
DefaultDevfileRegistryURL = "https://registry.devfile.io"

// OldDefaultDevfileRegistryURL is the URL of old default devfile registry for registry migration purpose
OldDefaultDevfileRegistryURL = "https://github.com/odo-devfiles/registry"

// DefaultRegistryCacheTime is time (in minutes) for how long odo will cache information from Devfile registry
DefaultRegistryCacheTime = 15

Expand Down Expand Up @@ -252,7 +255,7 @@ func NewPreferenceInfo() (*PreferenceInfo, error) {
// Handle OCI-based default registry migration
if c.OdoSettings.RegistryList != nil {
for index, registry := range *c.OdoSettings.RegistryList {
if registry.Name == DefaultDevfileRegistryName && registry.URL != DefaultDevfileRegistryURL {
if registry.Name == DefaultDevfileRegistryName && registry.URL == OldDefaultDevfileRegistryURL {
registryList := *c.OdoSettings.RegistryList
registryList[index].URL = DefaultDevfileRegistryURL
break
Expand Down

0 comments on commit 7f998e4

Please sign in to comment.