Project

General

Profile

Actions

Feature #11672

closed

GET /docker/api/v2/registries/:id should return the username field

Added by Partha Aji over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
CLI
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1259513
Description of problem:

When you create a new docker registry, you can optionally provide a username and password. However, our API does not seem to return either of them (see further down for an example of the output generated when using hammer).

Version-Release number of selected component (if applicable):

  • Sat6.1.2-SNAP1

How reproducible:

Steps to Reproduce:
1. User either hammer cli to fetch information for a docker registry OR access /docker/api/v2/registries/:id directly
2.
3.

Actual results:

Notice how username and password are not returned

Expected results:

At least the username should be returned by the API call

Additional info:

hammer> docker registry update --id 2 --username='omaciel'
Docker registry updated
hammer> docker registry info --id 2
ID: 2
Name: Red Hat Docker Registry
URL: https://registry.access.redhat.com
Created at: 2015/09/02 19:28:33
Updated at: 2015/09/02 20:24:51

hammer> exit
[root@ibm-x3250m4-05 ~]# hammer -u admin -p changeme -d docker registry info --id 2
[ INFO 2015-09-02 16:25:06 Init] Initialization of Hammer CLI (0.1.4.12) has started...
[DEBUG 2015-09-02 16:25:06 Init] Running at ruby 2.0.0-p598
[ INFO 2015-09-02 16:25:06 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2015-09-02 16:25:06 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2015-09-02 16:25:06 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded
[ INFO 2015-09-02 16:25:06 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_discovery.yml has been loaded
[ INFO 2015-09-02 16:25:06 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded
[ INFO 2015-09-02 16:25:06 Init] Configuration from the file /etc/hammer/cli.modules.d/gutterball.yml has been loaded
[ INFO 2015-09-02 16:25:06 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded
[ INFO 2015-09-02 16:25:06 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[DEBUG 2015-09-02 16:25:06 Connection] Registered: foreman
[DEBUG 2015-09-02 16:25:06 API] Global headers: {
:content_type => "application/json",
:accept => "application/json;version=2",
"Accept-Language" => "en"
}
[ INFO 2015-09-02 16:25:06 Modules] Extension module hammer_cli_foreman (0.1.4.14) loaded
[ INFO 2015-09-02 16:25:06 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.2.7) loaded
[ INFO 2015-09-02 16:25:06 Modules] Extension module hammer_cli_foreman_discovery (0.0.1.10) loaded
[ INFO 2015-09-02 16:25:07 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2015-09-02 16:25:07 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2015-09-02 16:25:07 Modules] Extension module hammer_cli_gutterball (0.0.1.3) loaded
[ INFO 2015-09-02 16:25:07 Modules] Extension module hammer_cli_import (0.10.20) loaded
[ INFO 2015-09-02 16:25:07 Modules] Extension module hammer_cli_katello (0.0.7.17) loaded
[DEBUG 2015-09-02 16:25:07 Init] Using locale 'en'
[DEBUG 2015-09-02 16:25:07 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/usr/share/gems/gems/hammer_cli-0.1.4.12/locale'
[DEBUG 2015-09-02 16:25:07 Init] 'mo' files for locale domain 'hammer-cli@system' loaded from '/usr/share/locale'
[DEBUG 2015-09-02 16:25:07 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/usr/share/gems/gems/hammer_cli_foreman-0.1.4.14/locale'
[DEBUG 2015-09-02 16:25:07 Init] 'mo' files for locale domain 'hammer-cli-foreman@system' loaded from '/usr/share/locale'
[DEBUG 2015-09-02 16:25:07 Init] 'mo' files for locale domain 'hammer_cli_foreman_docker' loaded from '/usr/share/gems/gems/hammer_cli_foreman_docker-0.0.3.9/locale'
[DEBUG 2015-09-02 16:25:07 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/usr/share/gems/gems/hammer_cli_katello-0.0.7.17/locale'
[ INFO 2015-09-02 16:25:07 HammerCLI::MainCommand] Called with options: {"option_debug"=>true, "option_username"=>"admin", "option_password"=>"***"}
[ INFO 2015-09-02 16:25:07 HammerCLIForemanDocker::DockerCommand] Called with options: {}
[ INFO 2015-09-02 16:25:07 HammerCLIForemanDocker::DockerRegistryCommand] Called with options: {}
[ INFO 2015-09-02 16:25:07 HammerCLIForemanDocker::DockerRegistryCommand::InfoCommand] Called with options: {"option_id"=>"2"}
[ INFO 2015-09-02 16:25:07 API] GET /docker/api/v2/registries/2
[DEBUG 2015-09-02 16:25:07 API] Params: {}
[DEBUG 2015-09-02 16:25:07 API] Headers: {
:params => {}
}
[DEBUG 2015-09-02 16:25:07 API] Response: {
"id" => 2,
"name" => "Red Hat Docker Registry",
"url" => "https://registry.access.redhat.com",
"description" => nil,
"created_at" => "2015-09-02T19:28:33Z",
"updated_at" => "2015-09-02T20:24:51Z",
"locations" => [],
"organizations" => []
}
[DEBUG 2015-09-02 16:25:07 API] Response headers: {
:date => "Wed, 02 Sep 2015 20:25:07 GMT",
:server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
:foreman_version => "1.7.2",
:foreman_api_version => "2",
:x_ua_compatible => "IE=Edge,chrome=1",
:cache_control => "must-revalidate, private, max-age=0",
:x_request_id => "a0fedd63901dfcfed505917ca8ef51bb",
:x_runtime => "0.054340",
:x_rack_cache => "miss",
:x_powered_by => "Phusion Passenger 4.0.18",
:set_cookie => [
[0] "_session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJWNkOTU0ZTRjYjU4ODMyYThjOTc2NmRiMWQwM2M4OWUwBjsAVEkiC2xvY2FsZQY7AEYiB2Vu--67efdbc1c468785e0e4945ace6a6a83ba3907dab; path=/; secure; HttpOnly"
],
:etag => "\"71f8a3f3f2b750eab907421469b85345\"",
:status => "200 OK",
:transfer_encoding => "chunked",
:content_type => "application/json; charset=utf-8"
}
ID: 2
Name: Red Hat Docker Registry
URL: https://registry.access.redhat.com
Created at: 2015/09/02 19:28:33
Updated at: 2015/09/02 20:24:51

Actions

Also available in: Atom PDF