docker / app

Make your Docker Compose applications reusable, and share them on Docker Hub
Apache License 2.0
1.58k stars 177 forks source link

Remove `--insecure-registries` flag #643

Closed eunomie closed 4 years ago

eunomie commented 4 years ago

Signed-off-by: Yves Brissaud yves.brissaud@docker.com

- What I did

The --insecure-registries flag is removed to have a consistent UX with Docker CLI.

- How I did it

Instead of this flag, the list of insecure registries is retrieved from the engine. See https://docs.docker.com/registry/insecure/ to configure your engine to allow communication to an insecure registry.

See the engine API and RegistryConfig.IndexConfigs fields.

- How to verify it

  1. run an insecure registry:

    docker run --rm -p 5000:5000 registry:2

  2. create an app

    docker app init test-insecure

  3. push the app against the insecure registry

    docker app push --tag 127.0.0.1:5000/test-insecure:0.1 test-insecure.dockerapp

    It should fail with an error about HTTP (insecure) response to a HTTPS (secure) client:

    http: server gave HTTP response to HTTPS client

  4. update your daemon configuration to add the local registry as insecure (apply and restart the daemon, restart the stopped registry)

    "insecure-registries": [
      "127.0.0.1:5000"
    ]
  5. push again the app

    Successfully pushed bundle to 127.0.0.1:5000/test-insecure:0.1.

- Description for the changelog

Remove --insecure-registries flag and rely on the daemon to retrieve the list of insecure registries.

silvin-lubecki commented 4 years ago

@eunomie can you rebase?

codecov[bot] commented 4 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@acbaab0). Click here to learn what that means. The diff coverage is 70.96%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #643   +/-   ##
=========================================
  Coverage          ?   71.92%           
=========================================
  Files             ?       51           
  Lines             ?     2675           
  Branches          ?        0           
=========================================
  Hits              ?     1924           
  Misses            ?      506           
  Partials          ?      245
Impacted Files Coverage Δ
internal/commands/upgrade.go 58.92% <0%> (ø)
internal/commands/install.go 66.19% <100%> (ø)
internal/commands/inspect.go 80.95% <100%> (ø)
internal/commands/render.go 80.64% <100%> (ø)
internal/commands/push.go 45.22% <60%> (ø)
internal/commands/cnab.go 71.62% <66.66%> (ø)
internal/commands/pull.go 64.28% <66.66%> (ø)
internal/commands/root.go 69.72% <80%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update acbaab0...82e4948. Read the comment docs.

eunomie commented 4 years ago

Updated:

eunomie commented 4 years ago

Rebased after https://github.com/docker/app/commit/acbaab0ff55a7ab6add3de65b30bc19a44e971e9 that added a new test with --insecure-registries. InsecureRegistries is now private and named insecureRegistriesFromEngine (to not collision with variables insecureRegistries.