docker/lookaside.go
func (config *registryConfiguration) signatureTopLevel(ref dockerReference, write bool) string {
	if config.Docker != nil {
		// Look for a full match.
		identity := ref.PolicyConfigurationIdentity()
		if ns, ok := config.Docker[identity]; ok {
			logrus.Debugf(` Using "docker" namespace %s`, identity)
			if url := ns.signatureTopLevel(write); url != "" {
				return url
			}
		}

		// Look for a match of the possible parent namespaces.
		for _, name := range ref.PolicyConfigurationNamespaces() {
			if ns, ok := config.Docker[name]; ok {
				logrus.Debugf(` Using "docker" namespace %s`, name)
				if url := ns.signatureTopLevel(write); url != "" {
					return url
				}
			}
		}
	}
	// Look for a default location
	if config.DefaultDocker != nil {
		logrus.Debugf(` Using "default-docker" configuration`)
		if url := config.DefaultDocker.signatureTopLevel(write); url != "" {
			return url
		}
	}
	logrus.Debugf(" No signature storage configuration found for %s", ref.PolicyConfigurationIdentity())
	return ""
}
func (config *registryConfiguration) signatureTopLevel(ref dockerReference, write bool) string {
	if config.Docker != nil {
		// Look for a full match.
		identity := ref.PolicyConfigurationIdentity()
		if ns, ok := config.Docker[identity]; ok {
			logrus.Debugf(` Using "docker" namespace %s`, identity)
			if url := ns.signatureTopLevel(write); url != "" {
				return url
			}
		}

		// Look for a match of the possible parent namespaces.
		for _, name := range ref.PolicyConfigurationNamespaces() {
			if ns, ok := config.Docker[name]; ok {
				logrus.Debugf(` Using "docker" namespace %s`, name)
				if url := ns.signatureTopLevel(write); url != "" {
					return url
				}
			}
		}
	}
	// Look for a default location
	if config.DefaultDocker != nil {
		logrus.Debugf(` Using "default-docker" configuration`)
		if url := config.DefaultDocker.signatureTopLevel(write); url != "" {
			return url
		}
	}
	logrus.Debugf(" No signature storage configuration found for %s", ref.PolicyConfigurationIdentity())
	return ""
}
func ( config * registryConfiguration ) signatureTopLevel ( ref dockerReference , write bool ) string { if config . Docker != nil { // Look for a full match. identity := ref . PolicyConfigurationIdentity ( ) if ns , ok := config . Docker [ identity ] ; ok { logrus . Debugf ( ` Using "docker" namespace %s` , identity ) if url := ns . signatureTopLevel ( write ) ; url != " " { return url } } // Look for a match of the possible parent namespaces. for _ , name := range ref . PolicyConfigurationNamespaces ( ) { if ns , ok := config . Docker [ name ] ; ok { logrus . Debugf ( ` Using "docker" namespace %s` , name ) if url := ns . signatureTopLevel ( write ) ; url != " " { return url } } } } // Look for a default location if config . DefaultDocker != nil { logrus . Debugf ( ` Using "default-docker" configuration` ) if url := config . DefaultDocker . signatureTopLevel ( write ) ; url != " " { return url } } logrus . Debugf ( " " , ref . PolicyConfigurationIdentity ( ) ) return " " }
// config.signatureTopLevel returns an URL string configured in config for ref, for write access if “write”.
// (the top level of the storage, namespaced by repo.FullName etc.), or "" if no signature storage should be used.
config . signatureTopLevel returns an URL string configured in config for ref for write access if “write” . ( the top level of the storage namespaced by repo . FullName etc . ) or if no signature storage should be used .