Skip to content

factor out image serving#11

Open
pweil- wants to merge 1 commit intosimon3z:masterfrom
pweil-:image-server
Open

factor out image serving#11
pweil- wants to merge 1 commit intosimon3z:masterfrom
pweil-:image-server

Conversation

@pweil-
Copy link
Copy Markdown

@pweil- pweil- commented Apr 11, 2016

Abstract out the impl of serving images which will allow us to inject different types of server (useful for mocking in test if nothing else).

@simon3z @enoodle

I did notice the content url has / on it so you have to curl http://0.0.0.0:8080/api/v1/content/ vs http://0.0.0.0:8080/api/v1/content to get the content. If you curl just http://0.0.0.0:8080/api/v1/content you'll get Permanently Moved.

Testing:

[pweil@localhost openshift-docs]$ curl 0.0.0.0:8080/healthz
ok
[pweil@localhost openshift-docs]$ curl 0.0.0.0:8080/api
{
  "versions": [
    "v1"
  ]
}
[pweil@localhost openshift-docs]$ curl 0.0.0.0:8080/api/v1/metadata
{
  "Id": "sha256:8b5cf972e254795d1eef4f66e1a71d3c6869bbf4773d9fb36fd8c13ead1a9d5d",
  "Created": "2016-02-18T16:47:39.452282864Z",
  "Container": "f8fb8c4a27ffec2f7fa19595696c7c42754cf6a80b309d56f014090a5f4bc54a",
  "ContainerConfig": {
    "Hostname": "f8fb8c4a27ff",
    "Cmd": [
      "/bin/sh",
      "-c",
      "#(nop) ADD file:b472211c9fa1cd451ea7e94eee2ef1cdaae0413110f560bce5cb183a795b47d7 in /"
    ],
    "Image": "b0082ba983ef3569aad347f923a9cec8ea764c239179081a1e2c47709788dc44",
    "Entrypoint": null
  },
  "DockerVersion": "1.9.1",
  "Author": "Adam Miller \u003cmaxamillion@fedoraproject.org\u003e",
  "Config": {
    "Hostname": "f8fb8c4a27ff",
    "Cmd": null,
    "Image": "b0082ba983ef3569aad347f923a9cec8ea764c239179081a1e2c47709788dc44",
    "Entrypoint": null
  },
  "Architecture": "amd64",
  "Size": 188718134,
  "VirtualSize": 188718134
}
[pweil@localhost openshift-docs]$ curl 0.0.0.0:8080/api/v1/content/
curl: (18) transfer closed with 9223372036854775807 bytes remaining to read

APIVersions: apiserver.APIVersions{Versions: []string{VERSION_TAG}},
MetadataURL: METADATA_URL_PATH,
ContentURL: CONTENT_URL_PREFIX,
ImageServeURL: opts.DstPath,
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, this won't work here, need to set it later since we manipulate the DstPath later for tmpfs if it's empty. Will fix up

@simon3z
Copy link
Copy Markdown
Owner

simon3z commented Apr 11, 2016

@pweil- I need to queue this behind #3

@pweil-
Copy link
Copy Markdown
Author

pweil- commented Apr 12, 2016

no worries, I'll rebase as necessary

@@ -0,0 +1,83 @@
package imageserver
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you call this file webdav.go and not imageserver.go? not everything here is served with webdav.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll rename.

@enoodle
Copy link
Copy Markdown
Contributor

enoodle commented Sep 23, 2016

@pweil- @simon3z we should have this on openshift/image-inspector. it would help alot there, especially with the new commits we need better structure.

@simon3z
Copy link
Copy Markdown
Owner

simon3z commented Sep 23, 2016

@enoodle please do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants