Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

blank output on POST redirect 301 code #173

@bhearn7

Description

@bhearn7

Version: 0.9.1
OS: Mac

Cluster Mesh: Istio

Issue: when attempting an anchore-cli POST command from outside the cluster using http and port 80, requests changes the POST to GET for 301's, resulting in blank cli output

Links:

Examples:

# blank output when using http://...:80/v1
$ anchore-cli --debug --url http://example.dev:80/v1 --u USER --p PASSWORD image add docker.io/library/alpine:latest
DEBUG:anchorecli.clients.apiexternal:As Account = None
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): example.dev:80
DEBUG:urllib3.connectionpool:http://example.dev:80 "GET /v1 HTTP/1.1" 301 0
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): example.dev:443
DEBUG:urllib3.connectionpool:https://example.dev:443 "GET /v1 HTTP/1.1" 200 5
DEBUG:anchorecli.clients.apiexternal:As Account = None
DEBUG:anchorecli.clients.apiexternal:POST url=http://example.dev:80/v1/images?autosubscribe=True
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): example.dev:80
DEBUG:urllib3.connectionpool:http://example.dev:80 "POST /v1/images?autosubscribe=True HTTP/1.1" 301 0
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): example.dev:443
DEBUG:urllib3.connectionpool:https://example.dev:443 "GET /v1/images?autosubscribe=True HTTP/1.1" 200 3
DEBUG:anchorecli.cli.utils:fetched httpcode from response: 200

# successful output when using https://...:443/v1
$ anchore-cli --debug --url https://example.dev:443/v1 --u USER --p PASSWORD registry add REGISTRY_NAME REGISTRY_USER REGISTRY_PASSWORD
DEBUG:anchorecli.clients.apiexternal:As Account = None
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): example.dev:443
DEBUG:urllib3.connectionpool:https://example.dev:443 "GET /v1 HTTP/1.1" 200 5
DEBUG:anchorecli.clients.apiexternal:As Account = None
DEBUG:anchorecli.clients.apiexternal:POST url=https://example.dev:443/v1/registries?validate=True
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): example.dev:443
DEBUG:urllib3.connectionpool:https://example.dev:443 "POST /v1/registries?validate=True HTTP/1.1" 200 298
DEBUG:anchorecli.cli.utils:fetched httpcode from response: 200
Registry: REGISTRY_NAME
Name: REGISTRY_NAME
User: REGISTRY_USER
Type: docker_v2
Verify TLS: True
Created: 2021-05-27T15:41:14Z
Updated: 2021-05-27T15:41:14Z

Expected output: Error, Failure, or Redirect warning in cli output

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions