Skip to content

Commit

Permalink
Revert "HTTPS for registry requests"
Browse files Browse the repository at this point in the history
This reverts commit 38a48a7.
  • Loading branch information
hweawer committed Jan 27, 2025
1 parent 38a48a7 commit b8c49cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions lib/backend/registrybackend/blobclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -52,8 +52,8 @@ func (f *blobClientFactory) Create(
return NewBlobClient(config, stats)
}

const _layerquery = "https://%s/v2/%s/blobs/sha256:%s"
const _manifestquery = "https://%s/v2/%s/manifests/sha256:%s"
const _layerquery = "http://%s/v2/%s/blobs/sha256:%s"
const _manifestquery = "http://%s/v2/%s/manifests/sha256:%s"

// BlobClient stats and downloads blob from registry.
type BlobClient struct {
Expand Down
12 changes: 7 additions & 5 deletions lib/backend/testfs/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -85,7 +85,8 @@ func (c *Client) Stat(namespace, name string) (*core.BlobInfo, error) {
if err != nil {
return nil, fmt.Errorf("pather: %s", err)
}
resp, err := httputil.Head(fmt.Sprintf("http://%s/files/%s", c.config.Addr, p))
resp, err := httputil.Head(
fmt.Sprintf("https://%s/files/%s", c.config.Addr, p))
if err != nil {
if httputil.IsNotFound(err) {
return nil, backenderrors.ErrBlobNotFound
Expand All @@ -106,7 +107,7 @@ func (c *Client) Upload(namespace, name string, src io.Reader) error {
return fmt.Errorf("pather: %s", err)
}
_, err = httputil.Post(
fmt.Sprintf("http://%s/files/%s", c.config.Addr, p),
fmt.Sprintf("https://%s/files/%s", c.config.Addr, p),
httputil.SendBody(src))
return err
}
Expand All @@ -117,7 +118,8 @@ func (c *Client) Download(namespace, name string, dst io.Writer) error {
if err != nil {
return fmt.Errorf("pather: %s", err)
}
resp, err := httputil.Get(fmt.Sprintf("http://%s/files/%s", c.config.Addr, p))
resp, err := httputil.Get(
fmt.Sprintf("https://%s/files/%s", c.config.Addr, p))
if err != nil {
if httputil.IsNotFound(err) {
return backenderrors.ErrBlobNotFound
Expand All @@ -143,7 +145,7 @@ func (c *Client) List(prefix string, opts ...backend.ListOption) (*backend.ListR
}

resp, err := httputil.Get(
fmt.Sprintf("http://%s/list/%s", c.config.Addr, path.Join(c.pather.BasePath(), prefix)))
fmt.Sprintf("https://%s/list/%s", c.config.Addr, path.Join(c.pather.BasePath(), prefix)))
if err != nil {
return nil, err
}
Expand Down

0 comments on commit b8c49cc

Please sign in to comment.