Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Latest commit

 

History

History
35 lines (27 loc) · 959 Bytes

README.md

File metadata and controls

35 lines (27 loc) · 959 Bytes

Overview

This layer encapsulates the docker-registry interface communication protocol and provides an API for charms on either side of relations using this interface.

Usage

In your charm's layer.yaml, ensure that interface:docker-registry is included in the includes section:

includes: ['layer:basic', 'interface:docker-registry']

And in your charm's metadata.yaml, ensure that a relation endpoint is defined using the docker-registry interface protocol:

requires:
  docker-registry:
    interface: docker-registry

React to changes from docker-registry as follows:

@when('endpoint.docker-registry.ready')
    def registry_ready():
        registry = endpoint_from_flag('endpoint.docker-registry.ready')
        configure_registry(registry.registry_netloc)
        if registry.has_auth_basic():
            configure_auth(registry.basic_user,
                           registry.basic_password)