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

Remove support for github based devfile registries #5579

Closed
kadel opened this issue Mar 21, 2022 · 2 comments · Fixed by #5708
Closed

Remove support for github based devfile registries #5579

kadel opened this issue Mar 21, 2022 · 2 comments · Fixed by #5708
Assignees
Labels
estimated-size/M (10-20) Rough sizing for Epics. About 1 sprint of work for one person kind/task Issue is actionable task priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)).

Comments

@kadel
Copy link
Member

kadel commented Mar 21, 2022

Deprecation message was added almost a year ago #4707
v3 is a good time to completely remove this from odo.
Only devfile registries that odo should support is those using official https://github.com/devfile/registry-support

@kadel kadel added priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)). v3 kind/task Issue is actionable task labels Mar 21, 2022
@valaparthvi
Copy link
Contributor

valaparthvi commented Mar 22, 2022

odo init does not seem to support GitHub based registries. This is what I tried.

➜  odo preference registry add RGH2 https://github.com/devfile/registry
 ⚠  Git based registries Deprecated  Please see https://github.com/redhat-developer/odo/tree/main/docs/public/git-registry-deprecation.adoc
New registry successfully added

➜   odo init --name aname --devfile nodejs --devfile-registry RGH2      
 ✗  Downloading devfile "nodejs" from registry "RGH2" [448ms]
 ✗  unable to download devfile: invalid character '<' looking for beginning of value
the command failed, the devfile has been removed from current directory

@kadel
Copy link
Member Author

kadel commented Mar 22, 2022

There are still parts of the code with special logic to handle github registries like

odo/pkg/catalog/catalog.go

Lines 188 to 230 in f298389

// Github-based registry
URL, err := convertURL(registry.URL)
if err != nil {
return nil, fmt.Errorf("unable to convert URL %s: %w", registry.URL, err)
}
registry.URL = URL
indexLink := registry.URL + indexPath
request := dfutil.HTTPRequestParams{
URL: indexLink,
}
secure := registryUtil.IsSecure(preferenceClient, registry.Name)
if secure {
token, e := keyring.Get(fmt.Sprintf("%s%s", dfutil.CredentialPrefix, registry.Name), registryUtil.RegistryUser)
if e != nil {
return nil, fmt.Errorf("unable to get secure registry credential from keyring: %w", e)
}
request.Token = token
}
jsonBytes, err := dfutil.HTTPGetRequest(request, preferenceClient.GetRegistryCacheTime())
if err != nil {
return nil, fmt.Errorf("unable to download the devfile index.json from %s: %w", indexLink, err)
}
var devfileIndex []indexSchema.Schema
err = json.Unmarshal(jsonBytes, &devfileIndex)
if err != nil {
if err := util.CleanDefaultHTTPCacheDir(); err != nil {
log.Warning("Error while cleaning up cache dir.")
}
// we try once again
jsonBytes, err := dfutil.HTTPGetRequest(request, preferenceClient.GetRegistryCacheTime())
if err != nil {
return nil, fmt.Errorf("unable to download the devfile index.json from %s: %w", indexLink, err)
}
err = json.Unmarshal(jsonBytes, &devfileIndex)
if err != nil {
return nil, fmt.Errorf("unable to unmarshal the devfile index.json from %s: %w", indexLink, err)
}
}
return createRegistryDevfiles(registry, devfileIndex)
this should be removed together with tests handling this

@kadel kadel added estimated-size/M (10-20) Rough sizing for Epics. About 1 sprint of work for one person triage/ready and removed v3 labels Mar 23, 2022
@rm3l rm3l added the v3 label Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
estimated-size/M (10-20) Rough sizing for Epics. About 1 sprint of work for one person kind/task Issue is actionable task priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)).
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants