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

Fix OCI-based registry migration #4702

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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